Home forums Chart Support Hiding the legend on a small screen

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
  • #24966


    How would I go about hiding the legend on a smaller screen? See my jsfiddle here.

    As you can see, a legend with a large number of data series tends to squash the actual data when the graph has a limited height (130px). I would like the legend to display:none when viewing the graph on a small screen device, e.g. less than 500px.

    Kind regards



    You can hide all the legends based on chart height or window width by setting showInLegend to false for smaller screen devices as shown in this JSFiddle.

    Vishwas R
    Team CanvasJS


    Thanks Vishwas. That’s brilliant.

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

You must be logged in to reply to this topic.