我认为这是图表组件中的一个错误,他们已修复它。我使用shieldui 图表 演示网站上最新版本的脚本进行了测试,一切都按预期工作。
您能否尝试使用以下脚本参考,如果问题仍然存在,请告诉我:
<script type="text/javascript" src="http://www.shieldui.com/shared/components/latest/js/shieldui-all.min.js"></script>
我使用以下示例:
<div id="chart1" ></div>
<br /><br /><br /><br /><br /><br />
<div id="chart2"></div>
$(document).ready(function () {
$("#chart2").shieldChart({
theme: "light",
exportOptions: {
image: false,
print: false
},
seriesSettings: {
bar: {
stackMode: "normal"
}
},
axisX: {
categoricalValues: [
"1952", "1956", "1960", "1964", "1968", "1972", "1976",
"1984", "1988", "1992", "1996", "2000", "2004", "2008", "2012"
]
},
primaryHeader: {
text: "Olympic Medals won by USA"
},
dataSeries: [{
seriesType: "bar",
collectionAlias: "Gold Medals",
data: [40, 32, 34, 36, 45, 33, 34, 83, 36, 37, 44, 37, 35, 36, 46],
stackIndex: 1
}, {
seriesType: "bar",
collectionAlias: "Silver Medals",
data: [19, 25, 21, 26, 28, 31, 35, 60, 31, 34, 32, 24, 40, 38, 29],
stackIndex: 1
}, {
seriesType: "bar",
collectionAlias: "Silver Medals1",
data: [19, 25, 21, 26, 28, 31, 35, 60, 31, 34, 32, 24, 40, 38, 29],
stackIndex: 2
},
{
seriesType: "bar",
collectionAlias: "Bronze Medals",
data: [17, 17, 16, 28, 34, 30, 25, 30, 27, 37, 25, 33, 26, 36, 29],
stackIndex: 2
}]
});
$("#chart1").shieldChart({
theme: "light",
tooltipSettings: {
customHeaderText: "Local point Value: ",
customPointText: function (point, chart) {
return shield.format(
'<span><b>{value}</b></span>',
{
value: point.y
}
);
}
},
axisX: {
categoricalValues: [
"1952", "1956", "1960", "1964", "1968", "1972", "1976",
"1984", "1988", "1992", "1996", "2000", "2004", "2008", "2012"
]
},
primaryHeader: {
text: "Olympic Medals won by USA"
},
dataSeries: [{
seriesType: "bar",
collectionAlias: "Gold Medals",
data: [40, 32, 34, 36, 45, 33, 34, 83, 36, 37, 44, 37, 35, 36, 46],
}]
});});