LightningChart JS 网页图表代码示例--Line series 线性图

下面的代码给出了一个基本线性图的使用。线性图在笛卡尔坐标上绘制,表现两个变量之间的关系。直线段连接成数据点,线性图将信息作为这些数据点显示出来。一般用来显示数据变化或展示数据集的趋势。

This type of series does not contain the visual representation of 'markers' for the data points but only continuously connected line between all of them. Additionally, it allows drawing lines in any direction.

此类型的图不包含可视的数据点“标记”,仅包含所有数据点之间的连续连接线。 此外,它允许在任何方向绘制线条。

 

图表可以通过下列简单代码建立

// Create a new ChartXY.
const chart = lightningChart().ChartXY()

// Add a line series using default X and Y axes.
const series = chart.addLineSeries()

图表接受{ x: number, y: number }形式的点 。任何number可以被单独调用

// Single point.
series.add({ x: 50, y: 60 })

// Multiple points at once.
series.add([
    { x: 55, y: 60 },
    { x: 60, y: 62},
    { x: 65, y: 65}
])

更多信息请访问官网API

 

  • XY cartesian chart: ChartXY
  • Line series: LineSeries

你可能感兴趣的:(图表,Javascript,网页图表开发)