Suggested way to add Data to Charts

I’m having some difficulties in understanding what’s more future proof for adding data to Charts.
The documentation ( lists three different approaches:
1 - DataProvider, but ListDataProvider is deprecated
2 - CollectionDatasource
3 - Simpified Data Binding API, which looks like the new way, but MapDataItem is already (or still?) deprecated. Also, I can add data with this method, but how can I remove it from the chart?

Is using a Datasource the suggested way to handle this? Are ValueCollectionDatasource flexible enough to handle directly custom data produced by Services and Controllers?


All approaches described in the documentation can be used for data binding. Classes from the package are deprecated, but there are new ones for the same purpose in the package (as mentioned in the java doc).

There are some samples in our Sampler app, that clarify charts usage:

  1. ListDataProvider with [url=]EntityDataItem[/url], [url=]MapDataItem[/url], [url=]SimpleDataItem[/url]
  2. [url=]Incremental update[/url] (adding and removing data). The datasource is used as an axample, but both Datasource and ListDataProvider have methods for adding, updating and removing data with triggering chart update.
  3. [url=]ValueDatasource[/url]


1 Like