ui-chart icon indicating copy to clipboard operation
ui-chart copied to clipboard

Not working on 1.0.8 version of jqPlot

Open newtonwagner opened this issue 10 years ago • 3 comments

I've tried to use ui-chart with jqPlot 1.0.8 and kept getting error:

TypeError: elem.jqplot is not a function at renderChart (ui-chart.min.js:29) at Object.fn (ui-chart.min.js:33) at m.$get.m.$digest (angular.min.js:124) at m.$get.m.$apply (angular.min.js:127) at l (angular.min.js:81) at P (angular.min.js:85) at XMLHttpRequest.H.onload (angular.min.js:86)

The error was on line 29:

elem.jqplot(data, opts);

Looking for examples on jqPlot, looks like they have changed the way you use jqplot, so I've solved this changing the template to add an element ID, and calling the element ID on line 29:

template: '<div id="chart"></div>',
// ...
$.jqplot('chart',data, opts);

Worked fine! I will try to make a pull request changing this, but I need to figure out how to allow more than one chart for the same page (make the element id dynamic).

If someone has an idea about this, it would be great. ty.

newtonwagner avatar Aug 20 '15 19:08 newtonwagner

$.jqplot(elem.attr('id'), data, opts); is enough to make ui-chart back to work. No need to change the template. It is already dynamic! :)

newtonwagner avatar Aug 21 '15 19:08 newtonwagner

I had this problem and the fix above is working ! Anyone going to merge the pull request ?

tohyf avatar Dec 20 '15 08:12 tohyf

The first thing to do would be to fix Travis build, then fix the PR and their tests. Only then could it be merged.

PowerKiKi avatar Dec 21 '15 03:12 PowerKiKi