问题是关于重用绘图属性,例如
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。我希望使用相同属性对类似绘图重复使用该定义
发布于 2014-03-22 01:53:28
这就是你实现它的方法。
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);https://stackoverflow.com/questions/22555731
复制相似问题