Bar Chart¶
The BarChart widget displays data visually as a bar chart. Data is sourced from the data model, with bar definitions specifying how data is mapped to chart elements.
Bar Definitions¶
A bar definition specifies a single bar within the chart. For each data element matching the XPath property, a new bar is created. The bar's value is determined by ValueXPath, and its label by LabelXPath.
To display a static label for a bar, enclose the desired label text in single quotes within the LabelXPath property. For example, to label a bar with "Sales", set LabelXPath to 'Sales'.
The YAxisValueFormat property defines the formatting of Y-axis values as either 'Numeric' or 'Date'.
Example¶
Consider a data model representing sales data:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 | |
The following BarChart configuration would render this data:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | |
This configuration would produce a bar chart where each bar represents a product, its height determined by the Count value, and labeled with the product Name, grouped by Category.
