highcharts / highcharts-android

Android wrapper for Highcharts usage
Other
126 stars 30 forks source link

Is it possible to update a chart in Highcharts Android with new data points w/o reloading the entire graph? #244

Closed teraiyamayurcontact closed 1 year ago

teraiyamayurcontact commented 1 year ago

[](url)

on left & right arrow click i want update graph according to new data but it is not working.

i am looking for solution in native android sdk.

Thanks in advance

soommy12 commented 1 year ago

Hi @teraiyamayurcontact ! Thanks for the question. It is possible! You can add the following code to your listener:

        exampleButton.setOnClickListener(view -> {
            HIColumn newColumn = new HIColumn();
            Number[] newColumnData = new Number[] { 0.22441811642798026, 0.7513558282273284, 0.47233378113842406, 0.448150689615636, 0.3796370223648643 };
            newColumn.setData(new ArrayList<>(Arrays.asList(newColumnData)));
            newColumn.setName("New column");
            options.setSeries(new ArrayList<>(Collections.singletonList(newColumn)));
            chartView.update(options);
        });

The example is using column series but you can use whatever you want.

teraiyamayurcontact commented 1 year ago

Uncaught ReferenceError: updateOptions is not defined Uncaught ReferenceError: chart is not defined

i am receiving above log.