HighCharts - 条形图中的Y轴填充 [英] HighCharts - Y-Axis padding in a bar chart

查看:208
本文介绍了HighCharts - 条形图中的Y轴填充的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用了一种y轴标签,其中每个数字都放置在左对齐的水平网格线的顶部,如下图所示。



更新后的演示:

strong>例如,请参阅此图表:,但该属性似乎对柱形图没有影响。 Highcharts有没有办法获得我要去的效果?我理论上可以通过使栏非常狭窄来获得效果,但我正在寻找另一种解决方案。

它不会为分类轴工作 - 在该类型中,轴被分成相同的类别,因此不允许使用最小/最大填充。



可能的解决方案是使用标准轴,但是对于轴使用 formatter ,请参阅: http:// jsfiddle。 net / NWsgz / 4 /

I use a style of y-axis labels in which each number is placed, left-aligned, on top of its respective horizontal grid line, like in the image below.

The only complication with this in HighCharts is that the axis labels will sometimes overlap with the first column in a column chart.

Updated demo: For an example, see this chart: http://jsfiddle.net/NWsgz/1/

I have tried to achieve this using xAxis.minpadding, but that property seems to have no effect on column charts. Is there a way in Highcharts to get the effect I am going for? I could theoretically get the effect by making the bars very narrow, but I am looking for another solution.

解决方案

It doesn't work for categorized axis - in that type,axis is divided into equal categories, so min/max padding isn't allowed.

Possible solution is to use standard axis, but use formatter for axis, see: http://jsfiddle.net/NWsgz/4/

这篇关于HighCharts - 条形图中的Y轴填充的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆