Components

charts

8min

The component can display statistics related to data records (categorical variables). This can be used to show a single series or multiple series of data for comparative purposes and highlight specific regions or ranges on the chart to make it easier for users to interpret and analyze the data.This component is mostly used in jig.default or jig.list.

Understanding chart data

Chart data is structured in a way that makes it easy to display. To understand how to create the YAML for a chart in let's look at the data in various formats and how you can use the data in .

  • Let's start with the financial data per quarter for three years from a Microsoft Excel table, as shown below:
Excel data table
Excel data table

  • Next we map out the same data in Dynamic Data in . Notice that the data is exactly the same as the Excel data.
Dynamic Data table
Dynamic Data table

  • The same data can also exist in a JSON file. Using the Download button at the top-right of the Data-finance-data table shown above will download the data into a JSON file. The JSON is shown below.
JSON data
JSON data


Using the data in YAML

Now that you have your data you can convert it into the YAML needed for the charts. The data can be used as a static datasource or a dynamic datasource.

YAML - Static data

Using the finance-data.json it was easy to convert the data into YAML as shown below.

static-data


YAML - Dynamic Data

In you can use the data from the dynamic data table, in this instance data-Finance-data, then create a file under datasource folder. Use the Dynamic data provider that references the finance-data table with a query selecting the data you want to use, quarters and year in this example.

dynamic-data


YAML - Chart

In the YAML for charts the following keys are used: - yAxis - xAxis - categories - series

In this example the finance-data would show as follows for each key.

Chart YAML data described
Chart YAML data described


Now it is possible to create charts in YAML with the exact same data, for example a bar and line chart with the finance-data in the above YAML keys is shown below. Notice in the YAML below that the same YAML is used for both the bar and line chart.

Bar-chart
Line-chart


The component.bar-chart in the using the finance- data.

Bar chart in Jigx App
Bar chart in Jigx App


The component.line-chart in the using the finance- data.

Line chart in Jigx
Line chart in Jigx




Updated 17 Jan 2024
Doc contributor
Did this page help you?