You must be logged in to post your query.
Home › Forums › Chart Support › line graph with values inside data points
Tagged: line graph
Hi, is it possible to put the value of the data inside the point on a line graph? I can change the size / colour and shape, but not put the value inside?
I’ve got this so far… but as you can see the index labels are not in the middle of the circles…. any ideas?
<!DOCTYPE HTML> <html> <head> <script> window.onload = function () { var chart = new CanvasJS.Chart("chartContainer", { theme: "light2", title:{ text: "Attendance" }, axisY:{ includeZero: false, interval: 2 }, data: [{ type: "line", indexLabel: "{y}%", markerType: "circle", markerColor: "orange", markerSize: 36, indexLabelFontSize: 16, indexLabelFontColor: "white", lineColor: "orange", dataPoints: [ { label: 'SEP', y: 95 }, { label: 'OCT', y: 95 }, { label: 'NOV', y: 95 }, { label: 'DEC', y: 95 } ] }, { type: "line", indexLabel: "{y}%", markerType: "circle", markerColor: "blue", markerSize: 36, indexLabelFontSize: 16, indexLabelFontColor: "white", lineColor: "blue", dataPoints: [ { label: 'SEP', y: 98 }, { label: 'OCT', y: 92 }, { label: 'NOV', y: 93 }, { label: 'DEC', y: 97 } ] } ], }); chart.render(); } </script> </head> <body> <div id="chartContainer" style="height: 300px; width: 100%;"></div> <script src="https://cdn.canvasjs.com/canvasjs.min.js"></script> </body> </html>
@haverer,
You can achieve the above requirement by adding an extra series of bubble chart and displaying indexLabel for the same as shown in this JSFiddle.
____ Shashi Ranjan Team CanvasJS
hey @shashiranjan can you plesae help me, here is my question https://canvasjs.com/forums/topic/stacked-histogram-with-zoom-capability-ans-numeric-x-axis/ please have a look and let me know if it is possible. its really urgent
@mynktpt,
We have addressed the issue over this thread Stacked Histogram with zoom capability and numeric x-axis. Please check/revert back in the same thread.
You must be logged in to reply to this topic. Login/Register