Create a simple chart

Hello,

I tried to follow your example from here:
https://doc.cuba-platform.com/charts-latest/charts.html#chart_example
but I need some help. I use Cuba Studio Idea Plugin.

  1. Open the Project Properties editor in CUBA Studio: click CUBA → Project Properties main menu item. Add the charts application component in the App components list. Confirm when Studio suggests recreating Gradle scripts.

If I open Cuba-Project Properties I have this screen:

Where is the App Components list?
However I suppose that you mean to add in Cuba - Marketplace, Chart add-on. I did that.

Now in CUBA Platform. Displaying Charts And Maps it says:
Add the chart component to the screen …

How can I do that?

Also I tried to follow this example
https://demo10.cuba-platform.com/sampler/#main/7/sample?id=pie-chart

but I have the following empty result:


Please advise!

Hi!

Thank you for reporting a problem with the documentation, we will fix it.

You can use Screen Designer for adding charts.

image

Or do it manually adding the XSD scheme to the xmlns:

<window ...
        xmlns:chart="http://schemas.haulmont.com/charts/charts.xsd">

<chart:pieChart id="pieChart">
...
</chart:pieChart>

Probably, in your case, PieChart has no data. Could you share a demo project where your problem is reproduced?

1 Like

I changed with pieChart 3D and now it’s working.
To be honest I don’t know what happened.

Another question: I saw that Cuba use charts from https://www.amcharts.com.
How is the situation from the license point of view (the charts are proprietary or open source)?

Also I saw a very good example with Vaadin ChartJs (charts).

What do you advise us to use (Vaadin ChartJs or amcharts add on)?

Thank you!

AmCharts has paid and free licenses. If you want to use free license you must show AmChart label in your chart (it is shown by default if you don’t have a paid license):

image

For more information see: AmChart store

1 Like