Search code examples
canvasjs

How to reflect line type in legend in canvasjs


I have a graph of two lines, one of type solid, the other of type dashed, however the legend shows them both as solid. Is there a way to have the dashed line show up in the legend to accurately reflect what line matches what legend data?

graph example


Solution

  • Though this feature is currently not available, you can workaround this problem by setting legendMarkerType to "triangle" with color same as that of chart background. Here is a jsfiddle.

    legendMarkerType: "triangle",
    legendMarkerColor :"white",