问题描述
我试图将yaxis和xaxis向下。例如,图中的3843应该是3.843,工具提示显示3.843 k。我得到了工具提示工作,但无法让它更改图形yaxis和xaxis值,以便图表可以完全显示所有方面。
正如你在这里看到的:
这就是xaxis的样子
yAxis:{
gridLineInterpolation:'polygon',
lineWidth:0,
min:0,
gridLineColor: #808080,
gridLineDashStyle:Solid,
gridLineWidth:2,
标签:{
格式:'{value:.2f}',
style :{
color:'#c4c4c4',
font:'11px Trebuchet MS,Verdana,sans-serif'
}
}
}
如果要以同样的方式显示yAxis标签,从yAxis.labels对象(然后千位前缀将显示打好)。如果要显示点的精确值作为yAxis标签,可以在加载事件中更新 tickPositions
数组并充分格式化它们。看看下面的例子。
API参考:
例如:
I am trying to round yaxis and xaxis down. For example 3843 should be 3.843 on the graph and tooltip show 3.843 k.
I have got the tooltip working but cant get it to change the graphs yaxis and xaxis value so that the graph can show all sides fully.
As you can see here:http://jsfiddle.net/kzL0phfu/
This is what xaxis looks like
yAxis: {
gridLineInterpolation: 'polygon',
lineWidth: 0,
min: 0,
gridLineColor: "#808080",
gridLineDashStyle: "Solid",
gridLineWidth: 2,
labels: {
format: '{value:.2f}',
style: {
color: '#c4c4c4',
font: '11px Trebuchet MS, Verdana, sans-serif'
}
}
}
If you want to display yAxis labels the same way, get rid of the formatter from the yAxis.labels object (then the thousand prefix will display). In case you want to display exact values of the points as yAxis labels, you can update tickPositions
array on load event and format them adequately. Take a look at the example below.
API Reference:
http://api.highcharts.com/highcharts/chart.events.loadhttp://api.highcharts.com/highcharts/yAxis.tickPositions
Example:
http://jsfiddle.net/ojno8rx1/
这篇关于Highcharts围绕yaxis和xaxis数字的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!