Skip to content
This repository has been archived by the owner on May 25, 2019. It is now read-only.

Not working on 1.0.8 version of jqPlot #20

Open
newtonwagner opened this issue Aug 20, 2015 · 3 comments
Open

Not working on 1.0.8 version of jqPlot #20

newtonwagner opened this issue Aug 20, 2015 · 3 comments

Comments

@newtonwagner
Copy link

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
Copy link
Author

$.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! :)

@tohyf
Copy link

tohyf commented Dec 20, 2015

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

@PowerKiKi
Copy link

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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants