Blazor Axis Layouts
All Ignite UI for Blazor charts include options to configure many axis layout options such as location as well as having the ability to share axis between series or have multiple axes in the same chart. These features are demonstrated in the examples given below.
[!Note] the following examples can be applied to
IgbCategoryChart
as well asIgbFinancialChart
controls.
Axis Locations Example
For all axes, you can specify axis location in relationship to chart plot area. The XAxisLabelLocation
property of the Blazor charts, allows you to position x-axis line and its labels on above or below plot area. Similarly, you can use the YAxisLabelLocation
property to position y-axis on left side or right side of plot area.
The following example depicts the amount of renewable electricity produced since 2009, represented by a Line Chart. There is a drop-down that lets you configure the YAxisLabelLocation
so that you can visualize what the axes look like when the labels are placed on the left or right side on the inside or outside of the chart's plot area.
Axis Advanced Scenarios
For more advanced axis layout scenarios, you can use Blazor Data Chart to share axis, add multiple y-axis and/or x-axis in the same plot area, or even cross axes at specific values. The following examples show how to use these features of the IgbDataChart
.
Axis Sharing Example
You can share and add multiple axes in the same plot area of the Blazor IgbDataChart
. It a common scenario to use share IgbTimeXAxis
and add multiple IgbNumericYAxis
to plot many data sources that have wide range of values (e.g. stock prices and stock trade volumes).
The following example depicts a stock price and trade volume chart with a Stock Chart and a Column Chart plotted. In this case, the Y-Axis on the left is used by the Column Chart and the Y-Axis on the right is used by the Stock Chart, while the X-Axis is shared between the two.
Axis Crossing Example
In addition to placing axes outside plot area, the Blazor IgbDataChart
also provides options to position axes inside of plot area and make them cross at specific values. For example, you can create trigonometric chart by setting CrossingAxis
and CrossingValue
properties on both x-axis and y-axis to render axis lines and axis labels such that they are crossing at (0, 0) origin point.
The following example shows a Sin and Cos wave represented by a Scatter Spline Chart with the X and Y axes crossing each other at the (0, 0) origin point.
Axis Timeline Example
The following example demonstrates how to style the data chart using the IgbTimeXAxis
as a timeline:
Additional Resources
You can find more information about related chart features in these topics:
API References
The following is a list of API members mentioned in the above sections: d in the above sections:
IgbDataChart |
IgbCategoryChart |
---|---|
Axes ➔ IgbNumericYAxis ➔ CrossingAxis |
None |
Axes ➔ IgbNumericYAxis ➔ CrossingValue |
None |
Axes ➔ IgbNumericXAxis ➔ IsInverted |
XAxisInverted |
Axes ➔ IgbNumericYAxis ➔ IsInverted |
YAxisInverted |
Axes ➔ IgbNumericYAxis ➔ LabelLocation |
YAxisLabelLocation |
Axes ➔ IgbNumericXAxis ➔ LabelLocation |
XAxisLabelLocation |
Axes ➔ IgbNumericYAxis ➔ LabelHorizontalAlignment |
YAxisLabelHorizontalAlignment |
Axes ➔ IgbNumericXAxis ➔ LabelVerticalAlignment |
XAxisLabelVerticalAlignment |
Axes ➔ IgbNumericYAxis ➔ LabelVisibility |
YAxisLabelVisibility |
Axes ➔ IgbNumericXAxis ➔ LabelVisibility |
XAxisLabelVisibility |