【问题标题】:Highcharts - degraded tooltip rendering performanceHighcharts - 工具提示渲染性能下降
【发布时间】:2019-10-10 15:47:53
【问题描述】:

我在 Angular 8 应用程序中使用 Highcharts,虽然图表本身的渲染速度非常快,但在绑定到更大数据集的图表上,我遇到了一些严重降低的性能渲染工具提示。有趣的是,这个问题似乎与数据点的数量关系不大,而与绘图区域系列填充的数量有关。

我们正在使用 Boost(在 app.module.ts 中):

Boost(Highcharts);
NoData(Highcharts);
More(Highcharts);
NoData(Highcharts);
theme(Highcharts);

这是图表的配置(系列是动态添加的):

public baseChartOptions: Highcharts.Options = {
chart: {
  type: 'line',
  zoomType: 'x',
  animation: false,
  height: '55%'
},
boost: {
  enabled: true,
  useGPUTranslations: true,
  usePreallocated: true
},
legend: {
  enabled: true,
  align: 'center',
  verticalAlign: 'bottom',
  layout: 'horizontal'
},
exporting: { enabled: false },
plotOptions: {
  series: {
    lineWidth: 1.5,
    animation: false,
    marker: {
      enabled: false
    }
  }
},
xAxis: [
  {
    type: 'datetime',
    dateTimeLabelFormats: {
      day: '%m/%d'
    }
  } as Highcharts.XAxisOptions
],
yAxis: [
  {
    minorTickLength: 0,
    tickLength: 0,
    title: {
      text: ''
    }
  }
],
tooltip: {
  shared: true,
  pointFormat: '<span style="color:{point.color}">\u25CF</span> {series.name}: <b>{point.y:.0f}</b><br/>',
  animation: false
},
series: []

};

在呈现工具提示时确保最佳性能的最佳做法是什么?我已经看到 Highcharts 演示显示超过 1,000,000 点且性能良好,但我似乎无法达到同样的效果。

我包含了一个转换为 gif 的短视频,它说明了我在三种不同数据密度下看到的行为。

感谢您的帮助!

highcharts tooltip performance

【问题讨论】:

    标签: highcharts


    【解决方案1】:

    禁用共享工具提示后性能应该会更好:

      tooltip: {
        animation: false,
        valueDecimals: 2,
        shared: false
      }
    

    演示:

    【讨论】:

    • 我注意到禁用共享工具提示时性能略有提高,但不幸的是,在这种情况下共享工具提示是设计要求。谢谢,沃伊切赫。
    • 您能在在线代码编辑器中以某种方式重现此问题吗?
    猜你喜欢
    • 1970-01-01
    • 2022-07-14
    • 1970-01-01
    • 2014-02-19
    • 2021-07-05
    • 1970-01-01
    • 2023-03-28
    • 1970-01-01
    • 2014-03-04
    相关资源
    最近更新 更多