angular2-highchart线图在y轴上显示错误的值

时间:2018-10-25 14:07:08

标签: javascript angular highcharts

我正在Angular 6应用程序上使用 angular2-highchart 折线图,该图按日期在图表上显示活动用户。

enter image description here

这很简单,但是y轴存在问题。右侧的值与该行上显示的实际值完全不同。

      chart: {
        redraw: false,
        zoomType: this.rangeEnabled ? 'x' : null,
        type: 'spline',
        alignTicks: false
      },
      title: {
        text: this.title
      },
      plotOptions: {
        spline: {
          marker: {
            symbol: 'circle'
          }
        },
        series: {
          compare: this.showByPercent ? 'percent' : 'value'
        }
      },
      yAxis: {
        // minRange: 3600 * 1000 // one hour
      },
      xAxis: {
        // min: 0,
        minRange: 1,
        allowDecimals: false
        // ceiling: 100
      },
      rangeSelector: {
        enabled: this.rangeEnabled,
        // selected: 2,
        allButtonsEnabled: true,
        buttons: [
          {
            type: 'week',
            count: 1,
            text: '1w'
          },
          {
            type: 'month',
            count: 1,
            text: '1m'
          },
          {
            type: 'month',
            count: 3,
            text: '3m'
          },
          {
            type: 'year',
            count: 1,
            text: '1y'
          },
          {
            type: 'all',
            text: 'All'
          }
        ]
      },
      navigator: {
        enabled: this.navigatorEnabled,
        adaptToUpdatedData: false
      },
      scrollbar: {
        enabled: this.navigatorEnabled,
        scrollbar: {
          liveRedraw: false
        }
      },
      tooltip: {
        shared: true,
        split: false,
        xDateFormat: this.preciseTooltipDate ? undefined : '%A, %b %e, %Y'
      },
      legend: {
        enabled: this.legendEnabled,
        title: { text: 'Filters' },
        // layout: 'vertical',
        // align: 'bottom',
        // verticalAlign: 'middle',
        useHTML: true,
        floating: false
      },
      exporting: {
        // allowHTML: true,
        buttons: {
          contextButton: {
            enabled: this.download,
            symbol: 'download'
          }
        }
      },
      series: series

series 变量只是一个数据数组,其格式如下:

[date:number, value:number]

奇怪的是,对于某些数据集,它与预期值相差不远,而对于其他数据集,则完全错误。

0 个答案:

没有答案
相关问题