问题是关于重用绘图属性,例如
plot_x = $.jqplot('SOMEDIVID_X', [line], {
grid: {
background: "rgba(0,0,0,0.0)",
drawBorder: false,
shadow: false,
color: "#fff"
},
series:[
{
pointLabels:{
show: true,
location:'s',
ypadding : 5,
edgeTolerance : -100,
}}],
seriesColors: ["#FF666D"],
seriesDefaults:{
renderer:$.jqplot.BarRenderer,
rendererOptions: {
fillToZero: true,
barWidth: '60'
}
},
axes: {
xaxis: {
renderer: $.jqplot.DateAxisRenderer,
},
yaxis: {
min:0,
max:100
}
}
});
此绘图定义附加到SOMEDIVID_X。我想重复使用相同属性的类似图的定义
答案 0 :(得分:0)
这就是你如何实现它。
var plotOptions = {
grid: {
background: "rgba(0,0,0,0.0)",
drawBorder: false,
shadow: false,
color: "#fff"
},
series:[
{
pointLabels:{
show: true,
location:'s',
ypadding : 5,
edgeTolerance : -100,
}}],
seriesColors: ["#FF666D"],
seriesDefaults:{
renderer:$.jqplot.BarRenderer,
rendererOptions: {
fillToZero: true,
barWidth: '60'
}
},
axes: {
xaxis: {
renderer: $.jqplot.DateAxisRenderer,
},
yaxis: {
min:0,
max:100
}
}
};
plot_x = $.jqplot('SOMEDIVID_X', [line], plotOptions);
plot_y = $.jqplot('SOMEDIVID_Y', [line], plotOptions);
plot_z = $.jqplot('SOMEDIVID_Z', [line], plotOptions);