Graph line resets to 0

13 views
Skip to first unread message

Daniel Saxil-Nielsen

unread,
Sep 30, 2011, 5:14:00 AM9/30/11
to Google Visualization API
Hi,

My line chart is on a scale of 0 to 10, however when all my points are
0 the line resets to the horizontal middle of the chart. I can't seem
to make it stay on the bottom. Here's my set up:

Any help would be greatly appreciated.

width: 85,
height: 30,
backgroundColor: '#FFFFFF',
axisTitlesPosition: 'none',
legend: 'none',
vAxis: {
textPosition: 'none',
gridlineColor: '#FFFFFF',
baseline: 0,
minValue: 0,
maxValue: 10,
baselineColor: '#FFFFFF',
viewWindowMode: 'maximized'
},
hAxis: {
textPosition: 'none',
gridlineColor: '#FFFFFF',
maxAlternation: 0,
baselineColor: '#FFFFFF',
viewWindowMode: 'maximized'
},
chartArea: {
left: 0,
right: 0,
top: 0,
bottom: 0,
width: 85,
height: 30
},
colors: ['#2C2B33'],
enableInteractivity: false,
lineWidth: 1

asgallant

unread,
Sep 30, 2011, 9:20:29 AM9/30/11
to google-visua...@googlegroups.com
The issue is the viewWindowMode option.  When set to 'maximized' it tries to set up the chart with the maximum and minimum values touching the top and bottom of the chart area.  If all values are the same, however, it cannot do so.  Try this instead:

vAxis{
    textPosition'none',
    gridlineColor'#FFFFFF',
    baseline0,
    minValue0,
    maxValue10,
    baselineColor'#FFFFFF',
    viewWindow{
        min0,
        max10
    }
}


Incidentally, the viewWindowMode option is not used for hAxis in Line Charts.

dtsn

unread,
Sep 30, 2011, 12:26:40 PM9/30/11
to google-visua...@googlegroups.com
 That works great. Thanks very much for your help!
Reply all
Reply to author
Forward
0 new messages