Highcharts xAxis缩放点消失,Angular5

时间:2018-03-08 19:59:38

标签: angular typescript highcharts angular5 angular2-highcharts

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

当我设置xAxis min,max和zoom时,这些点会消失。当我没有设置min,max时,点在缩放时不会消失。

以下是我对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的快照

Normal

Zooming

0 个答案:

没有答案