Charts for beginners

Hi!

I want to add a chart to my dashboard to show the number of users enrolled in one activity, depending on their nationality, but I cannot handle the setting up of the ChartJS plugin. This is what I have:

  • A data type “User” with a field “Nationality” (the user selects it in his profile using a dropdown menu).
  • A data type Activity with a field “People enrolled” (it stores the Users that enrolls in an Activity) and “People erased” (it stores the Users that cancel their attendance to an Activity).

In the plugin, I have to enter these 4 fields:

  • Type of data: I guess it’s “User”
  • Data source: I guess I have to “do a research for Activities”, but it stays in red as an error.
  • Value expression: I don’t know what to write here to load the amount of Users.
  • Label expression: I don’t know what to write here to load the 2 kinds of Activities.

Any ideas, please? Maybe the problem is that this plugin has to be connected directly to a JSON file only, or I can connect it dynamically to my data stored in Bubble database? Maybe there´s another plugin to do this?

Thanks a lot!

1 Like

Hi,

I’ve found the solution simply reading the Bubble reference (I did before, but now I’ve understood it well). So:

Chart type
Select the type of chart to display. Choose from Line, Bar, Radar, Pie, and Doughnut.

Type of data
Define the type of the list of things this chart will display. The type must have a field that is a number.

Data source
This is the list to display in the chart. Typically, it will be the result of a search.

Value expression
This field defines how to calculate the Y value of the chart. It will use one of the number fields of the current type of thing.

Label expression
This field defines how to describe each data point. It will use one of the text fields of the current type of thing.

Reference: https://bubble.io/reference#Plugins.chartjs

Thanks anyway!

3 Likes

This topic was automatically closed after 70 days. New replies are no longer allowed.