Valores chartJS não se repetir
Pessoal, bom dia!
Tô com um problema aqui, seguinte, tenho esse gráfico, os valores já estão funcionando belezinha, mas os valores em tempo, por exemplo no final onde ambos são 98, ou qualquer outro valor que se repita, tipo: 10 > 10 > 30 > 50 > 90 > 60 > 60 ele fique em um ponto só eliminando o repetido, ou seja, onde está 10 ou 60 vire apenas 10 ou 60 e não se repetindo.
Não sei se fui claro kkk mas aqui está um print e meu código.
<script language="javascript" type="text/javascript">
function rampa_mostura() {
//temperaturas
var temperatura_glucanase = form_eficiencia_epata_1.glucasane.value;
var valor_1 = form_eficiencia_epata_1.glucasane.value;
var valor_2 = valor_1;
var valor_3 = form_eficiencia_epata_1.protease.value;
var valor_4 = valor_3;
var valor_5 = form_eficiencia_epata_1.beta_amilase.value;
var valor_6 = valor_5;
var valor_7 = form_eficiencia_epata_1.alfa_amilase.value;
var valor_8 = valor_7;
var valor_9 = form_eficiencia_epata_1.inativacao.value;
var valor_10 = valor_9;
//tempos
var tempo_1 = 0;
var tempo_2 = parseInt(tempo_1)+parseInt(form_eficiencia_epata_1.glucanase_min.value);
var tempo_3 = parseInt(tempo_2)+parseInt(valor_3-valor_2);
var tempo_4 = parseInt(tempo_3)+parseInt(form_eficiencia_epata_1.protease_min.value);
var tempo_5 = parseInt(tempo_4)+parseInt(valor_5-valor_3);
var tempo_6 = parseInt(tempo_5)+parseInt(form_eficiencia_epata_1.beta_amilase_min.value);
var tempo_7 = parseInt(tempo_6)+parseInt(valor_7-valor_6);
var tempo_8 = parseInt(tempo_7)+parseInt(form_eficiencia_epata_1.alfa_amilase_min.value);
var tempo_9 = parseInt(tempo_8)+parseInt(valor_9-valor_8);
var tempo_10 = parseInt(tempo_9)+parseInt(form_eficiencia_epata_1.inativacao_min.value);
var ctx = document.getElementById('myChart').getContext('2d');
var chart = new Chart(ctx, {
// The type of chart we want to create
type: 'line',
// The data for our dataset
data: {
//tempo
labels: [tempo_1,tempo_2,tempo_3,tempo_4,tempo_5,tempo_6,tempo_7,tempo_8,tempo_9,tempo_10],
datasets: [{
label: "Rampa de temperatura - Mostura",
backgroundColor: 'transparent',
borderColor: '#FFB22B',
borderWidth: 3,
radius: 5,
//temperatura
data: [valor_1,valor_2,valor_3,valor_4,valor_5,valor_6,valor_7,valor_8,valor_9,valor_10],
}]
},
// Configuration options go here
options: {
elements: {
line: {
tension: 0, // disables bezier curves
}
},
title:{
display: true,
fontSize: 20,
text: "RAMPA DE TEMPERATURA"
},
labels:{
fontStyle: "bold"
},
scales: {
xAxes: [{
display: true,
scaleLabel: {
display: true,
labelString: 'Tempo em minutos'
}
}],
yAxes: [{
display: true,
scaleLabel: {
display: true,
labelString: 'Temperatura em ºC'
}
}]
}
}
});
}
</script>
Discussão (2)
Carregando comentários...