Why dont all the options apply?

103 views
Skip to first unread message

Oliver Kilk

unread,
Mar 27, 2012, 3:25:58 PM3/27/12
to Google Visualization API
<---
var options = {title: 'Keskmine kütusehind Eestis',
height: 260,
backgroundColor: {
stroke: 'black',
fill: '#D6D6D6'},
hAxis: {
gridlines: {
count: 10}}
};
var chart = new
google.visualization.LineChart(document.getElementById('chart_div'));
chart.draw(data,options);
}
--->

My concern is that only options that apply to my chart is 'fill' and
'height'.
Data is described here:
<---
data.addColumn('date', 'Kuupäev');
data.addColumn('number', 'Bensiin 95');
data.addColumn('number', 'Bensiin 98');
data.addColumn('number', 'Diisel');
--->

Numbers and dates should be.

asgallant

unread,
Mar 27, 2012, 4:12:19 PM3/27/12
to google-visua...@googlegroups.com
They work when I tried them:  http://jsfiddle.net/JURx7/1/ 

Are you using the 'corechart' package or the 'linechart' package?  'linechart' is deprecated and does not support all of these options.

Oliver Kilk

unread,
Mar 27, 2012, 5:08:05 PM3/27/12
to Google Visualization API
Yes, Im using corechart.
http://www.liiter.ee/beta/uus/index_beta.html 


--
You received this message because you are subscribed to the Google Groups "Google Visualization API" group.
To post to this group, send email to google-visua...@googlegroups.com.
To unsubscribe from this group, send email to google-visualizati...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-visualization-api?hl=en.




--
 
Tervitades,

Oliver Kilk
olive...@gmail.com

asgallant

unread,
Mar 28, 2012, 9:53:16 AM3/28/12
to google-visua...@googlegroups.com
Ok, you need to set the backgroundColor.strokeWidth to some non-zero value (it defaults to 0) - this will cause the border to appear.  The gridlines are being affected by the axis labels (I don't know why), you can get them to work by formatting the axis labels to use shorter text:

hAxis: {
    gridlines: {
        count: 10
    },
    format: 'MMM yyyy'
}

I copied your code (minus Facebook and Google Analytics JS) over to jsfiddle and added the new options so they work: http://jsfiddle.net/bGW6Z/ 
Reply all
Reply to author
Forward
0 new messages