Line / data markers draws attention to the data point in chart. Most often the markers and lines are customized to make the respective Data Point / Series stand out from the rest. Line graph supports different styles of data markers which can be used to highlight data point of special interest. The given example shows Line Chart with markers. It also contains source code that you can edit in-browser or save to run locally.
window.onload = function () { var chart = new CanvasJS.Chart("chartContainer", { theme: "light2", // "light1", "light2", "dark1", "dark2" animationEnabled: true, title:{ text: "Share Value - 2016" }, axisX: { interval: 1, intervalType: "month", valueFormatString: "MMM" }, axisY:{ title: "Price (in USD)", includeZero: true, valueFormatString: "$#0" }, data: [{ type: "line", markerSize: 12, xValueFormatString: "MMM, YYYY", yValueFormatString: "$###.#", dataPoints: [ { x: new Date(2016, 00, 1), y: 61, indexLabel: "gain", markerType: "triangle", markerColor: "#6B8E23" }, { x: new Date(2016, 01, 1), y: 71, indexLabel: "gain", markerType: "triangle", markerColor: "#6B8E23" }, { x: new Date(2016, 02, 1) , y: 55, indexLabel: "loss", markerType: "cross", markerColor: "tomato" }, { x: new Date(2016, 03, 1) , y: 50, indexLabel: "loss", markerType: "cross", markerColor: "tomato" }, { x: new Date(2016, 04, 1) , y: 65, indexLabel: "gain", markerType: "triangle", markerColor: "#6B8E23" }, { x: new Date(2016, 05, 1) , y: 85, indexLabel: "gain", markerType: "triangle", markerColor: "#6B8E23" }, { x: new Date(2016, 06, 1) , y: 68, indexLabel: "loss", markerType: "cross", markerColor: "tomato" }, { x: new Date(2016, 07, 1) , y: 28, indexLabel: "loss", markerType: "cross", markerColor: "tomato" }, { x: new Date(2016, 08, 1) , y: 34, indexLabel: "gain", markerType: "triangle", markerColor: "#6B8E23" }, { x: new Date(2016, 09, 1) , y: 24, indexLabel: "loss", markerType: "cross", markerColor: "tomato" }, { x: new Date(2016, 10, 1) , y: 44, indexLabel: "gain", markerType: "triangle", markerColor: "#6B8E23" }, { x: new Date(2016, 11, 1) , y: 34, indexLabel: "loss", markerType: "cross", markerColor: "tomato" } ] }] }); chart.render(); }
You can easily choose between different styles of markers using markerType or change its size using markerSize. Some of the other customizations include markerColor, markerBorderColor, lineThickness, etc.