Provide more and in-depth chart examples for programatically creating charts

I’m trying to create a stacked bar chart with non-entity data programatically.
This would probably mean using multiple bar series. The documentation is not sufficient and confusing.

eg, how do multiple barseries fit in a single dataset.

It tried using the AI assistant. I already have more than 10 conversations, the answers are plain out wrong, and I encounter lots of hallucinations referring to non-existant classes and methods.

If I get it working Ill provide an example of my own for future reference in this thread.

1 Like

Hi Tom!

Have you seen our examples in the online demo application?

UI Samples :: Stacked Bar Chart

Dmitriy

Yes,
and very good that those samples are there.

But it doesn’t help me in my current case. The barseries in my case are dynamic, I need to add them programatically.

I have a code example that might help you, however it is not a production ready solution, but it is better than nothing. :slight_smile:

Here is the project i prepared when implementing the Charts Add-on.
In this project you can find the implementation of programmatic adding and removing bar series in the chart component.

You can find it in the BarSeriesView controller.

charts-add-on.zip (507.4 KB)

Regards,
Dmitriy

Thanks for the reply but still not sufficient for me :wink:

In your example the structure of the data is still static. Your TransportCount class is known before and you only have 3 categories

  1. cars
  2. motorcycles
  3. bicycles

In my case, those categories are entered by the user. consider something like following screenshot. I basically get cost data from many external sources. Each entry in the cost data has a code that means something in an external system. I then aggregate it according to time period and code.
image