This document specifies the current behavior and design of the LineChart control as implemented.
For end-user usage and examples, see LineChart.
Minimum/Maximum) or auto scaling from data.Values : BindableList<double>Minimum : double?Maximum : double?LineChartStyle.PointGlyph (U+2022 BULLET).src/XenoAtom.Terminal.UI/Controls/LineChart.cssrc/XenoAtom.Terminal.UI/Styling/LineChartStyle.cssamples/ControlsDemo/Demos/LineChartDemo.cssrc/XenoAtom.Terminal.UI.Tests/VisualizationTests.cs (basic point rendering)LineChart is a render-only control (it does not have children).
Values.Count == 0, desired size is Size.Zero.width = min(constraints.MaxWidth, max(1, Values.Count))height = min(constraints.MaxHeight, max(1, 4))This means:
Minimum and/or Maximum are not set, the chart scans Values and computes min/max from finite values.NaN and Infinity values are ignored for min/max computation.max <= min, max is forced to min + 1 to avoid division by zero.For each output column x in the arranged width:
start = (x * count) / widthend = ((x + 1) * count) / width (at least start + 1)[start..end).
min.The sample is normalized:
t = clamp((sample - min) / (max - min), 0..1)Then mapped to a row:
y = rect.Y + round((1 - t) * (height - 1))The point is drawn with LineChartStyle.PointGlyph and LineChartStyle.ResolvePointStyle(theme).
The sampling uses max-per-bucket. This is a simple way to preserve peaks when downsampling, but it means the control is closer to a compact "trend/peak" plot than a mathematically interpolated line.
LineChartStyle provides:
PointGlyph (defaults to U+2022 BULLET)PointStyle (optional; otherwise uses theme foreground and theme.Accent when available)None.
LineChartDemo shows a basic series rendered at a fixed height.VisualizationTests.LineChart_Renders_Points asserts that the point glyph is present in output.