Home Forums Chart Support chart with ajax

chart with ajax

Viewing 2 posts - 1 through 2 (of 2 total)
  • #32352

    i need to update my chart when i clic button

    $(document).ready(function () {
            $(document).on('click', '#graphline', function () {
                data = [
                    {y: 10, label: 'aaa'},
                    {y: 11, label: 'bbb'},
                    {y: 12, label: 'ccc'},
                    {y: 13, label: 'd d'},
                    {y: 14, label: 'e e'},
                    {y: 15, label: 'f f'},
                    {y: 16, label: 'g g'}
                ]
                $.each(data, function (key, value) {
                    dataPoints.push({x: value[0], y: parseInt(value[1])});
                    xValue++;
                    yValue = parseInt(value[1]);
                });
                chart.render();
                alert('cc');
            });
    
        });
    #32372

    @awna,

    You can update the chart on button click by updating the chart options and calling render(). Please refer to this documentation page for step to step tutorial on the same.

    —-
    Manoj Mohan
    Team CanvasJS

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

You must be logged in to reply to this topic.