highcharts(或 vaadin)是否具有使用像 Ramer-Douglas-Peucker 这样的算法的内置能力?

Does highcharts (or vaadin) have built-in abilities to use an algorithm like Ramer–Douglas–Peucker?

使用 Vaadin 的图表(最终使用 HighCharts),我试图绘制一个包含超过 10,000 个点的折线图。它实际上工作得相当快(几秒钟即可绘制)。但是,我想知道它是否可以更快,因为我在使用 JavaFx 图表时遇到了类似的问题,并发现人们已经使用 "Ramer–Douglas–Peucker algorithm" 实现了一个解决方案来减少此类中的数据点数量一种在绘制图形时人眼基本上可以注意到的方式。 (这是 SO 的原始答案:)。

那么,highcharts 是否已经具有这样的内置功能?如果不是,Vaadin 会吗?或者,我是否需要在 Vaadin 中重新创建此逻辑,这意味着我最终需要为 Ramer–Douglas–Peucker 算法找到一个 Java 库....

很遗憾,Highcharts 没有内置 "Ramer–Douglas–Peucker algorithm"。但是,它有一个 boost 模块,可以在几毫秒内渲染数千个点。

The Boost module allows certain series types to be rendered by WebGL instead of the default SVG. This allows hundreds of thousands of data points to be rendered in milliseconds. In addition to the WebGL rendering, it saves time by skipping the processing and inspection of the data wherever possible.

API参考:

演示:


此外,使用 Highstock 您可以使用 dataGrouping.

Data grouping is the concept of sampling the data values into larger blocks in order to ease readability and increase performance of the JavaScript charts.

API参考:

演示:

对于大多数图表类型,当您使用 Vaadin 图表时,应用算法来减少服务器端逻辑中的数据点数量实际上更有意义,例如,当将数据从原始数据源复制到您在图表。这不仅减少了渲染时间,还减少了将数据加载到浏览器的时间。

如果需要的话,我还建议在服务器端计算线性回归作为额外的两点 DataSeries。