$('#id').data('jqplot') does return undefined

17 views
Skip to first unread message

helmut8080

unread,
Nov 4, 2018, 3:23:19 PM11/4/18
to jqplot-users
Hi,


$('#chart1').data('jqplot');

should return the jqplot object after creating a plot by $.jqplot("chart1", data, options). The chart is shown as expected on the page.

However, for

$(window).resize(function()
 
{
   
var chart = $('#chart1').data('jqplot');
    alert
(chart)
 
});

I get "undefined", although $('#chart1') returns a valid node with e.g. $('#chart1').jqplot returning the jqplot function. Am I doing something wrong?

For some reasons I need to retrieve the jqplot object from dom and I can not use the jqplot object returned by $.jqplot("chart1", data, options).

Thanks,
Helmut


Reply all
Reply to author
Forward
0 new messages