How to add extra tears(ticks) in highcharts?

こ雲淡風輕ζ 提交于 2019-12-25 08:48:37

问题


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


回答1:


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.




回答2:


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/



来源:https://stackoverflow.com/questions/45679142/how-to-add-extra-tearsticks-in-highcharts

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