jQWidgets Forums

jQuery UI Widgets Forums Chart how to reload data source

This topic contains 1 reply, has 2 voices, and was last updated by  Dimitar 11 years, 4 months ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
  • how to reload data source #31122

    flic_75
    Member

    i create a jqxChart and load json-datas from a Server, the user can change some details like from date and to date, and then i like to reload the chart.

    I hav try this: $(‘.diagramm’).jqxChart(‘refresh’);
    But They only repaint the chart. I want that the chart send a new request to the Server with the same $.jqx.dataAdapter. What can i do?

    <div id='jqxChartMonat' class="diagramm"></diV>
    var source ={	datatype: "json",
    url: "/json/quoten/monatsDurchschnittStatistik/"
    };
    var dataAdapter = new $.jqx.dataAdapter(
    source,
    { async: false,
    autoBind: true,
    beforeSend: function (xhr,settings){ settings.url += getFilterDatasFromForm(); },
    loadError: function (xhr, status, error) { alert('Error loading "' + source.url + '" : ' + error);
    }
    });
    var settings = { title: "title",
    description: "zeigt was an",
    padding: { left: 15, top: 5, right: 25, bottom: 5 },
    source: dataAdapter,
    categoryAxis:{ dataField: 'MONAT',
    showGridLines: true,
    description: 'description'
    },
    colorScheme: 'scheme07',
    seriesGroups:[{ type: 'column',
    valueAxis:{
    displayValueAxis: true,
    description: 'values'
    },
    series: [{ dataField: 'proz', displayText: 'displayText', opacity:0.3 }]
    }]
    };
    $('#jqxChartMonat').jqxChart(settings);
    how to reload data source #31161

    Dimitar
    Participant

    Hello flic_75,

    To refresh the chart successfully, please call the dataAdapter dataBind method before that, i.e.:

    dataAdapter.dataBind();
    $(‘.diagramm’).jqxChart(‘refresh’);

    Best Regards,
    Dimitar

    jQWidgets team
    http://www.jqwidgets.com/

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

You must be logged in to reply to this topic.