2014-01-13 2 views
0

Я стараюсь, чтобы градиенты отображались на мою ось y. У меня есть минимум 90 и максимум 150. Я хочу, чтобы желтый градиент сверху вниз до 120, и я хочу, чтобы он был согласован между браузерами. Я могу сделать это? Вот мой код:Градиенты карты Highcharts для оси Y?

$('#ao_vs_ppv').highcharts({ 
          chart: { 
            backgroundColor: 
            { 
              linearGradient: [0, 215, 0, 220], 
              stops: [ 
                [0, 'rgb(255,255,50)'], 
                [1, 'rgb(255,255,255)'] 
              ] 
            }, 
            type: 'scatter' 
          }, 
          title: { 
            text: 'Air Overpressure Vs. Peak Particle Velocity' 
          }, 
          xAxis: { 
            min: .010, 
            max: 10, 
            type: 'logarithmic', 
            title: { 
              text: "Peak Particle Velocuty (in/sec)" 
            }, 
            labels: { 
              overflow: 'justify'     
            }, 
            tickmarkPlacement: 'on', 
            gridLineWidth: 1 
          }, 
          yAxis: { 
            min: 90, 
            max: 150, 
            title: { 
              text: 'Air Overpressure (dBL)' 
            }, 
            tickInterval:10, 
            labels: { 
              overflow: 'justify'       
            } 
          }, 
          plotOptions: { 
            scatter: { 

              tooltip: { 
                headerFormat: '<b>{series.name}</b><br>', 
                pointFormat: 'AO: {point.y}dBL<br>PPV: {point.x}in/sec' 
              } 
            } 
          }, 
          legend: { 
            layout: 'horizontal', 
            borderWidth: 1, 
            backgroundColor: '#FFFFFF', 
            shadow: true 
          }, 
          series:formatHighChartsScatter(data[i]['x_data'],data[i]['y_data'], seismoNames) 
        }); 

ответ

1

Переход от backgroundColor к plotBackgroundColor, и формат использование объекта, а не пиксели, см: http://jsfiddle.net/92Nw8/1/

$('#ao_vs_ppv').highcharts({ 
    chart: { 
    plotBackgroundColor: { 
     linearGradient: { 
      x1: 0, 
      x2: 0, 
      y1: 1, 
      y2: 0 
     }, 
     stops: [ 
      [0, 'rgb(255,255,50)'], 
      [1, 'rgb(255,255,255)'] 
     ] 
    }, 
    type: 'scatter' 
    } 
} 
Смежные вопросы