Remove blank space above and below Google Charts horizontal column chart

Technoh

I am show graphs from Google Charts, using a horizontal column chart. I want to remove the blank space above and below the graph.

Here is the code called (some info removed due to NDA):

google.load("visualization", "1", {packages:["corechart"]});
google.setOnLoadCallback(drawChart);

function drawChart() {
    var data = google.visualization.arrayToDataTable([
        [null, "...","...","...","...","...","...","...","...","Total Average"],
        [null, 100,100,100,100,100,88.89,100,100,98.70]
    ]);

    var options = {
        height: 540,
        title: 'Title here',
        vAxis: { textPosition: 'none', viewWindowMode: 'maximized' },
        colors:["#0B0842","#ADAEAE","#BE3351","#498101","#0D80CA","#A3C116","#91A96B","#E8F72B","#424242"],
        hAxis: { textPosition: 'none', minValue: 0, maxValue: 100 },
        chartArea: { left: 0, width: "78%" },
    };

    var chart = new google.visualization.BarChart(document.getElementById('chart_div'));
    chart.draw(data, options);
}

Sample graph

asgallant

The space above and below the bars is normally there to separate bar groups when you have multiple rows of data. If you don't want that space, then you can set the bar.groupWidth option in your chart to a larger percentage (up to 100%; default is the golden ratio, roughly 61.8%):

var options = {
    height: 540,
    title: 'Title here',
    vAxis: { textPosition: 'none', viewWindowMode: 'maximized' },
    colors:["#0B0842","#ADAEAE","#BE3351","#498101","#0D80CA","#A3C116","#91A96B","#E8F72B","#424242"],
    hAxis: { textPosition: 'none', minValue: 0, maxValue: 100 },
    chartArea: { left: 0, width: "78%" },
    bar: {groupWidth: '100%'}
};

이 기사는 인터넷에서 수집됩니다. 재 인쇄 할 때 출처를 알려주십시오.

침해가 발생한 경우 연락 주시기 바랍니다[email protected] 삭제

에서 수정
0

몇 마디 만하겠습니다

0리뷰
로그인참여 후 검토

관련 기사

분류에서Dev

Remove rows from Dataframe where row above or below has same value in a specific column

분류에서Dev

Google Charts remove white border around vAxis textPosition 'in' text on Bar Chart

분류에서Dev

How to change section color of a stacked bar chart in Google Charts API?

분류에서Dev

white space below footer

분류에서Dev

Google Column Chart change color for each column with json

분류에서Dev

Google Column Chart change color for each column with json

분류에서Dev

Remove words (letters followed by space) from a specific column

분류에서Dev

how do i remove the space at at the end of the column header?

분류에서Dev

Google Charts - How to stretch x axis over chart's full width

분류에서Dev

vAxis : {slantedText : true}는 Bar Chart [Google Charts]에서 가능합니까?

분류에서Dev

How can I draw an additional horizontal grid line with a specific value in Google Bar chart (Not average value)

분류에서Dev

Calculated text column for Google Line Chart x-axis not working

분류에서Dev

How to remove Pie Charts from Google Maps API V3 on this example?

분류에서Dev

Dynamically extended chart, horizontal data

분류에서Dev

Google Charts API CalendarChart

분류에서Dev

Google Charts - BoxPlot

분류에서Dev

Google Charts mysql PHP

분류에서Dev

Charts.Chart를 Google Sheet에 삽입하는 방법 (스크립트 앱)

분류에서Dev

JSP JSON with Google Charts - Line Charts

분류에서Dev

column width not controlled by row above it

분류에서Dev

Remove shadow below actionbar FragmentActivity

분류에서Dev

Matplotlib ax.fill_between fills above, instead of below

분류에서Dev

Horizontal bar chart y axis alignment

분류에서Dev

Unwanted blank space generated at the end of page

분류에서Dev

Deleting all cells in row after blank space

분류에서Dev

Notepad++ Regex - Replace a blank space in dates

분류에서Dev

Add and number blank line above each line in a file

분류에서Dev

Google charts are not showing in Snappy PDF

분류에서Dev

Google Charts json data not loading

Related 관련 기사

  1. 1

    Remove rows from Dataframe where row above or below has same value in a specific column

  2. 2

    Google Charts remove white border around vAxis textPosition 'in' text on Bar Chart

  3. 3

    How to change section color of a stacked bar chart in Google Charts API?

  4. 4

    white space below footer

  5. 5

    Google Column Chart change color for each column with json

  6. 6

    Google Column Chart change color for each column with json

  7. 7

    Remove words (letters followed by space) from a specific column

  8. 8

    how do i remove the space at at the end of the column header?

  9. 9

    Google Charts - How to stretch x axis over chart's full width

  10. 10

    vAxis : {slantedText : true}는 Bar Chart [Google Charts]에서 가능합니까?

  11. 11

    How can I draw an additional horizontal grid line with a specific value in Google Bar chart (Not average value)

  12. 12

    Calculated text column for Google Line Chart x-axis not working

  13. 13

    How to remove Pie Charts from Google Maps API V3 on this example?

  14. 14

    Dynamically extended chart, horizontal data

  15. 15

    Google Charts API CalendarChart

  16. 16

    Google Charts - BoxPlot

  17. 17

    Google Charts mysql PHP

  18. 18

    Charts.Chart를 Google Sheet에 삽입하는 방법 (스크립트 앱)

  19. 19

    JSP JSON with Google Charts - Line Charts

  20. 20

    column width not controlled by row above it

  21. 21

    Remove shadow below actionbar FragmentActivity

  22. 22

    Matplotlib ax.fill_between fills above, instead of below

  23. 23

    Horizontal bar chart y axis alignment

  24. 24

    Unwanted blank space generated at the end of page

  25. 25

    Deleting all cells in row after blank space

  26. 26

    Notepad++ Regex - Replace a blank space in dates

  27. 27

    Add and number blank line above each line in a file

  28. 28

    Google charts are not showing in Snappy PDF

  29. 29

    Google Charts json data not loading

뜨겁다태그

보관