简体   繁体   English

Highcharts中yAxis类别的十进制值

[英]Decimal values for yAxis categories in Highcharts

I need my yAxis categories to be 0 = 'Poor', 0.25 = 'Below Average', 0.75 = 'Average' 1="Good" 我需要将yAxis类别设置为0 =“差”,0.25 =“低于平均水平”,0.75 =“平均” 1 =“良好”

I set the categories right, but Highcharts seems to interpret each point I plot to be equal to "1" step on the yAxis. 我将类别设置正确,但是Highcharts似乎将我绘制的每个点解释为等于yAxis上的“ 1”步。 See http://jsfiddle.net/54cFG/ http://jsfiddle.net/54cFG/

Ideally, that chart should always show 4 labels on the yAxis and the plotted points should line up at "Below Average" and "Average". 理想情况下,该图表应始终在yAxis上显示4个标签,并且绘制的点应在“低于平均值”和“平均”处对齐。

Is there a setting I'm missing? 有我缺少的设置吗? I think I pretty much tried everything at http://www.highcharts.com/ref/ 我想我几乎在http://www.highcharts.com/ref/

You could always use plot bands to display categories on the Y axis. 您始终可以使用绘图带在Y轴上显示类别。 That way you could still keep the actual values. 这样,您仍然可以保留实际值。 I have demonstrated that with your code here . 在这里用你的代码证明了这一点

EDIT 编辑

Here is another example with the grid lines taken off and the plotBands each with their own color. 这是另一个示例,其中的网格线被删除,plotBands各自具有自己的颜色。 Here is the color chart if you wan to change any of them. 如果您要更改其中的任何一个,这是色表

If you prefer to use the plot bands and no y-axis labels, here is an example of that. 如果您更喜欢使用绘图带并且不使用y轴标签,请参见以下示例 I think it works just fine. 我认为效果很好。 If the user really wants to see the exact value they can hover over the point. 如果用户确实想要查看确切的值,则可以将鼠标悬停在该点上。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM