下面的代码使用窗格在堆叠条形图中显示两个条形。我的问题是,图表只显示了一部分,你可以看到x轴从94%开始。因此,看起来值50(栏1)小于2(栏2)。为什么只有部分图表显示,我该如何解决这个问题?
<div id="chart"></div>
<script>
$("#chart").kendoChart({
legend: {
visible: false
},
seriesDefaults: {
type: "bar",
stack: {
type: "100%"
},
labels: {
visible : true,
position: "insideBase"
}
},
panes:[{
name: "pane1"
}],
series: [{
data: [50],
axis: "axis1",
categoryAxis: "catAxis1"
},
{
data: [2],
axis: "axis1",
categoryAxis: "catAxis1"
}],
valueAxis: [{
name: "axis1",
pane: "pane1"
}],
categoryAxis: [{
name: "catAxis1",
pane: "pane1"
}]
});
</script>
给valueAxis:
添加一个最小值0valueAxis: [{
min: 0,
name: "axis1",
pane: "pane1"
}],