2013-03-20 127 views
2

我有隻似乎影響Internet Explorer 8中Highcharts在Internet Explorer中不呈現

我已經使用了highcharts.js腳本http://www.highcharts.com/但是我試圖顯示這個數據顯示在我的網站數據的問題燈箱內,並使用從http://buckwilson.me/lightboxme/

的lightbox_me.js劇本我會盡量表現出我所使用的代碼:

<script type="text/javascript"> 

var chart; 
$(document).ready(function() { 
chart = new Highcharts.Chart({ 
chart: { 
renderTo: 'analysis', 
defaultSeriesType: 'bar', 
backgroundColor: 'rgba(0,0,0,0)' 
}, 
title: { 
text: '' 
}, 
subtitle: { 
text: '' 

}, 
xAxis: { 
categories: ['First Impressions', 'Politeness/Courtesy', 'Helpfulness', 'Speed and Efficiency', 'Reliability', 'Trustworthiness', 'Value for Money', 'Quality of service', 'After Sales', 'Overall Satisfaction'], 
title: { 
text: null 
} 
}, 
yAxis: { 
min: 0, 
max:100, 
title: { 
text: 'Overall Score (%)', 
align: 'middle' 
} 
}, 
tooltip: { 
formatter: function() { 
return ''+ 
this.y +' %'; 
} 
}, 
plotOptions: { 

bar: { 
dataLabels: { 
enabled: false 
} 
} 
}, 

legend: { 
enabled: false, 
layout: 'vertical', 
align: 'right', 
verticalAlign: 'top', 
x: -100, 
y: 100, 
floating: true, 
borderWidth: 1, 
backgroundColor: '#FFFFFF', 
shadow: false 
}, 
credits: { 
enabled: false 
}, 
series: [{ 
name: 'Year 2012', 
data: [<?php echo "$first_impression".","."$politeness".","."$knowledge".","."$speed".","."$reliability".","."$honesty".","."$value".","."$quality".","."$after_sales".","."$satisfaction"; ?>] 
}] 
}); 


}); 



</script> 

正如你所看到的,我已經使用PHP插入統計。

然後我有收藏腳本:

$('#scores_button').click(function(e) { 
$('#scores_container').lightbox_me({ 
centered: true, 
onLoad: function() { 
$('#scores_container').find('input:first').focus() 
} 
}); 
e.preventDefault(); 
}); 

這是HTML:

<div id='scores_container'> 

<h1 class='lightbox_header'>Areas of Performance</h1> 

<div id='analysis'> 

</div> 

<p class='lightbox_paragraph'>We asked all repondents to score the business on it's performance in the areas above. This chart shows the average scores in each area.</p> 

<a id='close_x' class='close sprited' href='#'>close</a> 

</div> 

最後我的CSS

#scores_container { 
width:760px; 
display:none; 
background-color:#f2f5f7; 
padding:30px 40px 40px 40px; 
-moz-border-radius: 3px; 
-webkit-border-radius: 3px; 
border-radius: 3px; 
border: 1px solid #536376; 
-webkit-box-shadow: rgba(0,0,0,.6) 0px 2px 12px; 
-moz-box-shadow: rgba(0,0,0,.6) 0px 2px 12px; 
box-shadow: rgba(0,0,0,.6) 0px 2px 12px; 
position:absolute; 
top:0px; 
left:0px; 
} 

h1.lightbox_header{ 
font-size:22px; 
font-weight:bold; 
color:#536376; 
margin-bottom:20px; 
border-bottom:1px solid #cdd0d9; 
padding-bottom:10px; 
} 

#analysis{ 
width:680px; 
height:400px; 
} 

p.lightbox_paragraph, p.lightbox_paragraph_first{ 
font-family: 'PT Sans', sans-serif; 
font-weight:700; 
font-style:italic; 
color:#536376; 
border-top:1px solid #cdd0d9; 
padding-top:10px; 
} 

此代碼工作在所有瀏覽器我已經測試但Internet Explorer。 Internet Explorer 8是我一直在嘗試尋找解決方案時使用的瀏覽器。

請看這張截圖它是如何出現在IE8:

Internet Explorer 8

它如何出現在谷歌瀏覽器:

Google Chrome

我的想法是,也許這是我的CSS造成這個問題,但無論我嘗試什麼,我似乎都無法讓圖表顯示出來。圖表容器在瀏覽器窗口中也不是垂直居中,但是一旦我得到圖表進行渲染,這是我可以使用的。任何幫助將非常感激。

我知道這是不是因爲我只是學習,但請參見下面的鏈接網站本身特別精心打造的網站,如果它會幫助:http://www.bbg.im/development

該錯誤是發生在個人資料頁時,圖表圖標被點擊。

我也在使用相同的燈箱腳本遇到與餅圖和谷歌地圖相同/類似的問題。

非常感謝。

+0

哪裏是單擊除展示收藏... – 2013-03-20 10:58:42

+0

@Rohit阿扎德你好。對不起,但我不確定你在問我什麼。我有一個ID爲#scores_button的div,點擊時會啓動lightbox_me腳本。 – 2013-03-20 11:12:12

+2

我可以看到你在IE中有錯誤,你可以使用[this](http://code.highcharts.com/highcharts.src.js)lib並從IE複製錯誤? – 2013-03-20 11:17:56

回答

2

剛剛查看了HTML文件的來源,並驚訝地看到數組中額外的逗號。

series: [{ name: 'Year 2012', data: [95,100,95,95,95,100,80,90,93,] }]

能否請您在數據數組的末尾刪除尾隨逗號。即數據數組應該像這樣呈現。

series: [{ name: 'Year 2012', data: [95,100,95,95,95,100,80,90,93] }]

+0

好景點!我會試着弄清楚這個逗號現在來自哪裏。它不應該在那裏。 – 2013-03-20 11:38:33

+0

明白了!非常感謝。事實證明,這是我的php中一個錯誤的變量,它沒有完成一系列數據。這意味着最後一個數據會出現一個逗號。 – 2013-03-20 11:57:57

相關問題