高图-yAxis对数刻度和allowDecimals设置为false似乎没有任何作用

min*_*rse 6 highcharts highcharts-ng angular2-highcharts

我想防止在已配置的面积图的y轴上显示十进制值。

当我的图表最初显示所有系列显示时,我看到:

在此处输入图片说明

But after filtering out some of the series to show, I see the y axis start showing decimal values like so:

在此处输入图片说明

My yAxis config is as follows:

yAxis: {
            gridLineColor: 'transparent',
            allowDecimals: false,
            type: 'logarithmic',
            minorTickInterval: 1,
            lineWidth: 0,
            gridLineWidth: 0,
            minorGridLineWidth: 0
        },
Run Code Online (Sandbox Code Playgroud)

I wondered if this had something to do with being a logarithmic scale, but when I comment out the type option to revert to using a default scale, it makes no difference, I observe the same behaviour.

Is there a way to prevent decimals showing and only have whole values showing?

Thanks

Update:

So I have replicated in a fiddle here -> https://jsfiddle.net/parky12/cn5mdzea/

Seems this is related to being on a logarithmic scale.

If you disable the low series, then decimals appear on the axis.

Is there a way to prevent these showing?

Joh*_*n M 3

我发现这个配置对我有用:

  yAxis: {
    gridLineColor: 'transparent',
    allowDecimals: false,
    type: 'logarithmic',
    tickInterval: 0.1,
    startOnTick: false,
    lineWidth: 0,
    gridLineWidth: 0,
    minorGridLineWidth: 0
  },
Run Code Online (Sandbox Code Playgroud)

请记住,tickInterval 属性对于对数轴的工作方式不同,即 1 将是 10 次方的标签,因此对于此数据集,至少需要 0.1 的间隔

小提琴