Line Chart: hAxis settings not working?

370 views
Skip to first unread message

GC Proxy

unread,
Nov 2, 2016, 5:00:49 PM11/2/16
to Google Visualization API
I'm specifically trying to make a bode plot with a log xAxis, however no matter what settings I set for 'hAxis', nothing seems to take effect. I can't set title, log scale... nothing.

I also noted that in the documentation here the entry for 'scaleType' gave an example where 'logScale' was 'logscale' so I tried that too. None of these settings seems to get me a log graph though.
I tried this with vAxis as well to no avail.

var options = {
chart: {
title: 'Totally Awesome Graph',
subtitle: 'Check it out!',
},
width: 500,
height: 500,
hAxis: { logscale: true, logScale: true, scaleType: 'log' }
};

var chart = new google.charts.Line(document.getElementById('chart'));
chart.draw($scope.graphData, options);

The data is created from a text file, and each data row is of type 'number', so the graph SHOULD be continuous.

Daniel LaLiberte

unread,
Nov 2, 2016, 5:06:02 PM11/2/16
to Google Visualization API
Be careful not to mix up the material charts with the non-material charts.  They have different options.  google.charts.Line is a material chart.  google.visualization.LineChart is the non-material chart.  You would also have to use convertOptions() with the material chart options.


--
You received this message because you are subscribed to the Google Groups "Google Visualization API" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-visualization-api+unsub...@googlegroups.com.
To post to this group, send email to google-visualization-api@googlegroups.com.
Visit this group at https://groups.google.com/group/google-visualization-api.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-visualization-api/5dd457de-99ed-4e00-8970-f0820a91bcc1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--

GC Proxy

unread,
Nov 2, 2016, 5:28:49 PM11/2/16
to Google Visualization API
Then how do I make a Material Line Graph into a log graph? I'm not seeing on the doc page that the configuration would be different here so this is very confusing.


On Wednesday, November 2, 2016 at 2:06:02 PM UTC-7, Daniel LaLiberte wrote:
Be careful not to mix up the material charts with the non-material charts.  They have different options.  google.charts.Line is a material chart.  google.visualization.LineChart is the non-material chart.  You would also have to use convertOptions() with the material chart options.

On Wed, Nov 2, 2016 at 5:00 PM, GC Proxy <crave...@gmail.com> wrote:
I'm specifically trying to make a bode plot with a log xAxis, however no matter what settings I set for 'hAxis', nothing seems to take effect. I can't set title, log scale... nothing.

I also noted that in the documentation here the entry for 'scaleType' gave an example where 'logScale' was 'logscale' so I tried that too. None of these settings seems to get me a log graph though.
I tried this with vAxis as well to no avail.

var options = {
chart: {
title: 'Totally Awesome Graph',
subtitle: 'Check it out!',
},
width: 500,
height: 500,
hAxis: { logscale: true, logScale: true, scaleType: 'log' }
};

var chart = new google.charts.Line(document.getElementById('chart'));
chart.draw($scope.graphData, options);

The data is created from a text file, and each data row is of type 'number', so the graph SHOULD be continuous.

--
You received this message because you are subscribed to the Google Groups "Google Visualization API" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-visualization-api+unsub...@googlegroups.com.
To post to this group, send email to google-visua...@googlegroups.com.



--

GC Proxy

unread,
Nov 2, 2016, 5:36:04 PM11/2/16
to Google Visualization API
I changed the draw call to this:
chart.draw($scope.graphData, google.charts.Line.convertOptions(options));
 using the options from before, however there was no change.

GC Proxy

unread,
Nov 2, 2016, 5:48:57 PM11/2/16
to Google Visualization API
It does seem to have picked the setting for title color to Red. However it's still not showing in log scale.

GC Proxy

unread,
Nov 2, 2016, 7:13:07 PM11/2/16
to Google Visualization API
Well in any case I'll move to classic for now. I've got it working on classic, but it's a shame I can't get the material version to work.

Thanks for the help.

Daniel LaLiberte

unread,
Nov 3, 2016, 11:16:41 AM11/3/16
to Google Visualization API
The material charts don't support log scale yet, and many other options.  

There is a theme: 'material' option which will change the default colors and fonts.

On Wed, Nov 2, 2016 at 7:13 PM, GC Proxy <crave...@gmail.com> wrote:
Well in any case I'll move to classic for now. I've got it working on classic, but it's a shame I can't get the material version to work.

Thanks for the help.

--
You received this message because you are subscribed to the Google Groups "Google Visualization API" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-visualization-api+unsub...@googlegroups.com.
To post to this group, send email to google-visualization-api@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--
Reply all
Reply to author
Forward
0 new messages