leeoniya / uPlot

📈 A small, fast chart for time series, lines, areas, ohlc & bars
MIT License
8.51k stars 371 forks source link

two x-axes chart ? #854

Closed kimthumb closed 10 months ago

kimthumb commented 10 months ago

x1 = [1, 2, 3, 4, 5] y1 = [1, 2, 3, 4, 5]

x2 = [1.2, 2.5, 3.8, 7.9] y2 = [4.1, 3.4, 1.1, 3.5]

What if there are two x-axes?

This is not the case in the demo.

leeoniya commented 10 months ago

do you actually want two x axes, or you just need to plot datasets that are not x-aligned?

if you just need to plot non-aligned-x datasets, you should use uPlot.join() to align / combine them: https://leeoniya.github.io/uPlot/demos/align-data.html

if you actually want a second x axis, look at https://leeoniya.github.io/uPlot/demos/time-periods.html