Set minPointLength for one of two series in highchart

被刻印的时光 ゝ 提交于 2021-01-28 01:46:56

问题


I have two series of data in my highchart and want to use "minPointLength" for only one of them. Is this possible to set? My series contains only: name, color and data. My chartconfig looks like this:

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,
    },
  },
};

What I want is to always show minimum height on one of the datasets. Even if the scale goes from 1 to 1 000 000, it supposed to be a little peak at the bottom if one of my columns shows 3 out of 1 000 000.


回答1:


Yes, you can set a minPointLength property individually for each series:

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

Live demo: http://jsfiddle.net/BlackLabel/19nc8jv6/

API Reference: https://api.highcharts.com/highcharts/series.column.minPointLength



来源:https://stackoverflow.com/questions/56168917/set-minpointlength-for-one-of-two-series-in-highchart

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!