Charts
TwHexbinChart
TwHexbinChart is a Blazor hexbin chart that tiles the plot with hexagons shaded by how many points fall in each, for scatter data too dense to read.
Last updated
Please be aware this component is new, may have bugs and/or be subject to change. Please report any bugs at
https://github.com/twblazor/twblazor/issues.
Basic usage
TwHexbinChart takes the same ChartPointSeries as a scatter plot, tiles the plot with hexagons and shades each by how many points fall inside it. Use it when there are so many points that dots would pile into a blob.Bin size
BinWidth is the width of a hexagon as a percentage of the plot's width, from 4 to 25. Smaller hexagons show finer detail but need more points to fill; larger ones smooth out the noise.RAZOR
<div class="grid gap-8 md:grid-cols-2">
<TwChart Title="Fine" Description="BinWidth 6">
<TwHexbinChart Series="@_sessions" BinWidth="6" XTitle="Minutes" YTitle="Pages" Height="ChartHeight.Small" />
</TwChart>
<TwChart Title="Coarse" Description="BinWidth 16">
<TwHexbinChart Series="@_sessions" BinWidth="16" XTitle="Minutes" YTitle="Pages" Height="ChartHeight.Small" />
</TwChart>
</div>Several series
Every series is combined into one cloud before counting, so you can pass data in whatever groups you hold it in. Here two clusters of readings show as two dark patches.
When to use
Use a hexbin chart when a scatter plot has too many points to tell apart. Shading uses a single hue, so darker always means more points, and hexagons with no points are left out. For fewer points use TwScatterChart.
Summary
Tooltips and the table view give the average position and the count of the points in each hexagon.