📈Charts
Create a pie or bar chart connected to API data
Last updated
Create a pie or bar chart connected to API data
Last updated
Visualize your API data in a chart! This component allows you to generate data visualizations within your app using data from your backend tool.
Choose between pie and bar charts based on your data visualization needs. Select the format that best represents your information.
To create a pie chart, use:
To create a bar chart, use:
To add a chart component, create a rectangle element in your design file and add the tag [component:chart:X]
to it, replacing X
with one of the chart options described before. Place it inside a container.
We recommend creating another rectangle element as a background inside the same container. This is shown in the screenshot below and also in the example design file.
You've got everything needed in your design file to create a chart component! Now, import it into Bravo and connect it with data.
Depending on the chart type you're using, whether it's a pie or bar chart, you'll be able to bind different properties to it.
A chart needs to be bound to a list data item. Each of the items in the list will be a data element in the chart, where each chart can contain as many data elements as needed.
At the same time, each of the list data items obtained with the API request must contain individual data items that will be bound to the corresponding properties described below.
To get started, try our sample Airtable base. Duplicate it and use the Airtable Wizard to create some API requests targeting the base. This way, you'll already have some data to bind to the chart component.
A pie chart contains the following properties:
Chart data: This property must be bound to a list data item, containing all the data elements of the pie chart. This property has three subproperties inside it:
Value: The numeric value of a data element in the chart. In a pie chart, the percentage of each data element value, compared with the sum of values of all data elements, will be represented. This property needs to be bound to a numeric data item.
Color: The color of the pie portion corresponding to a data element. Needs to be bound to a data item containing the HEX representation of a color. (For instance, #FFFFFF for white). If this property is left unbound, a default color will be used.
Name: The tag name that will show together with the pie chart element.
Chart title: Optionally, you can add a title to the chart. This is done by binding this property to a single data item containing the chart title.
The properties of the pie chart component are bound as shown below, in Bravo's Data Binding section.
📊 Bar charts
A bar chart contains the following properties:
Chart data: this property must be bound to a list data item, containing all the data elements of the bar chart. This property has three subproperties inside it:
Value: The numeric value of a data element in the chart. In a bar chart, each data element will be represented as a bar, and will have a height proportional to its value, and the value of the other data elements.
Color: The color of the bar corresponding to a data element. Needs to be bound to a data item containing the HEX representation of a color. (For instance, #FFFFFF
for white). If this property is left unbound, a default color will be used.
Name: The tag name that will show together with the bar chart element.
Chart title: Optionally, you can add a title to the chart. This is done by binding this property to a single data item containing the chart title.
The properties of the bar chart component are bound as shown below, in Bravo's Data Binding section.
Once you have imported the design file with the chart component and bound the data, you can see the charts on Bravo Vision!
Design file
Airtable base
Your feedback is valuable to us. If you have any suggestions, questions, or issues, please don't hesitate to reach out to the community.