There's a nice new release of Chart.js out, which appears to be a little more intuitive to use. But I'm trying some code designed with V1 and it's not working, but getting this deep into it, is a little beyond me - the code I'm trying to use is the last post here - http://yuluer.com/page/dbajceij-chart-js-draw-horizontal-line.shtml
My code for the line graph is as follows:
$.ajax({
url : "getData.asp",
type: "POST",
data : {
database: dataBase,
sn: Options,
opts: opt,
dateRange: dateRange
},
dataType:"json",
success: function(result){
var Result = (result)
Array.prototype.mapProperty = function(property) {
return this.map(function (obj) {
return obj[property];
});
};
var ctx = document.getElementById("chart");
var myChart = new Chart(ctx, {
type: 'line',
data: {
labels: result.mapProperty('sn'),
datasets: [{
label: opt,
data: result.mapProperty('data')
}]
},
options: {
scales: {
yAxes: [{
ticks: {
beginAtZero: false
}
}]
}
}
});
})
Has anyone managed to get custom dynamic straight lines on V2?