The Web Components IgcDataChartComponent allows for placement of horizontal or vertical lines at a single numeric value that you define through usage of the IgcValueOverlayComponent. This can help you to visualize data such as the mean or median of a particular series.
Web Components Value Overlay Example
The following example depicts a Column Chart with a few horizontal value overlays plotted.
<!DOCTYPE html><html><head><title>DataChartSeriesValueOverlay</title><metacharset="UTF-8" /><linkrel="shortcut icon"href="https://static.infragistics.com/xplatform/images/browsers/wc.png" ><linkrel="stylesheet"href="https://fonts.googleapis.com/icon?family=Material+Icons" /><linkrel="stylesheet"href="https://fonts.googleapis.com/css?family=Kanit&display=swap" /><linkrel="stylesheet"href="https://fonts.googleapis.com/css?family=Titillium Web" /><linkrel="stylesheet"href="https://static.infragistics.com/xplatform/css/samples/shared.v8.css"type="text/css" /></head><body><divid="root"><divclass="container sample"><divclass="container"style="height: 100%"><igc-data-chartid="chart"width="100%"height="100%"is-horizontal-zoom-enabled="true"is-vertical-zoom-enabled="true"><igc-category-x-axisname="xAxis"label="Label"></igc-category-x-axis><igc-numeric-y-axisname="yAxis"minimum-value="0"maximum-value="10"></igc-numeric-y-axis><igc-column-seriesname="series1"x-axis-name="xAxis"y-axis-name="yAxis"value-member-path="Value"></igc-column-series><igc-value-overlayname="overlay1"axis-name="yAxis"value="2.0"thickness="5"></igc-value-overlay><igc-value-overlayname="overlay2"axis-name="yAxis"value="3.6"thickness="5"></igc-value-overlay><igc-value-overlayname="overlay3"axis-name="yAxis"value="5.8"thickness="5"></igc-value-overlay><igc-value-overlayname="overlay4"axis-name="yAxis"value="1.0"thickness="5"></igc-value-overlay><igc-value-overlayname="overlay5"axis-name="yAxis"value="8.0"thickness="5"></igc-value-overlay><igc-value-overlayname="overlay6"axis-name="yAxis"value="7.0"thickness="5"></igc-value-overlay><igc-value-overlayname="overlay7"axis-name="yAxis"value="5.0"thickness="5"></igc-value-overlay></igc-data-chart></div></div></div><!-- This script is needed only for parcel and it will be excluded for webpack -->
<% if (false) { %><scriptsrc="src/index.ts"></script><% } %>
</body></html>html
/* shared styles are loaded from: *//* https://static.infragistics.com/xplatform/css/samples */css
Like this sample? Get access to our complete Ignite UI for Web Components toolkit and start building your own apps in minutes. Download it for free.
Web Components Value Overlay Properties
Unlike other series types that use a ItemsSource for data binding, the value overlay uses a ValueMemberPath property to bind a single numeric value. In addition, the value overlay requires you to define a single axis to use. If you use an X-axis, the value overlay will be a vertical line, and if you use a Y-axis, it will be a horizontal line.
When using a numeric X or Y axis, the ValueMemberPath property should reflect the actual numeric value on the axis where you want the value overlay to be drawn. When using a category X or Y axis, the ValueMemberPath should reflect the index of the category at which you want the value overlay to appear.
When using the value overlay with a numeric angle axis, it will appear as a line from the center of the chart and when using a numeric radius axis, it will appear as a circle.
It is also possible to show an axis annotation on a IgcValueOverlayComponent to show the value of the overlay on the owning axis. In order to show this, you can set the isAxisAnnotationEnabled property to true.
Web Components Value Layer
The Web Components charting components also expose the ability to use value lines to call out different focal points of your data, such as minimum, maximum, and average values.
Average: Applies potentially multiple value lines to call out the average value of each series plotted in the chart.
GlobalAverage: Applies a single value line to call out the average of all of the series values in the chart.
GlobalMaximum: Applies a single value line to call out the absolute maximum value of all of the series values in the chart.
GlobalMinimum: Applies a single value line to call out the absolute minimum value of all of the series values in the chart.
Maximum: Applies potentially multiple value lines to call out the maximum value of each series plotted in the chart.
Minimum: Applies potentially multiple value lines to call out the minimum value of each series plotted in the chart.
If you want to prevent any particular series from being taken into account when using the IgcValueLayerComponent element, you can set the targetSeries property on the layer. This will force the layer to target the series that you define. You can have as many IgcValueLayerComponent elements within a single IgcDataChartComponent as you want.