Column chart - column with two values

90 views
Skip to first unread message

Arthur Shvetsov

unread,
Dec 20, 2012, 4:02:27 AM12/20/12
to google-visua...@googlegroups.com
Hi, guys!

How can I display two different values for a single column in column chart on left and right vAxis?
For example, I have a single column 'user' and I need to show his number of emails on left vAxis, and number of activities on right vAxis.
I know, that i can create two seperate columns and map each of them to specific axis, but it's not a solution for me..

Thanks!

Sergey Grabkovsky

unread,
Dec 20, 2012, 9:40:25 AM12/20/12
to google-visua...@googlegroups.com
Hi, the way you're phrasing this doesn't really make sense. Axes have to have a consistent scale, and while you can make one column seemingly have multiple values, that'll be more difficult to visualize with multiple columns. Take the following example:
User1 has 20 emails, and 30 activities
User2 has 21 emails, and 22 activities
There is no way (visually) that you can make both users only have one column and have each of those columns align with the right numbers on the axes. However, if you're willing to forego the requirement of only one column and two axes, I think your chart would look great as a stacked column chart with only one axis.

- Sergey



--
You received this message because you are subscribed to the Google Groups "Google Visualization API" group.
To view this discussion on the web visit https://groups.google.com/d/msg/google-visualization-api/-/LUypiS8msqQJ.
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.

asgallant

unread,
Dec 20, 2012, 2:11:14 PM12/20/12
to google-visua...@googlegroups.com
To get a "perfect" solution to the problem is an O(n^3) algorithm: find the perfect combination of gridline count, left-axis max value, and right-axis max value that results in (emails / maxEmails) = (activities / maxActivities), such that both (maxEmails / (gridline count - 1)) and (maxActivities / (gridline count - 1)) are integers.  Worse yet, the problem may not have a solution at all.

If you are willing to toss out the gridlines on one of the axes, it becomes easier to solve by several orders of magnitude.  Here's an example: http://jsfiddle.net/asgallant/77Vs2/

Note that as Sergey said, this will not work at all if you have multiple users (except perhaps by coincidence).
Reply all
Reply to author
Forward
0 new messages