jQuery UI Widgets › Forums › Chart › series update undefined index
Tagged: series
This topic contains 7 replies, has 2 voices, and was last updated by thalyric 12 years, 5 months ago.
-
Author
-
Hi
I need to dynamicly change the series property. I’ve done this by re-applying jqxChart but with different series.
This works .. kinda .. when I alter the series with a new index and re-apply jqxChart.
But when I have a series with a index that is removed and then re-apply jqxChart , I get something like
uncaught exception: jqxChart: Data source contains invalid value at Index: 0, DataField: my_key
any thoughts on this?
Hi thalyric,
If the data source has an invalid value, undefined or empty value, that exception will be thrown by jqxChart.
Best Regards,
Peter StoevjQWidgets Team
http://www.jqwidgets.comWell I still don’t get it ..
What I’m trying to do
1) I have 3 checkboxs with location name for example “location 1” , “location 2” , “location 3″
2) When I check a checkbox, a call is made to the server to include that location in de chart.These are the console logs
—–
Step 1 : first 1 location is checked
—–datasource:
[Object { Day=”ma”, location_0=”10″}, Object { Day=”di”, location_0=”100″}, Object { Day=”wo”, location_0=0}, Object { Day=”do”, location_0=”40″}, Object { Day=”vr”, location_0=0}, Object { Day=”za”, location_0=0}, Object { Day=”zo”, location_0=0}]
series :
[Object { dataField=”location_0″, displayText=”location 1″}]
—–
Step 2 : Now I check another
—–datasource :
[Object { Day=”ma”, location_0=”10″, location_1=0}, Object { Day=”di”, location_0=”100″, location_1=”50″}, Object { Day=”wo”, location_0=0, location_1=”50″}, Object { Day=”do”, location_0=”40″, location_1=0}, Object { Day=”vr”, location_0=0, location_1=0}, Object { Day=”za”, location_0=0, location_1=0}, Object { Day=”zo”, location_0=0, location_1=0}]
series :
[Object { dataField=”location_0″, displayText=”location 1″}, Object { dataField=”location_1″, displayText=”location 2″}]
—–
Step 2 : Now I uncheck one
—–datasource :
[Object { Day=”ma”, location_0=”10″}, Object { Day=”di”, location_0=”100″}, Object { Day=”wo”, location_0=0}, Object { Day=”do”, location_0=”40″}, Object { Day=”vr”, location_0=0}, Object { Day=”za”, location_0=0}, Object { Day=”zo”, location_0=0}]
series:
[Object { dataField=”location_0″, displayText=”location 1″}]
And then I get the error “uncaught exception: jqxChart: Data source contains invalid value at Index: 0, DataField: location_1” 🙁
Hi thalyric,
How do you change the datasource and the series? What code do you use for that?
Best Regards,
Peter StoevjQWidgets Team
http://www.jqwidgets.comI just created a new settings object and then
$(“myelement”).jqxChart(settings);
each time I wanted to update the chart.
At first I had a fixed series, but the datasource changed. That worked well. But now I want the series to change on the fly.
Is there another way to remove the chart and restart the widget with new settings.
I’ve tried with the “refresh” method .. but no luck
Any idea’s?
Is there a way to destroy the chart?
for example
$(“myelement”).jqxChart(“destroy”);
Hi thalyric,
jqxChart does not have ‘destroy’ method. You can use the jQuery’s remove method to remove the Chart.
Example:
$(“myelement”).remove();
Best Regards,
Peter StoevjQWidgets Team
http://www.jqwidgets.comThnx!
That did the trick .. I used the remove to remove the element, then added the element back and applied the plugin …
-
AuthorPosts
You must be logged in to reply to this topic.