【发布时间】:2013-04-10 12:44:31
【问题描述】:
我想使用 jqplot 绘制一些数据,但有一个小问题。
我使用的代码是这样的(code on fiddle):
$.jqplot('chart1', [[202],[249],[148]], {
seriesColors : ['#ff0000', '#0f0', '#00f'],
seriesDefaults : {
renderer :$.jqplot.BarRenderer,
pointLabels : {
show : true
},
tickRenderer : $.jqplot.CanvasAxisTickRenderer,
rendererOptions : {
barDirection : 'horizontal'
}
},
axes: {
yaxis: {
renderer: $.jqplot.CategoryAxisRenderer,
ticks: ["some value", "other series", "third series"],
},
},
});
图表有 3 个水平区域,“一些值”、“其他系列”和“第三系列” 我需要每个图表栏都在相应的区域下,并保持现在的颜色(红色到“某个值”,绿色到“其他系列”,蓝色到“第三系列”)。
我需要如何格式化数据才能得到这个?
作为附加问题:
我希望 yaxis 和相应的 ax 标签之间有几个像素的边距。如何设置?
图表具有背景颜色(淡黄色)。如何消除该颜色并获得容器具有的任何颜色?
【问题讨论】:
标签: javascript jquery charts jqplot