将highPointt中的两个系列之一设置minPointLength

时间:2019-05-16 12:45:14

标签: javascript reactjs highcharts

我的图表中有两个系列的数据,并且只想对其中一个使用“ minPointLength”。这可以设置吗?我的系列仅包含:名称,颜色和数据。我的chartconfig看起来像这样:

const chartConfig = {
  chart: {
    type: 'column',
    dashStyle: 'ShortDash',
  },
  title: {
    text: '',
  },
  xAxis: {
    padding: 0,
    plotLines: [{
      dashStyle: 'shortDash',
    }],
  },
  yAxis: {
    opposite: true,
    title: {
      text: '',
    },
    gridLineDashStyle: 'dash',
  },
  plotOptions: {
    column: {
      borderRadiusTopLeft: 32,
      borderRadiusTopRight: 32,
      dataLabels: {
        enabled: true,
        crop: false,
        overflow: 'none',
      },
      enableMouseTracking: false,
    },
    series: {
      pointWidth: 24,
      minPointLength: 3,
    },
  },
};

我想要的是始终在其中一个数据集上显示最小高度。即使比例从1到1000000,如果我的其中一列显示1000000中的3,也应该在底部出现一个小峰值。

1 个答案:

答案 0 :(得分:2)

是的,您可以为每个系列分别设置minPointLength属性:

series: [{
    minPointLength: 80,
    data: [...]
}, {
    data: [...]
}]

实时演示: http://jsfiddle.net/BlackLabel/19nc8jv6/

API参考: https://api.highcharts.com/highcharts/series.column.minPointLength