Package org.aesh.charts.linechart
Class LineChart
java.lang.Object
org.aesh.charts.linechart.LineChart
- Direct Known Subclasses:
TimeSeriesChart
A line chart that plots one or more data series on a 2D grid.
Supports multiple rendering modes (ASCII, Unicode, Braille), multiple series with colors and line styles, and viewport scrolling for data that exceeds the terminal width.
Example:
LineChart chart = LineChart.builder()
.width(60).height(15)
.style(ChartStyle.BRAILLE)
.xLabel("Time").yLabel("CPU %")
.build();
chart.addSeries(cpuData);
System.out.println(chart.render());
-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionAdd a horizontal reference line (threshold, baseline, target).Add a marker to highlight a specific data point.addSeries(DataSeries series) static LineChart.Builderbuilder()protected voidplotSeries(Canvas canvas, DataSeries series, Axis xAxis, Axis yAxis, int plotLeft, int plotRight, int plotTop, int plotBottom) Plot a single data series onto the canvas.render()Render the chart to a multi-line string.voidscrollLeft(int amount) voidscrollRight(int amount) voidvoidvoidsetViewportSize(int size)
-
Constructor Details
-
LineChart
-
-
Method Details
-
builder
-
addSeries
-
seriesList
-
addMarker
Add a marker to highlight a specific data point. Used for change detection alerts, regression markers, etc. -
addHorizontalLine
Add a horizontal reference line (threshold, baseline, target). -
scrollLeft
public void scrollLeft(int amount) -
scrollRight
public void scrollRight(int amount) -
scrollToStart
public void scrollToStart() -
scrollToEnd
public void scrollToEnd() -
setViewportSize
public void setViewportSize(int size) -
render
Render the chart to a multi-line string. -
plotSeries
protected void plotSeries(Canvas canvas, DataSeries series, Axis xAxis, Axis yAxis, int plotLeft, int plotRight, int plotTop, int plotBottom) Plot a single data series onto the canvas.
-