2013-11-14 43 views
0

如何使我的区域图在jqplot中变得透明?有没有在这方面的jqplot任何选项。我正在使用下面的代码来绘制图表。我曾尝试与grid.background为“透明”,但是,这并不工作了如何使我的区域图在jqplot中变得透明?

    var plot1 = $.jqplot('firstChart', [s1], { 
         height:280, 
         itle:'Server Activity', 
         grid: { 
          drawBorder: true, 
          shadow: true, 
          gridLineColor: '#666666', 
          gridLineWidth: .2, 
          background: 'transparent' 
         }, 

         axesDefaults: { 
          tickRenderer: $.jqplot.CanvasAxisTickRenderer , 
          tickOptions: { 
           fontFamily: 'Georgia', 
           fontSize: '10pt', 
           angle: -40 
          } 
         }, 
         series:[{ 
           lineWidth:2, 
           color: "#4bb2c5", 
           markerOptions : { 
            style:"filledCircle", size:6 
           }}], 
         seriesDefaults: { 
          fill: true,        
          rendererOptions: { 
           baselineWidth: 1.5, 
           fillToZero: true, 
           baselineColor: '#ffffff', 
           drawBaseline: true, 
           smooth: true, 
           animation: { 
            show: true, 
            speed:1000 
           } 
          } 
         }, 

         axes:{ 
          xaxis:{ 
           renderer:$.jqplot.DateAxisRenderer, 
           tickRenderer: $.jqplot.CanvasAxisTickRenderer, 
           tickOptions:{       
            tickOptions: { 
             mark: 'outside', // Where to put the tick mark on the axis 
             show: true,   // wether to show the tick (mark and label), 
             showLabel: true, // w ether to show the text label at the tick,         
             fontSize:11 
            } 
           } , 
           autoscale:true 
          }, 
          yaxis:{ 
           min:0, 
           tickOptions: {      
            mark: 'inside', // Where to put the tick mark on the axis 
            show: true,   // wether to show the tick (mark and label), 
            showLabel: true, // wether to show the text label at the tick, 
            formatString: '%d' , // format string to use with the axis tick formatter 
            fontSize:11 
           } 
          } 
         },    
         highlighter: { 
          show: true, 
          sizeAdjust: 7.5, 
          tooltipOffset: 9, 
          tooltipContentEditor: function(current, serie, index, plot){ 
           var val = plot.data[serie][index]; 
           var valArr = val[0].split(" "); 
           var value=valArr[1].split(":"); 
           return value[0] +':'+value[1]+ ', ' + val[1]; 
          } 
         } 
        }); 

回答

0

让你grid部分是这样的:

grid: { 
    drawBorder: true, 
    shadow: true, 
    gridLineColor: '#666666', 
    gridLineWidth: .2, 
    background: 'rgba(255,255,255,0)' 
}, 

实施例:JsFiddle link

0

可以使用grid.background设置:

grid: { 
    background: 'transparent' 
} 

请注意,这并不在IE8工作虽然,并在一个白色的背景结果。

API Ref

+0

嗨Rory,我已经尝试过镀铬,但没有做任何改变 – chinnusaccount

+0

你能用你试过的代码更新你的问题吗? –

+0

嗨Rary ..请参阅我已更新的代码 – chinnusaccount

0

添加seriesColors:[ 'RGBA(100,100,100,0.5)']上述网格{ }区域图将是透明的颜色。

相关问题