How to add extra tears(ticks) in highcharts?

2019-09-16 01:34发布

HIGH CHARTS

In addition to this question, I would like to ask another question here in this thread.

How to add extra tears(ticks), in such a way, the green bar dataLabel, does stay inside plotting area, rather, going out of plotting area or made hidden. JSFIDDLE

2条回答
▲ chillily
2楼-- · 2019-09-16 01:49

There are lots of ways to do this. But quickest one is adding a max value to yAxis with using yAxis.max.

yAxis: {
        allowDecimals: false,
        max: 6000
    },

Here is the working example: jsFiddle.

OR

You can use the combination of yAxis.tickAmount and yAxis.tickInterval like this;

yAxis: {
        allowDecimals: false,
        tickAmount: 10,
        tickInterval: 1000
    },

Here is the working example: jsFiddle.

查看更多
祖国的老花朵
3楼-- · 2019-09-16 01:58

Besides setting a new max property or trying a different combination of ticks, you can simply set overflow property with 'none' value and crop with false. This way you can display data labels outside the plot area.

API Reference:
http://api.highcharts.com/highcharts/plotOptions.series.dataLabels.overflow
http://api.highcharts.com/highcharts/plotOptions.series.dataLabels.crop

Example:
http://jsfiddle.net/2qtpx0rL/

查看更多
登录 后发表回答