[英]highcharts on IE9
I have two charts which are produced through a xml data. 我有两个通过xml数据生成的图表。 but it doesn't work on IE9.
但它不适用于IE9。
Here the code: 这里的代码:
var chart;var chartB;
jQuery(function() {
var options = {
chart: {
renderTo: 'container',
type: 'column',
marginTop: 160
},
title: {
text: 'Wochen\u00FCbersicht',
},
xAxis: {
categories: []
},
yAxis: {
title: {
text: 'Minuten'
},
},
the series are filled from xml 该系列由xml填充
series: []
};`load Data from xml file`
// Load the data from the XML file
$.get('Woche.xml', function(xml) {
// Split the lines
var $xml = $(xml);
// push categories
$xml.find('categories Monat').each(function(i, category) {
options.xAxis.categories.push($(category).text());
});
// push series
$xml.find('series').each(function(i, series) {
var seriesOptions = {
name: $(series).find('name').text(),
data: []
};
// push data points
$(series).find('data Minuten').each(function(i, Minuten) {
seriesOptions.data.push(
parseInt($(Minuten).text())
);
});
// add it to the options
options.series.push(seriesOptions);
set color 设置颜色
Highcharts.setOptions({ colors: ['#faebd7', '#00ffff ', '#000000', '#0000ff', '#8a2be2', '#7fff00', '#00008b', '#008000', '#ff1493', '#800000', '#ffa500', '#006400', '#ffff00', '#008080', '#ff0000', '#000080', '#bdb76b', '#20b2aa', '#ffd700', '#00ffff',] });
});
var chart = new Highcharts.Chart(options);
});
here begins the second chart 从这里开始第二张图表
var options2 = {
chart: {
renderTo: 'containerB',
type: 'column',
},
title: {
text: 'Monats\u00FCbersicht',
},
xAxis: {
categories: []
},
yAxis: {
title: {
text: 'Minuten'
},
},
series: []
};
// Load the data from the XML file
$.get('Monat.xml', function(xml) {
// Split the lines
var $xml = $(xml);
// push categories
$xml.find('categories Monat').each(function(i, category) {
options2.xAxis.categories.push($(category).text());
});
// push series
$xml.find('series').each(function(i, series) {
var seriesOptions = {
name: $(series).find('name').text(),
data: []
};
// push data points
$(series).find('data Minuten').each(function(i, Minuten) {
seriesOptions.data.push(
parseInt($(Minuten).text())
);
});
// add it to the options
options2.series.push(seriesOptions);
Highcharts.setOptions({ colors: ['#faebd7', '#00ffff ', '#000000', '#0000ff', '#8a2be2', '#7fff00', '#00008b', '#008000', '#ff1493', '#800000', '#ffa500', '#006400', '#ffff00', '#008080', '#ff0000', '#000080', '#bdb76b', '#20b2aa', '#ffd700', '#00ffff',] });
});
var chartB = new Highcharts.Chart(options2);
});
});
查看每个图表的JSON选项-yAxis标题后有一个逗号结尾,IE不支持。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.