Missing support for "invisible guides" (data lines on top of bar charts)?

10 views
Skip to first unread message

m4rc0

unread,
Jul 10, 2009, 7:42:41 AM7/10/09
to Python Google Chart
First of all, great job!

I noticed that "inivisible guides" (http://code.google.com/apis/chart/
styles.html#line_styles, scroll down to the second set of examples
with chm=D) are not properly supported through add_data_line.
(Possibly amongst other things,) this is supposed to add a data line
to a bar chart.

However, data generation in SimpleData, TextData, and ExtendedData
would need to adjust the number of data series included in the actual
data for this to work. For example, if one adds two data series
through add_data and the second one is used as the guide (e.g.,
chart.add_data_line("FF0000", 1, 2, 1)), then the data classes would
need to return:

return 'chd=s1:' + ','.join(encoded_data) # '1' added

where '1' is the number of data series added (2 in this case) minus 1.
However, as the code (and Google's underlying API call?) allows data
series at any index to be marked through add_data_line, I'm not quite
sure yet how Google's API would separate out the invisible guide, if
it's not the last data series added (the '1' above is just the
*number* of data series used as actual [bar] chart data series).

Possible temporary solution (with the above assumption of the guide
being the last data series added): Preserve the inivisible_guide_idx
in add_data_line and account for it in the [X]Data classes.

But maybe I have yet to learn the hidden secrets how to add a data
line to a bar chart through this otherwise quite useful library.

Thanks,
Marco
Reply all
Reply to author
Forward
0 new messages