jQWidgets Forums

jQuery UI Widgets Forums Chart Determine if legend is visible

This topic contains 2 replies, has 2 voices, and was last updated by  Florian Auer 10 years, 9 months ago.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
  • Determine if legend is visible #59924

    Florian Auer
    Participant

    Hi all

    In a chart the legend can be toggled by using $('#jqxChart').jqxChart({showLegend: false}); and $('#jqxChart').jqxChart({showLegend: true});
    But is there also a way to determine if the legend ist already visible or not?
    A call to the property is not working as it seems: $('#jqxChart').jqxChart('showLegend');

    Thx for any advice

    Determine if legend is visible #59930

    Peter Stoev
    Keymaster

    Hi DesMas,

    showLegend turns on or off the legends. It does not determine if a specific legend is shown. The property works correctly.

          $("#chart1").jqxChart({showLegend: true}); // sets to true
                var showLegendValue = $("#chart1").jqxChart('showLegend'); // returns true
    
                $("#chart1").jqxChart({showLegend: false}); // sets to false
                var showLegendValue = $("#chart1").jqxChart('showLegend'); // returns false
    

    Best Regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com/

    Determine if legend is visible #59994

    Florian Auer
    Participant

    Hi Peter

    Thx for the reply.
    You were right. It seems I destryoed the ‘showLegend’ property earlier by setting it to a wrong value of ‘undefined’.
    That was the reason why I later on was not able to grab the correct value out of the chart 🙂

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

You must be logged in to reply to this topic.