我有条件我必须结合条形图和折线图我有以下数据请检查是否有任何解决方案:
$(document).ready(function () {
var s1 = [ 59, 175, 148, 213, 19, 213, 144, 64, 229, 89, 59, 363, 5, 71, 31];//bar chart
var s2 = [66, 220, 87, 59, 15, 227, 134, 46, 139, 30, 18, 71, 2, 17, 2];
//bar chart
var line1= [98.81, 98.90, 99.00, 99.17, 99.35, 99.36, 99.46, 99.56, 99.71, 99.82, 99.87, 99.89, 99.92, 99.95,99.98];//data for line chart
var line2 = [ 99.52, 99.52, 99.52, 99.52, 99.52,99.52,99.52,99.52, 99.52, 99.52, 99.52, 99.52, 99.52, 99.52];//data for line chart
var ticks = ['Rakhine', 'Ayeyarwady', 'Magway', 'Bago', 'Kayah', 'Sagaing', 'Shan', 'Kachin', 'Yangon', 'Mon', 'Kayin', 'Mandalay',
'Chin', 'Tanintharyi', 'Naypyitaw' ];
//now i need to combine bar and line with the same plot
plot2 = $.jqplot('chart2', [s1, s2], {
seriesDefaults: {
renderer: $.jqplot.BarRenderer,show: true,
pointLabels: { show: true }
},
axes: {
xaxis: {
renderer: $.jqplot.CategoryAxisRenderer,
ticks: ticks
}
}
});
});
说明