Axes
Since 0.1.0-alpha.22
The members for axes, and the types they use. Every member of
IzzyBlazor.Chart<TItem> is on the Chart API.
Parts (2)
Components written inside Chart, and the columns' members, which PropertyColumn, TemplateColumn and DynamicColumn share.
ChartValueAxis
A chart's value axis: its range, ticks, format, title and side. A second ChartValueAxis with a Name is drawn at the other side, for series in other units that name it as their ValueAxis: <ChartValueAxis Name="margin" Format="P0" Title="Margin" />.
Namestring?Formatstring?A .NET format string for the values, such as C0, N1 or P0: on the axis, in tooltips and in the data table.
FormatterFunc<double, string>?Writes each value's text yourself, such as v => $"${v / 1e6:0.#}M", in place of Format: on the axis, in tooltips and in the data table. (A percent stack's axis still reads in percent.) Hiding a series from the legend then keeps the axis as it is rather than rescaling it, since its text comes from the server. First axis only.
Mindouble? (computed)Where the axis starts. Defaults to a round number at or below the lowest value (0 with bars and areas); on a second axis, one its ticks line up with the first axis's grid at.
Maxdouble? (computed)Where the axis ends. Defaults to a round number at or above the highest value.
Stepdouble? (computed)The gap between ticks, such as 25_000. The axis's ends round to it unless Min and Max are set. Defaults to a round step for the chart's size; ticks that would crowd still thin out. A step that would make more than 500 ticks is ignored. First axis only: a second axis's ticks fall on the first's grid lines.
Logarithmicbool = falseDraws the axis on a log scale (base 10), for values that span several powers of ten, such as company sizes. Values at or under zero have no place on it and aren't drawn; bars and areas start at the axis's bottom. First axis only.
GridLinesbool = trueDraws a grid line across the plot at each tick. On by default for the first value axis; a second axis's ticks fall on the first's lines, so it has none of its own.
PositionChartAxisPosition = ChartAxisPosition.AutoThe side the axis is drawn at: ChartAxisPosition.Left (the default) or ChartAxisPosition.Right on an upright chart, ChartAxisPosition.Bottom (the default) or ChartAxisPosition.Top on a horizontal one. Sides are physical: a right-to-left page doesn't move the axis. A second axis takes the other side. First axis only.
LabelWidthLength?The least room for the axis's labels beside the plot, such as LabelWidth="Length.Rem(4)", on an upright chart. Give charts stacked over each other the same, such as synced ones (Sync), so their plots line up whatever their values' widths. Wider labels still fit.
Titlestring?A title beside the axis, such as "Revenue (USD)" or "Month".
HideLabelsbool = falseLeaves out the axis's labels, for a small chart or one whose values are labeled on the marks. The scale stays. Not on a second value axis.
ChartArgumentAxis
A chart's argument axis, where each item is plotted: its format, title, grid lines and how crowded names fit: <ChartArgumentAxis Title="Month" LabelFit="ChartLabelFit.Rotate" />.
Formatstring?A .NET format string for the arguments, such as MMM or N0.
FormatterFunc<object?, string>?Writes each argument's text yourself, in place of Format. It gets the item's argument, or a tick on a number or date scale: a double, or a date of the argument's own type. Dates then have no second line for the month or year.
LabelFitChartLabelFit = ChartLabelFit.SkipHow names along the bottom fit when they crowd: skipped (the default), turned 45° first, or all shown, wrapped. Applies to names in bands on an upright chart; ticks on a number or date scale are always chosen to fit.
GridLinesbool = falseDraws grid lines between the arguments (at each tick on a number or date scale). Off by default.
Logarithmicbool = falseDraws the arguments on a log scale (base 10), for numbers that span several powers of ten, such as income per person, where each step of ten counts alike. Arguments at or under zero have no place on it and aren't drawn. Numbers only: a chart of names or dates throws.
Reversebool = falseRuns the arguments backward: the first at the right, or at the bottom on a horizontal chart. For an app whose readers take time right to left. A right-to-left page alone doesn't reverse a chart.
SkipGapsbool = falseSpaces dates by item, not by time: each item takes the same room and a date with no item (a weekend, a holiday, a closed night) takes none, as on a stock chart. The labels still mark where a day, month or year begins. The items need to be in date order. A chart with bars or candles already spaces its dates by item.
Zoombool = falseLets the reader zoom into part of the arguments and pan along them: a drag across the plot, Ctrl (⌘ on a Mac) and the wheel, a pinch, + and − on the focused chart, or the Zoom in and Zoom out buttons by the title. The page still scrolls under the plain wheel and one finger. A ChartRangeSelector in the chart turns it on by itself. The chart's View and ViewChanged say what's in view.
MinZoomSpanint = 2The fewest items a zoom can come down to. 2 by default.
Titlestring?A title beside the axis, such as "Revenue (USD)" or "Month".
HideLabelsbool = falseLeaves out the axis's labels, for a small chart or one whose values are labeled on the marks. The scale stays. Not on a second value axis.
Types (3)
ChartAxisPosition
enumThe side of the plot a value axis is drawn at.
| Value | Description |
|---|---|
Auto | At the left on an upright chart, along the bottom on a horizontal one. |
Left | At the left of an upright chart. |
Right | At the right of an upright chart, as in a chart that reads right to left, with the values beside its first argument. |
Bottom | Along the bottom of a horizontal chart. |
Top | Along the top of a horizontal chart, so the values read before a long list of bars. |
ChartLabelFit
enumHow a ChartArgumentAxis fits the names along the bottom when they don't all fit side by side.
| Value | Description |
|---|---|
Skip | Names that don't fit are skipped: every other one, then every fourth, and so on. |
Rotate | Names are turned 45° before any are skipped, so more of them show. |
Wrap | Every name shows, wrapped onto more lines in its band. Suits a few long names. |
Length
structA width, height or flex basis: a size token, a keyword, or a CSS length built with a factory such as Rem.
| Member | Description |
|---|---|
Sm | 640px (matches the |
Md | 768px (matches the |
Lg | 1024px (matches the |
Xl | 1280px (matches the |
Prose | A comfortable reading width, 68 characters. |
Full | 100% of the containing block. |
Auto |
|
FitContent |
|
MinContent |
|
MaxContent |
|
Px(double value) | Pixels. |
Rem(double value) | Root ems (16px each by default). |
Percent(double value) | Percent of the containing block. |
Ch(double value) | Character widths, for text measures. |
Vw(double value) | Percent of the viewport width. |
Dvh(double value) | Percent of the dynamic viewport height (accounts for mobile browser bars). |
Of(string css) | Any CSS length, such as |
Css string | The CSS value this length renders as. |