1
我用highcharts顯示日期,現在我生成的js代碼如下:同JS highcharts顯示不一樣的
$(function() {
var chart;
$(document).ready(function() {
chart = new Highcharts.Chart({
chart: {
renderTo: 'container',
type: 'column',
borderWidth: 1
},
title: {
text: '終端類型統計'
},
xAxis: {
categories: ['Apple', 'Samsung Electronics Co.,Ltd', 'HTC Corporation', 'Hon Hai Precision Ind. Co.,Ltd.', 'Intel Corporate', 'Xiaomi Technology,Inc.', 'Liteon Technology Corporation', 'Huawei Technologies Co., Ltd', 'Murata Manufactuaring Co.,Ltd.', 'Azurewave Technologies, Inc.', 'Huawei Device Co., Ltd', 'zte corporation', 'Lenovo Mobile Communication Technology Ltd.', 'GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP.,LTD.', 'Azurewave', 'XIAOMI CORPORATION', 'Sony Ericsson Mobile Communications AB', 'Yulong Computer Telecommunication Scientific(shenzhen)Co.,Lt', 'AcSiP Technology Corp.', 'BBK Electronics Corp., Ltd.', '其他'],
labels: {
rotation: -25,
align: 'right',
style: {
fontSize: '13px',
fontFamily: 'Verdana, sans-serif'
}
}
},
yAxis: {
title: {
text: '數據統計'
}
},
plotOptions: {
column: {
colorByPoint: true,
dataLabels: {
enabled: true,
rotation: -90,
y: 25,
color: '#F4F4F4',
formatter: function() {
return Highcharts.numberFormat(this.y, 0);
},
x: 10,
style: {
fontWeight: 'bold'
}
}
}
},
lang: {
decimalPoint: '.',
downloadPNG: '下載PNG圖片',
downloadJPEG: '下載JPG圖片',
downloadPDF: '下載PDF文件'
},
series: [{
showInLegend: false,
data: [581476, 407696, 277894, 247696, 168586, 138802, 126082, 93168, 76234, 51568, 51512, 50654, 49026, 47092, 44944, 43188, 41268, 40900, 39408, 38172, 580090],
dataLabels: {
enabled: true,
rotation: -90,
color: '#FFFFFF',
align: 'right',
x: -3,
y: 10,
formatter: function() {
return this.y;
},
style: {
fontSize: '13px',
fontFamily: 'Verdana, sans-serif'
}
}
}
]
});
});
})
應該顯示像this,但在我的網頁它[顯示這樣的] ie ie 8(https://i.minus.com/irfUdeWCLEGPD.png)! 任何想法?
ps:,:它在FireFox中工作正常。
我的眼睛!請修復該代碼。 –
也許你在你的CSS中有一些相沖突的類 –
你對這兩個頁面使用相同的代碼嗎?可以看看你的網頁上的源代碼,而不是jsfiddle.net? –