我正在使用 jqplot,为什么堆积条形图对每个系列使用不同的 Y 刻度?
var ticks = ["test1", "test2", "test3", "test4", "test5", "test6", "test7", "test8", "test9"];
var s1 = ["3", "3", "1", "3", "2", "3", "30", "3", "3"];
var s2 = ["0", "0", "2", "0", "0", "0", "0", "0", "0"];
plot3 = $.jqplot('daily-bookings-by-user', [s1, s2], {
// Tell the plot to stack the bars.
stackSeries: true,
seriesDefaults:{
renderer:$.jqplot.BarRenderer,
rendererOptions: {
// Put a 30 pixel margin between bars.
barMargin: 20,
// Highlight bars when mouse button pressed.
// Disables default highlighting on mouse over.
highlightMouseDown: true
},
pointLabels: {show: true}
},
axes: {
xaxis: {
renderer: $.jqplot.CategoryAxisRenderer,
ticks: ticks
},
yaxis: {
// Don't pad out the bottom of the data range. By default,
// axes scaled as if data extended 10% above and below the
// actual range to prevent data points right on grid boundaries.
// Don't want to do that here.
padMin: 0,
pad: 0,
min: 0,
},
},
legend: {
show: true,
location: 'e',
placement: 'outside'
},
series:[
{
label:'Test 1'
},
{
label:'Test 2'
}
],
});