Skip to content
commit-766c8d6756a1

Interactive line

Ordered numeric series with categorical, numerical, and temporal axes; labels, symbols, references, fills, and multiple aligned series.

Purpose
Show change across an ordered sequence.
Use when
Order and direction matter, especially for a small number of time series.
Avoid when
Unordered categories or many crossing series obscure comparison.
Equivalent data
Provide the ordered values in an adjacent table when exact readings matter.
Exact category and values
CategorySeriesValue
AppleCategory A120
BananaCategory A132
PeachCategory A101
LemonCategory A134
PearCategory A90
CherryCategory A230

6 ordered x values across 1 series.

Usage Example
@interactiveline.Line(interactiveline.Config{
  Label: "Basic line example",
  XAxis: []string{"Apple", "Banana", "Peach", "Lemon", "Pear", "Cherry"},
  Series: []interactiveline.Series{{
    Name: "Category A",
    Data: []interactiveline.Data{{Value: 120}, {Value: 132}, {Value: 101}, {Value: 134}, {Value: 90}, {Value: 230}},
  }},
})

Labels and symbols

Labels expose exact point values; symbols distinguish points without changing the data.

Exact category and values
CategorySeriesValue
AppleCategory A150
BananaCategory A232
PeachCategory A201
LemonCategory A154
PearCategory A190
CherryCategory A130

6 ordered x values across 1 series.

Exact category and values
CategorySeriesValue
AppleCategory A120
AppleCategory B220
BananaCategory A182
BananaCategory B282
PeachCategory A191
PeachCategory B291
LemonCategory A234
LemonCategory B334
PearCategory A290
PearCategory B390
CherryCategory A330
CherryCategory B430

6 ordered x values across 2 series.

Labels and symbols
@interactiveline.Line(interactiveline.Config{
  Label: "Visible point labels",
  XAxis: []string{"Apple", "Banana", "Peach"},
  Series: []interactiveline.Series{{
    Name: "Category A",
    Data: []interactiveline.Data{{Value: 150}, {Value: 232}, {Value: 201}},
  }},
  SeriesOptions: chart.SeriesOptions{
    Label: &chart.LabelOptions{Show: chart.Bool(true)},
    ShowSymbol: chart.Bool(true), Symbol: "diamond", SymbolSize: 15,
  },
})

References and split lines

Calculated points and horizontal guides add context while the adjacent tables retain exact values.

Exact category and values
CategorySeriesValue
AppleCategory A120
BananaCategory A132
PeachCategory A101
LemonCategory A134
PearCategory A90
CherryCategory A230

6 ordered x values across 1 series.

Exact category and values
CategorySeriesValue
AppleCategory A120
BananaCategory A132
PeachCategory A101
LemonCategory A134
PearCategory A90
CherryCategory A230

6 ordered x values across 1 series.

References and split lines
References: interactiveline.References{
  Points: []interactiveline.PointReference{
    {Name: "Maximum", Statistic: interactiveline.StatisticMaximum},
    {Name: "Average", Statistic: interactiveline.StatisticAverage},
    {Name: "Minimum", Statistic: interactiveline.StatisticMinimum},
  },
  ShowLabels: chart.Bool(true),
}

Numerical axis and guides

A numerical x axis supports ranges, coordinate guides, vertical thresholds, and theme-aware scale pieces.

Exact x and values
XSeriesValue
0Category A118
1Category A117
2Category A116
3Category A111
4Category A114
5Category A109
6Category A100
7Category A119
8Category A106
9Category A101
10Category A116
11Category A115
12Category A118
13Category A105
14Category A116
15Category A111
16Category A118
17Category A101
18Category A108
19Category A119
20Category A114
21Category A113
22Category A112
23Category A115
24Category A106
25Category A109
26Category A100
27Category A115
28Category A118
29Category A101

30 ordered x values across 1 series.

Numerical axis and guides
@interactiveline.Line(interactiveline.Config{
  Label: "Numerical x axis with guides",
  ValueAxis: &interactiveline.ValueAxis{Values: []float64{0, 1, 2}},
  Series: []interactiveline.Series{{
    Name: "Category A",
    Data: []interactiveline.Data{{Value: 107}, {Value: 112}, {Value: 118}},
    References: interactiveline.References{
      Areas: []interactiveline.RangeReference{{Name: "Danger zone", StartX: 1, EndX: 2}},
    },
  }},
  VisualScale: &interactiveline.VisualScale{
    Dimension: interactiveline.VisualDimensionX,
    Pieces: []interactiveline.VisualPiece{{GreaterThan: chart.Float(0), LessThan: chart.Float(2)}},
  },
})

Line shape treatments

Step, smooth, area, and smooth-area treatments share one component and typed series options.

Exact category and values
CategorySeriesValue
AppleCategory A120
BananaCategory A132
PeachCategory A101
LemonCategory A134
PearCategory A90
CherryCategory A230

6 ordered x values across 1 series.

Exact category and values
CategorySeriesValue
AppleCategory A120
BananaCategory A132
PeachCategory A101
LemonCategory A134
PearCategory A90
CherryCategory A230

6 ordered x values across 1 series.

Exact category and values
CategorySeriesValue
AppleCategory A120
BananaCategory A132
PeachCategory A101
LemonCategory A134
PearCategory A90
CherryCategory A230

6 ordered x values across 1 series.

Exact category and values
CategorySeriesValue
AppleCategory A120
BananaCategory A132
PeachCategory A101
LemonCategory A134
PearCategory A90
CherryCategory A230

6 ordered x values across 1 series.

Line shape treatments
SeriesOptions: chart.SeriesOptions{
  Step: "end",
  Smooth: chart.Bool(true),
  AreaStyle: &chart.AreaStyle{Opacity: chart.Float(0.2)},
}

Multi-series comparisons

Aligned series share one ordered x axis; labels and average references can be configured per series.

Exact category and values
CategorySeriesValue
AppleCategory A120
AppleCategory B220
AppleCategory C150
AppleCategory D320
BananaCategory A132
BananaCategory B182
BananaCategory C232
BananaCategory D332
PeachCategory A101
PeachCategory B191
PeachCategory C201
PeachCategory D301
LemonCategory A134
LemonCategory B234
LemonCategory C154
LemonCategory D334
PearCategory A90
PearCategory B290
PearCategory C190
PearCategory D390
CherryCategory A230
CherryCategory B330
CherryCategory C130
CherryCategory D430

6 ordered x values across 4 series.

Exact category and values
CategorySeriesValue
10e1map19
10e1slice24.9
10e2map31
10e2slice34.9
10e3map43
10e3slice48.1
10e4map57
10e4slice58.3
10e5map72
10e5slice69.7
10e6map118
10e6slice123
10e7map127
10e7slice131

7 ordered x values across 2 series.

Multi-series comparisons
Series: []interactiveline.Series{
  {Name: "Category A", Data: categoryA},
  {Name: "Category B", Data: categoryB},
  {Name: "Category C", Data: categoryC},
  {Name: "Category D", Data: categoryD},
}

Temporal X-axis treatment

UTC timestamps keep one chronological series in order, with exact values beside the chart.

Exact time and values

UTC timestamps. Time domain starts at 2025-01-01T00:00:00Z. Evidence runs from 2025-01-31T00:00:00Z to 2025-03-21T00:00:00Z.

TimeSeriesValue
2025-01-31T00:00:00ZCategory A118
2025-02-01T00:00:00ZCategory A117
2025-02-02T00:00:00ZCategory A116
2025-02-03T00:00:00ZCategory A111
2025-02-04T00:00:00ZCategory A114
2025-02-05T00:00:00ZCategory A109
2025-02-06T00:00:00ZCategory A100
2025-02-07T00:00:00ZCategory A119
2025-02-08T00:00:00ZCategory A106
2025-02-09T00:00:00ZCategory A101
2025-02-10T00:00:00ZCategory A116
2025-02-11T00:00:00ZCategory A115
2025-02-12T00:00:00ZCategory A118
2025-02-13T00:00:00ZCategory A105
2025-02-14T00:00:00ZCategory A116
2025-02-15T00:00:00ZCategory A111
2025-02-16T00:00:00ZCategory A118
2025-02-17T00:00:00ZCategory A101
2025-02-18T00:00:00ZCategory A108
2025-02-19T00:00:00ZCategory A119
2025-02-20T00:00:00ZCategory A114
2025-02-21T00:00:00ZCategory A113
2025-02-22T00:00:00ZCategory A112
2025-02-23T00:00:00ZCategory A115
2025-02-24T00:00:00ZCategory A106
2025-02-25T00:00:00ZCategory A109
2025-02-26T00:00:00ZCategory A100
2025-02-27T00:00:00ZCategory A115
2025-02-28T00:00:00ZCategory A118
2025-03-01T00:00:00ZCategory A101
2025-03-02T00:00:00ZCategory A104
2025-03-03T00:00:00ZCategory A111
2025-03-04T00:00:00ZCategory A106
2025-03-05T00:00:00ZCategory A105
2025-03-06T00:00:00ZCategory A116
2025-03-07T00:00:00ZCategory A115
2025-03-08T00:00:00ZCategory A102
2025-03-09T00:00:00ZCategory A117
2025-03-10T00:00:00ZCategory A104
2025-03-11T00:00:00ZCategory A103
2025-03-12T00:00:00ZCategory A106
2025-03-13T00:00:00ZCategory A101
2025-03-14T00:00:00ZCategory A108
2025-03-15T00:00:00ZCategory A107
2025-03-16T00:00:00ZCategory A106
2025-03-17T00:00:00ZCategory A105
2025-03-18T00:00:00ZCategory A116
2025-03-19T00:00:00ZCategory A111
2025-03-20T00:00:00ZCategory A106
2025-03-21T00:00:00ZCategory A101

50 ordered x values across 1 series.

Temporal X-axis treatment
@interactiveline.Line(interactiveline.Config{
  Label: "Temporal X axis",
	  TimeAxis: &interactiveline.TimeAxis{
	    Minimum: time.Date(2025, time.January, 1, 0, 0, 0, 0, time.UTC),
    Values: []time.Time{time.Date(2025, time.February, 0, 0, 0, 0, 0, time.UTC)},
  },
  Series: []interactiveline.Series{{Name: "Category A", Data: []interactiveline.Data{{Value: 107}}}},
})

Time series

Use a time axis for chronological observations; keep timestamps strictly ordered and show exact readings beside the chart when people need to compare them.

Mixed-series composition

The upstream mixed line and scatter overlay needs a separate renderer-neutral composite chart API. Line does not accept backing-renderer series or raw option escape hatches.

Go API

v0.0.1

The examples above cover behavior and composition. pkg.go.dev is the canonical reference for exported types, functions, methods, and Go documentation.

github.com/araihu/goshtoso-charts/components/interactive/line

Enabled, disabled, hidden, and omitted wrapper behavior, controls, export, and client transitions are shared by every chart. Review chart controls, then compare static/vector and interactive capabilities.

Open v0.0.1 API