2010-10-27 21 views
11

jqPlot cambia il colore del riempimento quando il mouse si libra ... Voglio rimuovere quell'effetto .. Come ??jqplot cambia il colore del grafico al passaggio del mouse

Qui ci sono le opzioni utilizzate:

var options={ 
    series: [{ 
      neighborThreshold: -1, 
      shadowAngle:0, 
      shadowOffset:2.5, 
      shadowAlpha:.05, 
      shadowDepth:5 
     }], 
    seriesDefaults: { 
     color: '#224', 
     fill: true,  // fill under the line, 
     fillAndStroke: true,  // *stroke a line at top of fill area. 
     fillColor: '#66CCCC',  // *custom fill color for filled lines (default is line color). 
     fillAlpha: 0.2,  // *custom alpha to apply to fillColor. 
     markerRenderer: $.jqplot.MarkerRenderer, // renderer to use to draw the data 
     // point markers. 
     markerOptions: { 
      show: false,    // wether to show data point markers. 
      style: 'filledCircle', // circle, diamond, square, filledCircle. 
      // filledDiamond or filledSquare. 
      lineWidth: 2,  // width of the stroke drawing the marker. 
      size: 9,   // size (diameter, edge length, etc.) of the marker. 
      color: '#FFFF00', // color of marker, set to color of line by default. 
      shadow: true,  // wether to draw shadow on marker or not. 
      shadowAngle: 45, // angle of the shadow. Clockwise from x axis. 
      shadowOffset: 1, // offset from the line of the shadow, 
      shadowDepth: 3,  // Number of strokes to make when drawing shadow. Each stroke 
      // offset by shadowOffset from the last. 
      shadowAlpha: 0.07 // Opacity of the shadow 
     }, 
     trendline: { 
      show: false,   // show the trend line 
      color: '#666666', // CSS color spec for the trend line. 
      label: '',   // label for the trend line. 
      type: 'linear',  // 'linear', 'exponential' or 'exp' 
      shadow: true,  // show the trend line shadow. 
      lineWidth: 1.5,  // width of the trend line. 
      shadowAngle: 45, // angle of the shadow. Clockwise from x axis. 
      shadowOffset: 1.5, // offset from the line of the shadow. 
      shadowDepth: 3,  // Number of strokes to make when drawing shadow. 
      // Each stroke offset by shadowOffset from the last. 
      shadowAlpha: 0.07 // Opacity of the shadow 
     } 
    }, 
    grid: { 
     drawGridLines: true,  // wether to draw lines across the grid or not. 
     gridLineColor: '#d0d0d0', // *Color of the grid lines. 
     background: '#ffffff',  // CSS color spec for background color of grid. 
     borderColor: '#ffffff',  // CSS color spec for border around grid. 
     borderWidth: 2.0,   // pixel width of border around grid. 
     shadow: true,    // draw a shadow for grid. 
     shadowAngle: 45,   // angle of the shadow. Clockwise from x axis. 
     shadowOffset: 1.5,   // offset from the line of the shadow. 
     shadowWidth: 3,    // width of the stroke for the shadow. 
     shadowDepth: 3,    // Number of strokes to make when drawing shadow. 
     // Each stroke offset by shadowOffset from the last. 
     shadowAlpha: 0.07,   // Opacity of the shadow 
     renderer: $.jqplot.CanvasGridRenderer, // renderer to use to draw the grid. 
     rendererOptions: {}   // options to pass to the renderer. Note, the default 
     // CanvasGridRenderer takes no additional options. 
    }, 
    axes: { 
     xaxis: { 
      renderer:$.jqplot.DateAxisRenderer, 
      rendererOptions:{tickRenderer:$.jqplot.CanvasAxisTickRenderer}, 
      tickOptions:{ 
       formatString:'%b %#d,%y' 

      } 
     }, 
     yaxis: {  
      labelRenderer: $.jqplot.CanvasAxisLabelRenderer, 
      borderColor:'#808080', 
      renderer: $.jqplot.LogAxisRenderer, 
      autoscale:true, 
      min:0, 
      tickOptions:{formatString:'$%.2f'} 
     } 
    }, 
    highlighter: { 
     show:true, 
     sizeAdjust: 7.5 
    }, 
    cursor:{zoom:true, showTooltip:true}, 
    legend:{show:false} 
}; 
+1

Sarebbe interessante vedere il codice ... –

+0

la sua facile creare, basta afferrare un semplice grafico, impostare "riempimento: true" in default serie, aggiungere di controllo zoom, e vedrete cosa intendo .. Pubblicherò il codice in poche ore, sono tornato dal mio posto di lavoro ... – Shrinath

risposta

25

C'è stato un cambiamento nella versione jqueryplot 0.9.7-546 e più tardi che ha aggiunto un paio di nuove proprietà per la serie:

seriesDefaults: { 
    rendererOptions: { 
     highlightMouseOver: true, 
     highlightMouseDown: false, 
     highlightColor: null, 
    }, 
}, 

Se si imposta highlightMouseOver a false, questo va via.

More details are available in the source code for the line renderer

+0

Grazie Sean :) Sono contento che qualcuno abbia finalmente pubblicato qualcosa che funzioni in questa discussione :) Ho passato attraverso i file sorgente di jqplot, ma non ho trovato nulla lì, oltre a dover modificare le loro funzioni di tracciamento ... – Shrinath

+0

Grazie mille per l'informazione Sean, sembra funzionare molto bene. – zenzelezz

+2

Sì, mi ci è voluto un po 'per capire, ma dal momento che ho visto diverse domande su di esso senza risposte ho deciso di scavare un po'. Ho scaricato circa una dozzina di versioni e ho provato a isolare da dove ha iniziato questo comportamento, quindi ho fatto una differenza tra le versioni. Sfortunatamente, ciò ha portato a una diffusione di oltre 3.000 righe, ma dopo una falsa partenza sono riuscito a trovare il cambiamento cercando quella diff. –

Problemi correlati