javascript - Chartist JS, line graph going under X axis -
currently i'm using chartist js jquery plugin , i'm having issue 1 of function going below x axis though doesn't have negative points.
is there anyway avoid issue, please check image further understanding.
the code
var options = { low: 0, fullwidth: true, height: '225px', chartpadding: { left: 0, right: 40, }, showarea: true, onlyinteger:true, beziercurve:false }; $.ajax({ url: $('.ct-log-lead').data('url'), method: 'get', data: {customerid:$('.ct-log-lead').data('id'),phonenumber: $('.ct-log-lead').data('phone')}, success: function (d) { data = { labels: d[0], datasets: d[1] }; // var leadslastsevendays = 0; // data.datasets[0].foreach(function (value) { // leadslastsevendays += value; // }) // $('.call-seven').html(d[2]); var = new chartist.line('.ct-log-lead', { labels: data.labels, series: [ { name: 'form leads', data: data.datasets[0] }, { name: 'call logs', data: data.datasets[1] } ], }, options); } });
thanks
i faced same problem add in options variable , more information default chartist uses cardinal spline algorithm smooth lines.you can customize eaisly.
linesmooth: chartist.interpolation.simple({ divisor: 2 }),
see both of fiddles http://jsfiddle.net/van_jarvis/3ul7zu4o/113/
Comments
Post a Comment