0

我正在使用https://www.npmjs.com/package/highcharts-angular在 Angular 中生成 highcharts。

当我设置 xAxis 最小值、最大值和缩放时,这些点消失了。当我没有设置最小值,最大值时,这些点在缩放时不会消失。

这是我的 highcharts 图表选项。

        this._chartOptions= {
      title: { text: "highcharts" },
      plotOptions: {
        series: {
          states: {
            hover: {
              enabled: false // hover
            },

          },
          gapSize: 2,
        }
      },
      series:[ 
    { 
    data: [x,y],
    name: "name",
    allowPointSelect: false,
    step: false
    } ... 
      ],
      rangeSelector: {
        enabled: true,
        inputEnabled: true,
        buttons: [
          {
            type: 'hour',
            count: 24,
            text: '1d',
            dataGrouping: {
              forced: true,
              units: [['hour', [1]]]
            }
          },
          {
            type: 'day',
            count: 7,
            text: '1w',
            dataGrouping: {
              forced: true,
              units: [['day', [1]]]
            }
          },
          {
            type: 'week',
            count: 4,
            text: '1m',
            dataGrouping: {
              forced: true,
              units: [['week', [1]]]
            }
          },
          {
            type: 'month',
            count: 3,
            text: '1y',
            dataGrouping: {
              forced: true,
              units: [['month', [1]]]
            }
          },
          {
            type: 'all',
            text: 'All',
          }
        ]
      },
      xAxis: {
        min: new Date(this._fromDate + timezoneOffset) ,
        max: new Date(this._toDate + timezoneOffset),
        type: 'datetime',
      },
      chart: {
        zoomType: 'x',
        }
      },
    },
      function (chart) {
        // apply the date pickers
        setTimeout(function () {
          $('input.highcharts-range-selector', $('#' + chart.options.chart.renderTo)).datepicker()
        }, 0)
      };
    break;
}

这是highcharts的快照

普通的

缩放

4

0 回答 0