Home forums Using CanvasJS Hiding the legend on a small screen

This topic contains 2 replies, has 2 voices, and was last updated by  Michaelp 2 months, 2 weeks ago.

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

    Hi

    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
    Michael

    #24971

    Michael,

    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

    #25033

    Thanks Vishwas. That’s brilliant.

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

You must be logged in to reply to this topic.