Home forums Report Bugs legendMarkerType hidden when many points rendered on line chart

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
  • #8105

    When displaying a line style chart and using a legend with a legendMarkerType set, the legend marker reverts to a simple line if the number of points rendered causes the markers on the actual chart line to disappear.

    You can see this in action by adding legendMarkerType: “square”, showInLegend:true to your Basic Line Example

    Line Chart

    and resizing the web page to be very narrow. When the line markers disappear, so does the legend marker.

    In my case I’m rendering several thousand data points in several chart lines and so the legend is always a simple line which is hard to see. I want to make them a square.

    Other chart types don’t exhibit this property, for example, setting the type to scatter will always render the legendMarkerType regardless of the number of points displayed.

    • This topic was modified 6 years, 1 month ago by Robert.
    • This topic was modified 6 years, 1 month ago by Robert.


    By default, the chart tries to decide if markers should be shown or not based on the number of dataPoints available.

    You can override this behavior by setting markerSize as shown in this jsfiddle.

    Sunil Urs


    Groovy. Thanks for the quick response. I also added markerType: “none” to keep the lines from getting lumpy.



    Thanks again, great product.

    • This reply was modified 6 years, 1 month ago by Robert.

    I have many data lines, with the smart hiding feature, some of them show markertype, some not, this create big vision inconsistency.

    Could we make an option to force the marker type show?



    legendMarkerType falls back to markerType set in the dataSeries. Setting markerType / legendMarkerType to ‘none’ would be the reason in this scenario. Can you kindly create jsfiddle with sample data, so that we can understand your code better and help you out?

    Vishwas R
    Team CanvasJS

Viewing 5 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic.