我按照另一个问题的答案,并确保jquery.jqplot.css已正确包含,但我仍然无法显示颜色。我尝试了很多渲染(默认,条形,漏斗),但没有一个工作。我甚至尝试使用增强的图例渲染器无济于事。
这是我用来渲染图表的代码。除了传奇
之外,一切都会好起来的plot2 = $j.jqplot('chart_palnie', [serie], {
seriesDefaults: {
renderer:$j.jqplot.FunnelRenderer,
rendererOptions:{
sectionMargin: 8,
widthRatio: 0.3,
showDataLabels: true,
dataLabels: serie_labeluri,
dataLabelThreshold: 0
//dataLabelFormatString: '%s, %d'
}
},
legend: {
show:true,
location: 'e',
showLabels: true,
showSwatch: true
}
});
答案 0 :(得分:4)
包含CSS文件 jquery.jqplot.css ..这为我解决了
答案 1 :(得分:1)
尝试添加展示位置选项。我还包括renderOptions,但在我的情况下,这主要是为了IE支持。
legend: {
show: true,
location: 'n',
placement: 'inside',
renderer: $.jqplot.EnhancedLegendRenderer,
rendererOptions: {
numberRows: 1,
disableIEFading: true
}
}