2014-06-20 14 views
5

Google grafiklerine nispeten yeni geldim, lütfen cehaletimi affedin;Bir alan grafiğinin Dolgu ve Kontur rengini değiştirme?

Bölge Grafiği'ne bakıyorum ve Dolgu ve Kontur rengini değiştirmek istiyorum. İşte kodu ...

google grafikleri özelleştirmek için tam bir başvuru bulabilirsiniz Soruma diğer kısmı ise
<!-- 
You are free to copy and use this sample in accordance with the terms of the 
Apache license (http://www.apache.org/licenses/LICENSE-2.0.html) 
--> 

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> 
<html xmlns="http://www.w3.org/1999/xhtml"> 
    <head> 
     <meta http-equiv="content-type" content="text/html; charset=utf-8"/> 
     <title> 
      Google Visualization API Sample 
     </title> 
     <script type="text/javascript" src="//www.google.com/jsapi"></script> 
     <script type="text/javascript"> 
      google.load('visualization', '1', {packages: ['corechart']}); 
     </script> 
     <script type="text/javascript"> 

      function drawVisualization() { 
       // Some raw data (not necessarily accurate) 
       var data = google.visualization.arrayToDataTable([ 
        ['Month', 'Target'], 
        ['JAN', 85], 
        ['FEB', 105], 
        ['MAR', 65], 
        ['APR', 45], 
        ['MAY', 45], 
        ['JUN', 15], 
        ['JUL', 60] 
       ]); 

       // Create and draw the visualization. 
       var ac = new google.visualization.AreaChart(document.getElementById('visualization')); 
       ac.draw(data, { 
        title : '', 
        isStacked: true, 
        width: 600, 
        height: 400, 
        vAxis: {title: "Millions"}, 
        hAxis: {title: "Month"} 
       }); 
      } 

      google.setOnLoadCallback(drawVisualization); 
     </script> 
    </head> 
    <body style="font-family: Arial;border: 0 none;"> 
     <div id="visualization" style="width: 600px; height: 400px;"></div> 
    </body> 
</html> 

?

sayesinde

cevap

7

dolgu ve AreaChart her serinin strok renk serisi renk ile tespit edilir.

colors: ['#f36daa', 'blue', '#3fc26b'] 
: Sen (sütun sırayla veri serisine atanan HTML renk dize dizisi alır) colors seçeneği ayarlayarak veya bir HTML renk dize alır series.<series index>.color seçeneğiyle (aracılığıyla veri serisinin rengini ayarlayabilirsiniz

ya:

series: { 
    0: { 
     // set options for the first data series 
     color: '#f36daa' 
    }, 
    1: { 
     // set options for the second data series 
     color: 'red' 
    }, 
    2: { 
     // set options for the third data series 
     color: '#3fc26b' 
    } 
} 

Grafik seçenekleri (çoğunlukla) belirli grafik için belgelerinde belgelenmiştir. (örn: AreaChart) birden çok grafik yayılan bazı özellikler (ayrı belgelenmiştir örn: Intervals, Trendlines, Dashboards and Controls, Event Handlers, Animations). Veri yapıları, veri işleme, biçimlendirme ve ilişkili sınıflar, API Reference'da belgelenmiştir.

İlgili konular