javascript - Chart.js, dashed line, full width chart -
is possible make dashed line on chart.js line chart? , make chart full width? see attached mockup.
this current code (just simple example):
var ctx = document.getelementbyid("main-line-chart").getcontext("2d"); var line = ctx.setlinedash([5, 15]); var gradient = ctx.createlineargradient(0, 0, 0, 300); gradient.addcolorstop(0, 'rgba(40,175,250,.25)'); gradient.addcolorstop(1, 'rgba(40,175,250,0)'); var data = { labels: ["january", "february", "march", "april", "may", "june", "july"], datasets: [ { label: "my first dataset", pointdot : false, fillcolor: gradient, strokecolor: "#28affa", pointcolor: "#19283f", pointstrokecolor: "#28affa", pointhighlightfill: "#19283f", pointhighlightstroke: "#28affa", data: [65, 59, 80, 81, 56, null, null] }, { label: "my second dataset", fillcolor: "rgba(0,0,0,0)", strokecolor: "rgba(255,255,255,.39)", pointcolor: "#19283f", pointstrokecolor: "rgba(255,255,255,.39)", pointhighlightfill: "#19283f", pointhighlightstroke: "#28affa", data: [null, null, null, null, 56, 27, 90] } ] }; var options = {}; var mylinechart = new chart(ctx).line(data, options); console.log(mylinechart);
Comments
Post a Comment