Questions about bar chart options values size and types.

24 views
Skip to first unread message

noobamtis

unread,
Jan 2, 2020, 3:07:38 AM1/2/20
to Google Visualization API

Good morning everyone,


I have a problem about the size of bar chart values. The x values goes like 0,5,10,15,20,23 five by five but I want it to be like 0,1,2,3 one by one.


Another issue is, I want y values to be shown on top of each bar. If 23th bar's value is 10 it must be shown on the top of 23th bar because people should easily see the chart values from the distant.


My the other question is I want to enlarge the size of x and y values of chart but I could only enlarge labels. I couldn't find the right option.


My last problem about legend. If legend is on the right side, the chart is getting smaller but I can't move legend to top or bottom. Even in the code says legend bottom it shows on the right.


Screenshot from 2020-01-02 11-04-05.png


<div class="row">
   
<div class="col-md-4">

   
<div id="palochart" style="width: 1000px; height: 400px; " ></div>
   
</div>
</div>





function drawPaLoChart() {
    var data = [['Hours', 'Label1', 'Label2']];



    for (var i=0; i<pageload.length;i++){
        data.push([pageload[i][0], pageload[i][1], pageload[i][2] ]);
    }

    var data = google.visualization.arrayToDataTable(data);


    var options = {

     'fontSize': 30,

        chart: {

            'width': 600,

            title: 'Hourly Page Load Times',


        },

            legend: { position: 'bottom' },


            bar: { groupWidth: "100%" },
            backgroundColor: {fill: 'transparent'},
            chartArea: {
                backgroundColor: 'transparent'

            },
        'tooltipFontSize':22






    };

    var chart = new google.charts.Bar(document.getElementById('palochart'));

    chart.draw(data, google.charts.Bar.convertOptions(options));
}



Reply all
Reply to author
Forward
0 new messages