jQuery UI Widgets Forums Chart series update undefined index

Tagged: 

This topic contains 7 replies, has 2 voices, and was last updated by  thalyric 11 years, 11 months ago.

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
  • series update undefined index #5428

    thalyric
    Member

    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?

    series update undefined index #5431

    Peter Stoev
    Keymaster

    Hi thalyric,

    If the data source has an invalid value, undefined or empty value, that exception will be thrown by jqxChart.

    Best Regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com

    series update undefined index #5441

    thalyric
    Member

    Well 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” 🙁

    • This reply was modified 11 years, 12 months ago by  thalyric.
    series update undefined index #5443

    Peter Stoev
    Keymaster

    Hi thalyric,

    How do you change the datasource and the series? What code do you use for that?

    Best Regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com

    series update undefined index #5444

    thalyric
    Member

    I 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

    • This reply was modified 11 years, 12 months ago by  thalyric.
    series update undefined index #5696

    thalyric
    Member

    Any idea’s?

    Is there a way to destroy the chart?

    for example

    $(“myelement”).jqxChart(“destroy”);

    series update undefined index #5715

    Peter Stoev
    Keymaster

    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 Stoev

    jQWidgets Team
    http://www.jqwidgets.com

    series update undefined index #5719

    thalyric
    Member

    Thnx!

    That did the trick .. I used the remove to remove the element, then added the element back and applied the plugin …

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

You must be logged in to reply to this topic.