我正在开发一个应用程序,用户可以将图表类型从Spider web图表切换到Column Chart或Vice Versa。但是,当我将Spider Web Type更改为column并禁用极性属性时,您可以从代码片段中看到,图表的第一列粘贴到Y
轴,依此类推,最后一列如图所示:
$(function () {
$('#container').highcharts({
chart: {
// polar: true,
type: 'column'
},
title: {
text: 'Budget vs spending',
x: -80
},
pane: {
size: '80%'
},
xAxis: {
categories: ['Sales', 'Marketing', 'Development', 'Customer Support',
'Information Technology', 'Administration'],
tickmarkPlacement: 'on',
lineWidth: 0
},
yAxis: {
gridLineInterpolation: 'polygon',
lineWidth: 0,
min: 0
},
tooltip: {
shared: true,
pointFormat: '<span style="color:{series.color}">{series.name}: <b>${point.y:,.0f}</b><br/>'
},
legend: {
align: 'right',
verticalAlign: 'top',
y: 70,
layout: 'vertical'
},
series: [{
name: 'Allocated Budget',
data: [43000, 19000, 60000, 35000, 17000, 10000],
pointPlacement: 'on'
}]
});
});
&#13;
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<script src="http://code.highcharts.com/highcharts.js"></script>
<script src="http://code.highcharts.com/highcharts-more.js"></script>
<script src="http://code.highcharts.com/modules/exporting.js"></script>
<div id="container" style="min-width: 400px; max-width: 600px; height: 400px; margin: 0 auto"></div>
&#13;
我已尝试通过将offset
添加到Y
轴
yAxis: {
lineWidth: 1,
offset: 70,
title: {
text: 'Primary Axis'
},
但它没有做到这一点!你可以看看演示,让我知道我该怎么处理这个?
答案 0 :(得分:0)
问题是由系列中的pointPlacement引起的:
pointPlacement: 'on'
如果删除此图表,图表会根据需要进行渲染。