LineChart
ConsoleMonster.Widgets
A line or scatter chart. With colour, the canvas uses braille (2x4 dots per cell) on Full, half blocks on Basic and characters on Ascii. Without colour, ASCII marks identify each series in the plot and legend. A y axis with min/max labels sits on the left, a legend below when there are several series or a semantic status to identify. Live operation: add (Key = series, Value).
Inheritance
- LiveWidget
- LineChart
Usage
Explore 31 API references to this type
This type appears in these public API surfaces even when no hand-authored example is attached directly to the page.
Returned or exposed by 14
- Method Ui.LineChart
- Extension method LineChart.Capacity
- Extension method LineChart.Height
- Extension method LineChart.Maximum
- Extension method LineChart.Minimum
- Extension method LineChart.Scatter
- Extension method LineChart.Unit
- Method LineChart.Add
- Method LineChartFluent.Capacity
- Method LineChartFluent.Height
- Method LineChartFluent.Maximum
- Method LineChartFluent.Minimum
- Method LineChartFluent.Scatter
- Method LineChartFluent.Unit
Accepted by parameters 17
- Method ChartPlot.op_Implicit
- Method ContentBuilder.LineChart
- Method ContentBuilder.LineChart
- Extension method LineChart.Capacity
- Extension method LineChart.Height
- Extension method LineChart.Maximum
- Extension method LineChart.Minimum
- Extension method LineChart.Scatter
- Extension method LineChart.Series
- Extension method LineChart.Unit
- Method LineChartFluent.Capacity
- Method LineChartFluent.Height
- Method LineChartFluent.Maximum
- Method LineChartFluent.Minimum
- Method LineChartFluent.Scatter
- Method LineChartFluent.Series
- Method LineChartFluent.Unit
Constructors
public LineChart(string widgetId = "chart") #Creates a chart.
Parameters
- widgetId string = "chart"
- The live name (default chart).
Methods
public LineChart Add(string series, double value) #Appends a value to a series (created when missing).
Parameters
- series string
- The series name.
- value double
- The value.
public override void Apply(LiveEvent liveEvent) #Applies an event to the widget's state.
Parameters
- liveEvent ConsoleMonster.Live.LiveEvent
- The event.
public SparklineHandle Handle(ILiveDispatcher dispatcher) #Returns a handle that appends values through a dispatcher.
Parameters
- dispatcher ConsoleMonster.Live.ILiveDispatcher
- The dispatcher.
public override Size Measure(Constraints constraints, RenderContext context) #Returns the size the widget wants within the constraints.
Parameters
- constraints ConsoleMonster.Layout.Constraints
- The space offered.
- context ConsoleMonster.Canvas.RenderContext
- Profile, theme and glyphs.
public override void Render(Region region, RenderContext context) #Renders into a region. The region may be smaller or larger than the measured size.
Parameters
- region ConsoleMonster.Canvas.Region
- The target region.
- context ConsoleMonster.Canvas.RenderContext
- Profile, theme and glyphs.
Inherited Methods
public virtual string? Describe(LiveEvent liveEvent) #Parameters
- liveEvent LiveEvent
Returns
string?Properties
Inherited Properties
Extension Methods
public static LineChart Capacity(LineChart lineChart, int value) #Sets LineChart.Capacity: How many values each series keeps (default 512).
Parameters
- lineChart ConsoleMonster.Widgets.LineChart
- The instance.
- value int
- The value.
Examples
// C# initializer or property // C# fluent
new global::ConsoleMonster.Widgets.LineChart { Capacity = value }; Ui.LineChart().Capacity(value);public static LineChart Height(LineChart lineChart, int value) #Sets LineChart.Height: Rows for the plot including the x axis (default 8).
Parameters
- lineChart ConsoleMonster.Widgets.LineChart
- The instance.
- value int
- The value.
Examples
// C# initializer or property // C# fluent
new global::ConsoleMonster.Widgets.LineChart { Height = value }; Ui.LineChart().Height(value);public static LineChart Maximum(LineChart lineChart, double? value) #Sets LineChart.Maximum: A fixed maximum for the y axis, or null.
Parameters
- lineChart ConsoleMonster.Widgets.LineChart
- The instance.
- value double?
- The value.
Examples
// C# initializer or property // C# fluent
new global::ConsoleMonster.Widgets.LineChart { Maximum = value }; Ui.LineChart().Maximum(value);public static LineChart Minimum(LineChart lineChart, double? value) #Sets LineChart.Minimum: A fixed minimum for the y axis, or null (0 when all values are positive).
Parameters
- lineChart ConsoleMonster.Widgets.LineChart
- The instance.
- value double?
- The value.
Examples
// C# initializer or property // C# fluent
new global::ConsoleMonster.Widgets.LineChart { Minimum = value }; Ui.LineChart().Minimum(value);public static LineChart Scatter(LineChart lineChart, bool value = true) #Sets LineChart.Scatter: Whether points are joined by lines (default) or drawn as a scatter.
Parameters
- lineChart ConsoleMonster.Widgets.LineChart
- The instance.
- value bool = true
- The value; true when omitted.
Examples
// C# initializer or property // C# fluent
new global::ConsoleMonster.Widgets.LineChart { Scatter = value }; Ui.LineChart().Scatter(value);public static ChartSeries Series(LineChart chart, RichText key, ThemeToken? role = null) #Adds a series with a multicolour legend name (its plain text is the key), or returns the existing one.
Parameters
- chart ConsoleMonster.Widgets.LineChart
- The chart.
- key ConsoleMonster.Text.RichText
- The rich name.
- role ConsoleMonster.Styling.ThemeToken? = null
- The colour role, or null for the next series colour.
public static ChartSeries Series(LineChart chart, string key, ThemeToken? role = null) #Adds a series, or returns the existing one with that name.
Parameters
- chart ConsoleMonster.Widgets.LineChart
- The chart.
- key string
- The name.
- role ConsoleMonster.Styling.ThemeToken? = null
- The colour role, or null for the next series colour.
public static LineChart Unit(LineChart lineChart, string? value) #Sets LineChart.Unit: A unit appended to axis labels.
Parameters
- lineChart ConsoleMonster.Widgets.LineChart
- The instance.
- value string?
- The value.
Examples
// C# initializer or property // C# fluent
new global::ConsoleMonster.Widgets.LineChart { Unit = value }; Ui.LineChart().Unit(value);