Scatter chart with square grid

48 views
Skip to first unread message

Yehonathan Sharvit

unread,
Jun 30, 2014, 6:08:13 AM6/30/14
to google-visua...@googlegroups.com, Raphael Boukara, Philippe Cohen
I would like to draw a scatter chart with grid lines in both the vertical and horizontal axis.

The composed grid must be squared not like in the attached file.

The challenges are:
1. the number of grids in the horizontal and vertical axis are dynamic.
2. the grid must stay squared when the window is resized

Any ideas?

graph.png

Andrew Gallant

unread,
Jun 30, 2014, 2:06:39 PM6/30/14
to google-visua...@googlegroups.com, raphael...@gmail.com, ph...@audyx.com
I gave some hints on how to do this over in this thread.

Yehonathan Sharvit

unread,
Jul 1, 2014, 3:59:48 AM7/1/14
to google-visua...@googlegroups.com
Andrew, my problem is that I don’t know how to manage the window size change.
Could you help on it?


--
You received this message because you are subscribed to a topic in the Google Groups "Google Visualization API" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/google-visualization-api/WKb231geS1o/unsubscribe.
To unsubscribe from this group and all its topics, send an email to google-visualizati...@googlegroups.com.
To post to this group, send email to google-visua...@googlegroups.com.
Visit this group at http://groups.google.com/group/google-visualization-api.
For more options, visit https://groups.google.com/d/optout.



--
"Are we what we become or do we become what we are?" - Prof. Beno Gross

Andrew Gallant

unread,
Jul 1, 2014, 9:39:27 AM7/1/14
to google-visua...@googlegroups.com
Do you mean that you don't know how to handle resizing, or that you don't know how to make the square grids after resizing?


On Tuesday, July 1, 2014 3:59:48 AM UTC-4, Yehonathan Sharvit wrote:
Andrew, my problem is that I don’t know how to manage the window size change.
Could you help on it?
On Mon, Jun 30, 2014 at 9:06 PM, Andrew Gallant <asgall...@gmail.com> wrote:
I gave some hints on how to do this over in this thread.


On Monday, June 30, 2014 6:08:13 AM UTC-4, Yehonathan Sharvit wrote:
I would like to draw a scatter chart with grid lines in both the vertical and horizontal axis.

The composed grid must be squared not like in the attached file.

The challenges are:
1. the number of grids in the horizontal and vertical axis are dynamic.
2. the grid must stay squared when the window is resized

Any ideas?

--
You received this message because you are subscribed to a topic in the Google Groups "Google Visualization API" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/google-visualization-api/WKb231geS1o/unsubscribe.
To unsubscribe from this group and all its topics, send an email to google-visualization-api+unsub...@googlegroups.com.

To post to this group, send email to google-visua...@googlegroups.com.
Visit this group at http://groups.google.com/group/google-visualization-api.
For more options, visit https://groups.google.com/d/optout.

Yehonathan Sharvit

unread,
Jul 1, 2014, 9:41:36 AM7/1/14
to google-visua...@googlegroups.com
I don’t know how to handle resizing in a clean way.
My app is responsive app, so the width of the graph is dynamic.
For the moment, I am listening to window resize event and I recalculate the height according to the new width?
To unsubscribe from this group and all its topics, send an email to google-visualizati...@googlegroups.com.

Andrew Gallant

unread,
Jul 1, 2014, 9:52:25 AM7/1/14
to google-visua...@googlegroups.com
Yes, that is exactly what you have to do to resize the chart, and then use the new dimensions to set the chart options to make the grids square.

Yehonathan Sharvit

unread,
Jul 1, 2014, 9:54:07 AM7/1/14
to google-visua...@googlegroups.com
Do you think it is reasonable to expect google charts to handle it automatically for scatter charts?
To unsubscribe from this group and all its topics, send an email to google-visualizati...@googlegroups.com.

Andrew Gallant

unread,
Jul 1, 2014, 10:41:59 AM7/1/14
to google-visua...@googlegroups.com
That option exists for GeoCharts because the maps from Google have a specific aspect ratio; changing it would distort the image.  Other charts, however, do not have a default aspect ratio.  It might be worth investigating the possibility of supporting an option to specify an aspect ratio instead of the height and width options (or more likely, specify height or width and an aspect ratio, and have the chart calculate the other dimension for you).  Feel free to file a feature request for this.
Reply all
Reply to author
Forward
0 new messages