Bar chartΒΆ
Shows the differences or similarities between values. Bar chart data answers the question of "how many?" in each category.
UsageΒΆ
Use it to perform a comparison of values across different subgroups of data. From a bar chart, it can be seen which groups are highest or most common, and how groups compare against each other.
Basic variantΒΆ
The basic bar chart shows numerical comparisons across categories. One axis of the chart shows the specific categories being compared and the other axis is numeric in nature.
Multi-set variantΒΆ
This variation is used when two or more data series are plotted side-by-side and grouped together under categories, all on the same axis.
Stacked variantΒΆ
The stacked bar chart is used to show how a category is divided. It helps to understand what relationship each part has with the total amount.
Best practicesΒΆ
- Plot the bars against a zero-value baseline to accurately reflect the difference in the data.
- Use colors with purpose. Select accent colors to highlight meaningful changes.
- Bar charts can be vertical or horizontal. Horizontal bar charts work best when there are lots of different categories with long labels.
- Use common sense and adjust the width of the bars according to the amount of elements. The minimum bar width is
16px
.
DesignΒΆ
- Bars, 2. Y axis, 3.Legend, 4.Grid lines, 5. X axis
CodeΒΆ
UsageΒΆ
Required Packages
import { SiChartCartesianComponent } from '@siemens/charts-ng';
@Component({
imports: [SiChartCartesianComponent, ...]
})
Simple Bar ChartΒΆ
Stacked Bar ChartΒΆ
The same component can also be used in a stacked configuration.
SiChartCartesianComponent API DocumentationΒΆ
si-chart-cartesian
Input PropertiesΒΆ
Name | Type | Default | Description |
---|---|---|---|
additionalOptions ΒΆ | EChartOption | Used to override specific properties set in options . | |
autoZoomSeriesIndex ΒΆ | number | -1 | No auto dataZoom update) by default. Use together with visibleEntries . |
axisPointer ΒΆ | (undefined | string | boolean ) | false | Used to display axisPointer line either by click or mouse-move. |
customLegendAction ΒΆ | boolean | Enable custom legend click actions exposed by the selectionChanged event. | |
dataZoomFilterMode ΒΆ | FilterMode | 'none' | The data zoom filter mode. (see https://echarts.apache.org/en/option.html#dataZoom-inside.filterMode ) The value 'filter' will cause the lines to be disconnected to the outside of the chart. |
dataZoomMaxValueSpan ΒΆ | number | The upper limit of the data zoom slider (see https://echarts.apache.org/en/option.html#dataZoom-slider.maxValueSpan ). | |
dataZoomMinValueSpan ΒΆ | number | The lower limit of the data zoom slider (see https://echarts.apache.org/en/option.html#dataZoom-slider.minValueSpan ). | |
dataZoomRange ΒΆ | DataZoomRange | Apply a specific zoom range (see https://echarts.apache.org/en/option.html#dataZoom-inside ). | |
eChartContainerHeight ΒΆ | (null | string ) | The height of the ECharts container as decimal. | |
externalXAxisFormatter ΒΆ | (value: any , visibleRange: number ) => string | External XAxis Formatter from consumer | |
externalZoomSlider ΒΆ | boolean | false | Flag to use external zoom slider |
maxEntries ΒΆ | number | 1000 | Maximum number of series data points shown in the chart. |
options ΒΆ | EChartOption | See [ECharts 5.x Documentation] https://echarts.apache.org/en/option.html for all available options. | |
palette ΒΆ | string | undefined | The name of the color palette (if any) of the loaded theme . |
renderer ΒΆ | ("canvas" | "svg" ) | 'canvas' | the renderer to use: canvas or svg |
selectedItem ΒΆ | SelectedLegendItem | { legendItemName: '' } | Specify selected legend item. |
series ΒΆ | CartesianChartSeries [] | The series for the chart. | |
showCustomLegend ΒΆ | boolean | false | Enable to show a custom legend. The custom legend offers additional features such as, scroll bar to avoid legend and chart overlapping, Left and right alignment of legends based on y-axis, etc and many more. |
showLegend ΒΆ | boolean | true | Show Echarts legend |
stacked ΒΆ | boolean | false | Used to display the chart as a stacked one. |
subChartGrids ΒΆ | SubchartGrid [] | ||
subTitle ΒΆ | string | The subtitle of the chart. | |
theme ΒΆ | any | The desired theme to load. | |
themeCustomization ΒΆ | any | Used to override specific options of loaded theme . | |
title ΒΆ | string | The title of the chart. | |
tooltipFormatter ΒΆ | (string | TooltipFormatterCallback <TopLevelFormatterParams >) | The content formatter of tooltip's floating layer which supports string template and callback function (see (see https://echarts.apache.org/en/option.html#tooltip.formatter ). | |
visibleEntries ΒΆ | number | -1 | No auto dataZoom update) by default. Use together with autoZoomSeriesIndex . |
visibleRange ΒΆ | number | -1 | No auto dataZoom update) by default. Use together with autoZoomSeriesIndex . |
xAxis ΒΆ | (ChartXAxis | ChartXAxis []) | The x axis in cartesian(rectangular) coordinate. | |
yAxis ΒΆ | (ChartYAxis | ChartYAxis []) | The y axis in cartesian(rectangular) coordinate. | |
zoomInside ΒΆ | boolean | false | Enables zooming inside the chart with the mouse wheel/touch. Whether zooming inside the chart is possible with mouse. |
zoomMode ΒΆ | boolean | Enable or disable brush zoom mode | |
zoomSlider ΒΆ | boolean | false | Enables the zoom slider below the chart. |
zoomSliderBrush ΒΆ | boolean | true | enable brush mode for zoom slider |
zoomSliderRealtime ΒΆ | boolean | true | realtime update mode for zoom slider |
zoomSliderShadow ΒΆ | boolean | true | Shows data shadow in dataZoom slider, use together with zoomSlider . |
showTimeRangeBar | boolean | false | If true, add consumer-provided time range bar. Use together with zoomSlider .Deprecated: The input will be removed in future versions as the time range bar slot is deprecated. |
Output PropertiesΒΆ
Name | Type | Description |
---|---|---|
chartGridResized ΒΆ | GridRectCoordinate | Event emitted when chart grid is resized. |
chartSeriesClick ΒΆ | LegendItem | Event emitted when a chart series is clicked. |
customLegendMultiLineInfoEvent ΒΆ | CustomLegendMultiLineInfo [] | Event emitted when custom legend multi-line info changes. |
dataZoom ΒΆ | DataZoomEvent | Event emitted when data zoom changes. |
pointer ΒΆ | AxisPointerEvent | Event emitted when axis pointer moves. |
selectionChanged ΒΆ | any | Event emitted when selection changes e.g. clicking on a legend item. |
showLegendChange ΒΆ | boolean | Show Echarts legend |
timeRangeChange ΒΆ | number | Emitted when data zoom changes, indicating the time range in milliseconds, 0 for full range |
visibleEntriesChange ΒΆ | number | No auto dataZoom update) by default. Use together with autoZoomSeriesIndex . |
visibleRangeChange ΒΆ | number | No auto dataZoom update) by default. Use together with autoZoomSeriesIndex . |
Attributes and MethodsΒΆ
Name | Type | Default | Description |
---|---|---|---|
startProgressIndication() ΒΆ | () => void | Show loading indicator. | |
stopProgressIndication() ΒΆ | () => void | Hide loading indicator. |
Types DocumentationΒΆ
| |||||
|
|
|
|
import imported from echarts |
---|
import imported from echarts |
---|
| ||||||||||||||
|
| |||||||||||||||
|
|
|
|
|
|
|
|
|
import imported from echarts |
---|
import imported from echarts |
---|
import imported from echarts |
---|
import imported from echarts |
---|
import imported from echarts |
---|
import imported from echarts |
---|
import imported from echarts |
---|
import imported from echarts |
---|
import imported from echarts |
---|
import imported from echarts |
---|
imported from echarts |
---|
import imported from echarts |
---|
import imported from echarts |
---|
import imported from echarts |
---|
import imported from echarts |
---|
import imported from echarts |
---|
import imported from echarts |
---|
imported from echarts |
---|
imported from echarts |
---|
import imported from echarts |
---|
import imported from echarts |
---|
import imported from echarts |
---|
import imported from echarts |
---|
import imported from echarts |
---|
import imported from echarts |
---|
import imported from echarts |
---|
import imported from echarts |
---|
import imported from echarts |
---|
imported from echarts |
---|
import imported from echarts |
---|
import imported from echarts |
---|
|
|
|
import imported from echarts |
---|
import imported from echarts |
---|
import imported from echarts |
---|
import imported from echarts |
---|
import imported from echarts |
---|
import imported from echarts |
---|
import imported from echarts |
---|
import imported from echarts |
---|
import imported from echarts |
---|
import imported from echarts |
---|
imported from echarts |
---|
import imported from echarts |
---|
import imported from echarts |
---|
import imported from echarts |
---|
import imported from echarts |
---|
import imported from echarts |
---|
import imported from echarts |
---|
import imported from echarts |
---|
import imported from echarts |
---|
import imported from echarts |
---|
import imported from echarts |
---|
import imported from echarts |
---|
import imported from echarts |
---|
import imported from echarts |
---|
import imported from echarts |
---|
import imported from echarts |
---|
import imported from echarts |
---|
import imported from echarts |
---|
import imported from echarts |
---|
import imported from echarts |
---|
import imported from echarts |
---|
import imported from echarts |
---|
import imported from echarts |
---|
import imported from echarts |
---|
import imported from echarts |
---|
import imported from echarts |
---|
import imported from echarts |
---|
import imported from echarts |
---|
Except where otherwise noted, content on this site is licensed under MIT License.