Dotted Legend Marker - CanvasJS JavaScript Charts
Dotted Legend Marker - CanvasJS JavaScript Charts
by canvasjs
HTML
<script src="https://canvasjs.com/assets/script/canvasjs.min.js"></script>
<br/><!-- Just so that JSFiddle's Result label doesn't overlap the Chart -->
<div id="chartContainer" style="height: 360px; width: 100%;"></div>
JavaScript
var chart = new CanvasJS.Chart("chartContainer", {
title: {
text: "CanvasJS - Dotted Legend Marker"
},
data: [
{
type: "line",
lineDashType: "line",
showInLegend: true,
markerSize: 0,
color : "#FFA500",
dataPoints: [
{ x: 10, y: 4 },
{ x: 20, y: 3 },
{ x: 30, y: 6 },
{ x: 40, y: 11},
{ x: 50, y: 21},
{ x: 60, y: 9 },
{ x: 70, y: 3 },
{ x: 80, y: 4 },
{ x: 90, y: 7 }
]
} ,
{
type: "line",
lineDashType: "dot",
showInLegend: true,
legendMarkerType: "square",
legendMarkerColor :"white",
markerSize: 1,
color : "#FFA500",
dataPoints: [
{ x: 10, y: 14 },
{ x: 20, y: 13 },
{ x: 30, y: 16 },
{ x: 40, y: 11},
{ x: 50, y: 2},
{ x: 60, y: 19 },
{ x: 70, y: 13 },
{ x: 80, y: 14 },
{ x: 90, y: 17 }
]
}
]
});
chart.render();