1
I am learning to work chartsjs bring date, with value January with 10 clients, the scale is 0.5, 1.0,1.5,2.0 I would like to deichar with 1,2,3,4,... there is no half client
/*********************************** GRÁFICO DE LINHAS DIARIO ***********************************/
function os_dia() {
var periodoDia = $('#os_select').val();
$.ajax({
type: 'POST',
dataType: 'json',
data: {
periodoDia: periodoDia
},
url: BASE_URL + 'home/lista_homeDia',
success: function(resposta) {
console.log(resposta);
data = {
labels: Object.keys(resposta),
datasets: [{
label: 'OS por Dia',
data: ret(resposta),
borderWidth: 2,
borderColor: '#80B6ED',
backgroundColor: '#80B6ED',
fill: false
}]
};
options = {
labels: {
fontStyle: 'bold'
}
};
Chart.defaults.global.responsive = true;
var contexto = document.getElementById("graficoOsDia").getContext("2d");
grafico = new Chart(contexto, {
type: 'line',
data: data,
options: options
});
}
});
}
function ret(param) {
var valores = [];
$.each(param, function(key, val) {
valores.push(val);
});
return valores;
}
os_dia();
$("#os_select").change(function() {
os_dia();
});
Could provide your html code?
– Mário Rodeghiero