我正在使用 HighCharts 来显示图表。目前,线条非常僵硬,在上下移动时会产生尖锐的点。有没有办法改变配置选项来创建更平滑的曲线,类似于下图?
我尝试将类型设置为样条曲线,但似乎没有任何效果
plotOptions: { 系列: { 类型: '样条' } }
最佳答案
the Highcharts forum 上的某些人找到了一个解决方法,例如通过添加此(稍微调整)行来获得平滑的线条:
Highcharts.seriesTypes.line.prototype.getPointSpline = Highcharts.seriesTypes.spline.prototype.getPointSpline;
参见this JSFiddle demonstration 。
getPointSpline
具有以下文档:
Get the spline segment from a given point's previous neighbour to the given point.
它被getGraphPath
函数用来绘制路径。
关于highcharts - 有没有办法让 HighCharts JS 中的曲线更平滑?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/77238058/