如何在平移时禁用highcharts动画,但仍在加载时使用

问题描述 投票:0回答:1

在highchart 8.0.0上,可以使用滚轮进行缩放问题是highcharts在滚动上做动画我冲了文档,但我发现禁用所有动画有可能吗?

$('#container').highcharts({
  chart: {
    panning: true
  },
  mapNavigation: {
    enabled: true,
    enableButtons: true
  },
  title: {
    text: 'USD to EUR exchange rate over time'
  },
  subtitle: {
    text: document.ontouchstart === undefined ?
      'Click and drag in the plot area to zoom in' : 'Pinch the chart to zoom in'
  },
  xAxis: {
    type: 'datetime'
  },
  yAxis: {
    title: {
      text: 'Exchange rate'
    }
  },
  legend: {
    enabled: false
  },
  plotOptions: {
    area: {
      fillColor: {
        linearGradient: {
          x1: 0,
          y1: 0,
          x2: 0,
          y2: 1
        },
        stops: [
          [0, Highcharts.getOptions().colors[0]],
          [1, Highcharts.Color(Highcharts.getOptions().colors[0]).setOpacity(0).get('rgba')]
        ]
      },
      marker: {
        radius: 2
      },
      lineWidth: 1,
      states: {
        hover: {
          lineWidth: 1
        }
      },
      threshold: null
    }
  },

  series: [{
    type: 'area',
    name: 'USD to EUR',
    data: data
  }]
});

这里是jsfiddlehttps://jsfiddle.net/xm3692y8/2/

预先感谢最好

javascript css highcharts
1个回答
0
投票

我认为将chart.animation设置为false是您正在寻找的解决方案。它将禁用所有图表更新的动画,但最初的将保持不变。

演示:https://jsfiddle.net/BlackLabel/jLm8yrt6/

  chart: {
    panning: true,
    animation: false
  },

API:https://api.highcharts.com/highcharts/chart.animation

这是您的初衷吗?

© www.soinside.com 2019 - 2024. All rights reserved.