[Chartjs]-Chart.js โ€“ user add the final point of the line

0๐Ÿ‘

I think you cannot draw a line using chart.js the best solution would be a shift to D3 charts where you can make custom charts lines etc..

You can create a line using D3 as below

var svgContainer = d3.select("body").append("svg")
    .attr("width", 200)
    .attr("height", 200);


var circle = svgContainer.append("line")
    .attr("x1", 5)
    .attr("y1", 5)
    .attr("x2", 50)
    .attr("y2", 50)
    .attr("stroke-width", 2)
    .attr("stroke", "black");

Leave a comment