根据所选图表类型(线/列/散点等),是否可以在一个渲染中具有多个选项设置?例如,我有两种图表类型:
var options = {
chart: {
renderTo: 'container',
type: 'column',
},
title: {
text: title
},
subtitle: {
text: subtitle
},
xAxis: {
categories: []
},
yAxis: {
min: 0,
title: {
text: 'Percentage'
}
},
legend: {
layout: 'vertical',
backgroundColor: '#FFFFFF',
align: 'left',
verticalAlign: 'top',
x: 100,
y: 70,
floating: true,
shadow: true
},
tooltip: {
formatter: function () {
return Math.round(this.y * 100) + '%';
}
},
plotOptions: {
column: {
pointPadding: 0.2,
borderWidth: 0
}
},
series: []
};
和:
var options = {
chart: {
renderTo: 'container',
type: 'line'
},
title: {
text: title
},
subtitle: {
text: subtitle
},
xAxis: {
categories: []
},
yAxis: {
min: 0,
title: {
text: 'Count'
}
},
tooltip: {
formatter: function () {
var s = '';
$.each(this.points, function (i, point) {
s += point.series.name + ': ' + point.y + '<br/>';
});
return s;
},
shared: true
}
},
legend: {
layout: 'vertical',
align: 'right',
verticalAlign: 'top',
x: -10,
y: 100,
borderWidth: 0
},
series: []
};
是否可以将它们组合在一起作为一个$(document).on("click", ".render-Chart", function () {...}
或var chart
?谢谢!