我正在将 jqPlot 用于条形图,并且我想将 x 轴显示为图例。
附上截图...
代码:
var s1 = [2.5, 6.3, 7.4, 10];
var ticks = ['a', 'b', 'c', 'd'];
plot2 = $.jqplot('chart2', [s1], {
seriesDefaults: {
renderer:$.jqplot.BarRenderer, rendererOptions:{ varyBarColor : true },
pointLabels: { show: true }, showLabel: true, },
series: [ {label: 'Cups'}, {label: 'Dishes'}, ],
legend: { show: true, placement: 'outside', //rendererOptions: {numberColumns: 2} },
axes: { xaxis: { renderer: $.jqplot.CategoryAxisRenderer, ticks: ticks },
yaxis:{ tickOptions:{ formatString:'%.2f%' } } }