Bar chart | Urbi Pro | 2GIS Documentation
Urbi Pro

Bar chart

A bar chart displays the data values as horizontal bars.

Use a bar chart to compare the values ​​of a certain data attribute in different groups or ranges.

Case examples:

  • compare the mean rating values ​in different categories of food service:

    Bar chart comparing the mean rating
  • compare the number of firms with different legal forms:

    Bar chart comparing the number of firms
  • The Y-axis displays groups of data values. As a grouping attribute, you can select:

    • Text attributes: for example, firm category, building purpose, and others.

    • Numeric attributes: for example, number of reviews, building area, and others. To display data as multiple columns, specify the number of ranges and their limits in the Number of ranges field when creating a widget or editing it. You can set up ranges of different sizes. The specified upper limit is not included in the range.

      If you need to use a continuous scale and automatically set equal ranges of values ​​(set a step size), use a histogram.

  • The X-axis displays aggregated values ​​for each group. The column length depends on the value. Aggregation is performed within one group or range. As an aggregation attribute, you can select:

    • Number of objects: to count the number of values ​​in a group or range.
    • Numeric attributes: to count the total, mean, minimum, or maximum value of this attribute within each group using aggregation functions.
  • Instead of a bar chart, you can use a column chart: they differ only in the orientation of the axes.

Example of creating a bar chart
  1. Go to the Dashboards tab.

  2. Open the required dashboard.

  3. To open the scene, use the arrows Left arrow and Right arrow. If there is only one scene in a dashboard, it opens automatically when you open the dashboard.

  4. To open the list of layers, click Layers icon.

  5. Click Layer menu icon next to the required layer and select Create widget.

  6. Specify the required parameters:

    • Layer: data layer that is used to build a graph on the widget.
    • Grouping attribute: attribute that is used to group data.
    • Grouping attribute value: if you select a text grouping attribute, specify its values. You can select particular values ​​from the sample in the drop-down list or generate the top 5 or top 10 values ​​from the sample (the top values ​​are automatically calculated based on the aggregation attribute).
    • Aggregation attribute: attribute that is used to aggregate data and calculate the values. If you want to display only the number of values, select Number of objects.
    • Aggregation type: function that is used to calculate aggregation attribute values. Aggregation is performed within each group or range of data.
  7. Set the remaining widget parameters if necessary.

  8. Click Create.

A new widget is created and automatically added to the selected dashboard scene.

Note

When working with the uploaded data, make sure that at least one attribute is specified in it to build a graph on the widget.

Parameter
Description
Widget name Widget name.
Layer Data layer that is used to build a graph on the widget.
Description Text description of the widget. You can format the text: customize headings; make the text bold, italic, or underline the text; add a link; select the text color from the palette or specify it in RGB, HSL, or HEX format.
Change widget type Click to select another widget type from the list. The configured widget parameters are saved.
Parameter
Description
Grouping attribute Attribute that is used to group data on the graph. Displayed on the Y-axis.
Grouping attribute value The number of horizontal bars that are displayed on the graph. As values, you can select the following:
  • Any attribute values ​​from the sample in the drop-down list. You can change the order of the bars on the graph if necessary.
  • The top 5 or top 10 values ​​from the sample that are automatically calculated based on the aggregation attribute. To display the sum of the last value in the top and the remaining values ​​in the sample below this position in the last bar on the graph, select the Show other checkbox.

For text grouping attributes only.
Number of ranges The number of ranges (columns) that are displayed on the graph. The available number of ranges depends on the data, the maximum number is 10. Ranges are calculated automatically, but you can set them manually by entering the required range limits. The specified upper limit is not included in the range.

To add a range, click Plus icon. To delete a range, click Trash icon. To recalculate ranges after configuration, click Recalculate ranges.

For numeric grouping attributes only.
Parameter
Description
Aggregation attribute Number of objects or a numeric attribute that is used to aggregate data on the graph. Aggregation is performed within each group or range of data. Displayed on the X-axis.
Aggregation type Function that is used to calculate aggregation attribute values in each group or range of data:
  • Sum: the sum of the values.
  • Mean: the mean value.
  • Min: the minimum value.
  • Max: the maximum value.
Parameter
Description
Color Different color settings are available, depending on the type of grouping attribute (text or numeric):
  • For text grouping attributes: selecting a color scale (a set of prepared color samples) according to which elements on the graph are colored.
  • For numeric grouping attributes: selecting a color according to which elements on the graph are colored. You can select a color from the palette or specify it in HEX format.
Parameter
Description
Labels Labels of attribute values ​​on the X and Y axes.
Axes Axes on the graph.
Grid Grid on the graph.
Parameter
Description
Show legend Shows the values ​​of the grouping attribute and the corresponding values ​​of the aggregation attribute.
For text grouping attributes only.
Values ​​in percentage Shows the values ​​of the aggregation attribute as a percentage.
For text grouping attributes only.
Show source Shows the name of the data layer, the grouping attribute and the aggregation attribute with the corresponding axes, and also the aggregation type.
Show empty ranges Shows on the graph the ranges of values ​without data.
For numeric grouping attributes only.
Total value Shows the sum of the values ​​of the grouping attribute in the sample.
For numeric grouping attributes only.
Mean value Shows the mean value of the grouping attribute in the sample.
For numeric grouping attributes only.
Minimum value Shows the minimum value of the grouping attribute in the sample.
For numeric grouping attributes only.
Maximum value Shows the maximum value of the grouping attribute in the sample.
For numeric grouping attributes only.
Total objects in the asset Shows the number of objects in the sample that is used to calculate the values.