Jquery jqplot:如何在条形图中设置默认值
我正在使用此代码创建条形图Jquery jqplot:如何在条形图中设置默认值,jquery,jqplot,Jquery,Jqplot,我正在使用此代码创建条形图 var plot1 = $.jqplot('fidtenuredivid', [line1], { title: '%%K_CATEGORY_VS_AMOUNT%%', animate: !$.jqplot.use_excanvas, seriesDefaults:{ renderer:$.jqplot.BarRenderer, pointLabel
var plot1 = $.jqplot('fidtenuredivid', [line1], {
title: '%%K_CATEGORY_VS_AMOUNT%%',
animate: !$.jqplot.use_excanvas,
seriesDefaults:{
renderer:$.jqplot.BarRenderer,
pointLabels: { show: true,
stackedValue: true},
color: "#00749F"
},
axes: {
xaxis: {
renderer: $.jqplot.CategoryAxisRenderer
}
}
});
但我希望它应该显示黑色圆圈标记作为每个类别的默认值。它可以实现。
请在下面找到这样做的示例代码,您可以在代码中使用这个概念
$(document).ready(function () {
var defaults = [
['2014-01-15 15:10:01', 15],
['2014-01-15 15:10:12', 10],
['2014-01-15 15:10:14', 5],
['2014-01-15 15:10:17', 19],
['2014-01-15 15:10:23', 15],
['2014-01-15 15:10:28', 12]
];
var bars = [
['2014-01-15 15:10:01', 21],
['2014-01-15 15:10:12', 21],
['2014-01-15 15:10:14', 22],
['2014-01-15 15:10:17', 21],
['2014-01-15 15:10:23', 22],
['2014-01-15 15:10:28', 18]
];
var plot1 = $.jqplot('chart1', [bars, defaults], {
title: 'Default Date Axis',
axes: {
xaxis: {
renderer: $.jqplot.CategoryAxisRenderer
}
},
series: [{
renderer: $.jqplot.BarRenderer,
pointLabels: {
show: true,
stackedValue: true
},
color: "#00749F",
label: "peer expenses"
}, {
lineWidth: 1,
showLine: false,
markerOptions: {
style: 'filledCircle',
size: 40
},
label: "Expenses"
}],
legend: {
show: true,
location: 'e',
placement: "outsideGrid"
}
});
});
嘿,谢谢你的回答。你能告诉我如何指定圆圈标记显示默认值和条形图显示原始值。正如我在图表中所示,蓝色显示“同行费用”,黑色显示您的费用。我编辑了我的答案,将图例包括在内。如果你想在图例中画一个圆圈,那么你必须自己画图例,而不是jqplot。非常感谢gyandeep。我们可以得到关于圆圈的工具提示吗。如果可能的话,请告诉我。我们能把它做成3D吗?我认为jqplot不支持3D。