Slightly move the data point in combo chart

21 views
Skip to first unread message

Ning Zhang

unread,
Apr 9, 2017, 3:46:52 AM4/9/17
to Google Visualization API



Hi as in this above shot I am using a combo char to compare between two years values by quarter.

However, I have one other value to be compared with the later year's value also. But with the same quarter number, that dot will appear in the center of the two bars instead of in the mid of that second bar. Is it possible to slightly move that dot to the right?

Daniel LaLiberte

unread,
Apr 9, 2017, 2:21:07 PM4/9/17
to Google Visualization API
We should have an option to omit columns that have no value, rather than leave space for them.  Sometimes you want it one way, and sometimes the other, so there should be an option.

If you only have one series to show as columns, then yes, it should be centered around the domain value, but it sounds like you have two series as columns, and one other series that you want to be a point that is centered in the second of the columns.  That will be different from what I suggested above, since you ALWAYS want the point centered in the second column, whether or not there is a first column.   I'm actually not sure what will happen, but you could try using an interval for this comparison point.

--
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/82f786a2-6830-405e-bc94-d4d1412f5757%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--

Ning Zhang

unread,
Apr 9, 2017, 6:32:22 PM4/9/17
to google-visua...@googlegroups.com
Thanks for the answer! Could you explain a bit more on "using an interval for this comparison point." ?

In my case the haxis labels are set to be "Q1", "Q2", "Q3", "Q4" 4 string values. Do you mean to play some trick with the domain interval instead?

Ning 

On Sun, Apr 9, 2017 at 11:21 AM, 'Daniel LaLiberte' via Google Visualization API <google-visua...@googlegroups.com> wrote:
We should have an option to omit columns that have no value, rather than leave space for them.  Sometimes you want it one way, and sometimes the other, so there should be an option.

If you only have one series to show as columns, then yes, it should be centered around the domain value, but it sounds like you have two series as columns, and one other series that you want to be a point that is centered in the second of the columns.  That will be different from what I suggested above, since you ALWAYS want the point centered in the second column, whether or not there is a first column.   I'm actually not sure what will happen, but you could try using an interval for this comparison point.
On Sun, Apr 9, 2017 at 3:46 AM, 'Ning Zhang' via Google Visualization API <google-visualization-api@googlegroups.com> wrote:



Hi as in this above shot I am using a combo char to compare between two years values by quarter.

However, I have one other value to be compared with the later year's value also. But with the same quarter number, that dot will appear in the center of the two bars instead of in the mid of that second bar. Is it possible to slightly move that dot to the right?

--
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+unsubscr...@googlegroups.com.



--

--
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/-UXpsy_07yI/unsubscribe.
To unsubscribe from this group and all its topics, send an email to google-visualization-api+unsub...@googlegroups.com.

Daniel LaLiberte

unread,
Apr 9, 2017, 6:48:43 PM4/9/17
to Google Visualization API
I mean you could use the 'interval' role.  https://developers.google.com/chart/interactive/docs/gallery/intervals#point-intervals

Here is an example.  It does position the points centered in the column:  https://jsfiddle.net/3u8m6qcv/

But there is no interaction with interval points, unfortunately.  No tooltips or annotations, even.

On Sun, Apr 9, 2017 at 6:32 PM, 'Ning Zhang' via Google Visualization API <google-visua...@googlegroups.com> wrote:
Thanks for the answer! Could you explain a bit more on "using an interval for this comparison point." ?

In my case the haxis labels are set to be "Q1", "Q2", "Q3", "Q4" 4 string values. Do you mean to play some trick with the domain interval instead?

Ning 
On Sun, Apr 9, 2017 at 11:21 AM, 'Daniel LaLiberte' via Google Visualization API <google-visualization-api@googlegroups.com> wrote:
We should have an option to omit columns that have no value, rather than leave space for them.  Sometimes you want it one way, and sometimes the other, so there should be an option.

If you only have one series to show as columns, then yes, it should be centered around the domain value, but it sounds like you have two series as columns, and one other series that you want to be a point that is centered in the second of the columns.  That will be different from what I suggested above, since you ALWAYS want the point centered in the second column, whether or not there is a first column.   I'm actually not sure what will happen, but you could try using an interval for this comparison point.

On Sun, Apr 9, 2017 at 3:46 AM, 'Ning Zhang' via Google Visualization API <google-visualization-api@googlegroups.com> wrote:



Hi as in this above shot I am using a combo char to compare between two years values by quarter.

However, I have one other value to be compared with the later year's value also. But with the same quarter number, that dot will appear in the center of the two bars instead of in the mid of that second bar. Is it possible to slightly move that dot to the right?

--
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+unsubscr...@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/82f786a2-6830-405e-bc94-d4d1412f5757%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--

--
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/-UXpsy_07yI/unsubscribe.
To unsubscribe from this group and all its topics, send an email to google-visualization-api+unsubscr...@googlegroups.com.

--
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.

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

Ning Zhang

unread,
Apr 10, 2017, 8:22:03 PM4/10/17
to google-visua...@googlegroups.com
Got the trick and it works without problem! Thanks for sharing!

Ning

On Sun, Apr 9, 2017 at 3:48 PM, 'Daniel LaLiberte' via Google Visualization API <google-visua...@googlegroups.com> wrote:
I mean you could use the 'interval' role.  https://developers.google.com/chart/interactive/docs/gallery/intervals#point-intervals

Here is an example.  It does position the points centered in the column:  https://jsfiddle.net/3u8m6qcv/

But there is no interaction with interval points, unfortunately.  No tooltips or annotations, even.



--

--
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/-UXpsy_07yI/unsubscribe.
To unsubscribe from this group and all its topics, send an email to google-visualization-api+unsub...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages