首页 > 解决方案 > Angular 9 Highcharts - 当使用带有类型规的系列类型饼图时,饼图的 innerSize 不起作用

问题描述

在我更新到 hicharts v8.0.1 之后。与 'gauge' 系列一起使用时,'pie' 系列的 innerSize 什么也不做。有什么解决方案吗?

唯一可行的方法是降级,但我不想这样做。

 pane: {
    center: ['50%', '75%'],
    size: '125%',
    startAngle: -90,
    endAngle: 90,
  },
  plotOptions: {
    pie: {
      dataLabels: {
        connectorWidth: 0,
        style: { fontWeight: 'medium', color: '#4A4A4A' },
        formatter: function(): any {
          return this.point.options.name;
        },
        distance: -1,
        y: -20,
        x: -3,
      },
      startAngle: -90,
      endAngle: 90,
      innerSize: '65%',
      center: ['50%', '85%'],

    },
    gauge: {
      dataLabels: {
        enabled: false,
      },
      dial: {
        radius: this.chartSizeOptions.dialRadius,
      },
    },

  },
  chart: {
    type: 'gauge',
  },
series: [
    {
      type: 'pie',
      innerSize: '60%',
      size: '140%',
      keys: ['y', 'id', 'color', 'name'],
      data: seriesData,
      enableMouseTracking: false,
    },
    {
      type: 'gauge',
      name: '% over/under goal',
      animation: false,
      data: [this.calculateGaugePoint(goalCostDiffPct)],
    },
  ],
};

这就是我需要的 在此处输入图像描述

这就是我得到的 在此处输入图像描述

我发现这个例子http://jsfiddle.net/ymf2zzn1/1/为了看到这个问题

标签: angularhighcharts

解决方案


这看起来像一个 Highcharts 错误,所以我在这里报告了它:https ://github.com/highcharts/highcharts/issues/13629

该问题从 8.0.1 版本开始出现,因此您可以使用 8.0.0 版本作为解决方法。


推荐阅读