I get it.  It works for now, but when you have it implemented across a 
wider variety of charts, I would suggest listing the CLI method under the 
chart, and then linking to the CLI object methods in the description.

On Wednesday, August 14, 2013 9:55:21 AM UTC-4, [email protected] wrote:
>
> Thanks for the suggestions!  I've clarified getHAxisValue/getVAxisValue as 
> you've suggested; that'll go live soon.
>
> On your second point, that getBoundingBox and friends are methods of 
> ChartLayoutInterface, rather than of the chart itself: love to fix that, 
> but I don't see a better way to present that information.  This is one of 
> those instances where there's a tradeoff between precision and simplicity, 
> and I opted for the latter.  I could ram that information into the leftmost 
> column, but that would be ugly. I could create a separate section later for 
> CLI methods, but that wouldn't help readers who start with the "Methods" 
> header and scan downwards to get a sense of what they can do with the 
> chart.  So I decided to obscure the parent class in the leftmost column and 
> clarify the usage in the rightmost column by saying either
>
> var cli = chart.getChartLayoutInterface();
>
> or 
>
> chart.getChartLayoutInterface()
>
> to give readers a self-contained usage example.
>
> Surely more detail than you wanted to know, but I just wanted to explain 
> why I made the decision I did.
>
> Jon
>
> On Tue, Aug 13, 2013 at 7:33 PM, asgallant 
> <[email protected]<javascript:>
> > wrote:
>
>> Sweeeeet!  It might help to clarify in the getHAxisValue/getVAxisValue 
>> methods that "position" is an offset from the chart container's left/top 
>> edge.  Also, organizationally, it should be made clear that the 
>> ChartLayoutInterface methods are methods of the CLI and not the chart (as 
>> is, the layout implies that these methods are all methods of the chart 
>> object).  The descriptions are clear enough, it's just a layout issue.
>>
>>
>> On Tuesday, August 13, 2013 12:54:27 PM UTC-4, [email protected] wrote:
>>
>>> Hi Drew, our team pays pretty close attention to your chart fantasies :-)
>>>
>>> We recently added documentation on getChartLayoutInterface(), **
>>> getBoundingBox(), and a few friends.  See, for example,
>>> https://developers.google.com/**chart/interactive/docs/**
>>> gallery/columnchart#Methods<https://developers.google.com/chart/interactive/docs/gallery/columnchart#Methods>
>>>
>>> Doesn't give you everything you want, and not all charts support them, 
>>> but it's a start!
>>>
>>> Jon
>>>
>>>
>>> On Tue, Aug 13, 2013 at 6:34 PM, asgallant <[email protected]>wrote:
>>>
>>>> Oh, and consider that super-wishlisty.  I'm sure you guys have much 
>>>> better things to do with the API than indulge my chart fantasies.
>>>>
>>>>
>>>> On Tuesday, August 13, 2013 12:31:43 PM UTC-4, asgallant wrote:
>>>>>
>>>>> I would love for there to be a way to pull metadata from the chart 
>>>>> about things like the axes, labels, element positions, and element sizes 
>>>>> (eg, where are the top and left edges of this bar, how wide is it, how 
>>>>> tall 
>>>>> is it?  What are the pixel coordinates of this point on a line?  What are 
>>>>> the axis tick marks, and what are their y-axis pixel coordinates?).  Some 
>>>>> of this information I can tease out of the SVG, but I don't like to do 
>>>>> that, knowing that updates to the API can make subtle changes in the SVG 
>>>>> structure that break the parsing code (not to mention the cross-browser 
>>>>> issues with trying to parse the same information out of VML).
>>>>>
>>>>> On Tuesday, August 13, 2013 12:18:09 PM UTC-4, Daniel LaLiberte wrote:
>>>>>>
>>>>>> Luke,
>>>>>>
>>>>>>  I can see that it would be useful to find out what the chart is 
>>>>>> doing so you can process things like the axis bounds in other contexts, 
>>>>>> but 
>>>>>> there is no way to do that currently, unless you query the generated 
>>>>>> display elements (which is generally not recommended).  We are thinking 
>>>>>> about ways to expose such information with a general capability, so we 
>>>>>> are 
>>>>>> open to suggestions.
>>>>>>
>>>>>> dan
>>>>>>
>>>>>>
>>>>>> On Mon, Aug 12, 2013 at 10:51 PM, Luke Bellamy <[email protected]
>>>>>> > wrote:
>>>>>>
>>>>>>> Daniel,
>>>>>>> Just wanted to throw out an idea. If I can programatically get the 
>>>>>>> min, max, interval values for the axis itself (not the data) that was 
>>>>>>> rendered, I could effectively give the image charts a "hint".
>>>>>>> So after the draw() method I could say, now give me the axis values 
>>>>>>> you are using. Then fire off my ajax request to generate the 
>>>>>>> corresponding 
>>>>>>> image charts.
>>>>>>>  
>>>>>>> I had a little play but could not see the method to get that 
>>>>>>> information from the 'google.visualization.**ComboCha**rt' object.
>>>>>>> Is it possible?
>>>>>>>  
>>>>>>> Thankyou,
>>>>>>> Luke
>>>>>>>  
>>>>>>>
>>>>>>> On Tuesday, August 13, 2013 9:59:01 AM UTC+10, Luke Bellamy wrote:
>>>>>>>
>>>>>>>> Hi,
>>>>>>>> I'm using google charts (basic combo chart) on a web site. Awesome, 
>>>>>>>> no problem with that. I wish to put this into a PDF. So what I did was 
>>>>>>>> using the deprecated image charts to generate an image using the same 
>>>>>>>> data 
>>>>>>>> and making them look the same. Works great.
>>>>>>>>  
>>>>>>>> My issue is that the vertical axis intervals, min, and max are not 
>>>>>>>> the same. I understand why and I prefer the 'pretty' axis scaling in 
>>>>>>>> google 
>>>>>>>> charts. So I thought I would come up with an algorithm myself using 
>>>>>>>> the min 
>>>>>>>> and max from the data to come up with the range and intervals. This is 
>>>>>>>> for 
>>>>>>>> the old image charts. Works very well, but in a couple of scenarios I 
>>>>>>>> can 
>>>>>>>> see it's not EXACTLY the same, although close. Note that these are 
>>>>>>>> very 
>>>>>>>> basic charts so I'm not doing anything fancy. It would just be nice if 
>>>>>>>> they 
>>>>>>>> looked identical.
>>>>>>>>  
>>>>>>>> My question is, can I find the axis range and interval algorithm 
>>>>>>>> from google charts somewhere? I did see the google visualization java 
>>>>>>>> code 
>>>>>>>> available but code not find what I was after.
>>>>>>>> Here is the basic bit of code I have been tweaking in JAVA for 
>>>>>>>> image charts to mirror the axis algorithm of google charts.
>>>>>>>>  
>>>>>>>> // Take the Max/Min of all data values in all graphs
>>>>>>>> var totalMax = 345;
>>>>>>>> var totalMin = -123;
>>>>>>>>
>>>>>>>> // Figure out the largest number (positive or negative)
>>>>>>>> var biggestNumber = Math.max(Math.abs(totalMax),**Ma****
>>>>>>>> th.abs(totalMin));
>>>>>>>>
>>>>>>>> // Round to an exponent of 10 appropriate for the biggest number
>>>>>>>> var roundingExp = Math.floor(Math.log(**biggestNum****ber) / 
>>>>>>>> Math.LN10);
>>>>>>>> var roundingDec = Math.pow(10,roundingExp);
>>>>>>>>
>>>>>>>> // Round your max and min to the nearest exponent of 10
>>>>>>>> var newMax = roundHalfUp(totalMax/**roundingD****ec)*roundingDec;
>>>>>>>> var newMin = roundHalfDown(totalMin/**roundin****gDec)*roundingDec;
>>>>>>>>
>>>>>>>> // Determine the range of your values
>>>>>>>> var range = newMax - newMin;
>>>>>>>>
>>>>>>>> // Define the number of gridlines (default 5)
>>>>>>>> var gridlines = 5;
>>>>>>>>
>>>>>>>> // Determine an appropriate gap between gridlines
>>>>>>>> var interval = range / (gridlines - 1);
>>>>>>>>
>>>>>>>> // Round that interval up to the exponent of 10
>>>>>>>> var newInterval = roundHalfUp(interval/**roundingD****
>>>>>>>> ec)*roundingDec;
>>>>>>>>
>>>>>>>> // Re-round your max and min to the new interval
>>>>>>>> var finalMax = Math.ceil(totalMax/**newInterval****)*newInterval;
>>>>>>>> var finalMin = Math.floor(totalMin/**newInterva****l)*newInterval;
>>>>>>>>  
>>>>>>>>  
>>>>>>>>  
>>>>>>>> Thankyou,
>>>>>>>> Luke
>>>>>>>>
>>>>>>>  -- 
>>>>>>> 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**
>>>>>>> [email protected].
>>>>>>> To post to this group, send email to google-visua...@googlegroups.**
>>>>>>> c**om.
>>>>>>> Visit this group at http://groups.google.com/**group**
>>>>>>> /google-visualization-api<http://groups.google.com/group/google-visualization-api>
>>>>>>> **.
>>>>>>> For more options, visit 
>>>>>>> https://groups.google.com/**grou**ps/opt_out<https://groups.google.com/groups/opt_out>
>>>>>>> .
>>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>> -- 
>>>>>> Daniel LaLiberte<https://plus.google.com/100631381223468223275?prsrc=2>
>>>>>>   - 978-394-1058
>>>>>> [email protected]   562D 5CC, Cambridge MA
>>>>>> [email protected] 9 Juniper Ridge Road, Acton MA
>>>>>>  
>>>>>  -- 
>>>> 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+**[email protected].
>>>> To post to this group, send email to google-visua...@**googlegroups.com
>>>> .
>>>> Visit this group at http://groups.google.com/**
>>>> group/google-visualization-api<http://groups.google.com/group/google-visualization-api>
>>>> **.
>>>> For more options, visit 
>>>> https://groups.google.com/**groups/opt_out<https://groups.google.com/groups/opt_out>
>>>> .
>>>>  
>>>>  
>>>>
>>>
>>>  -- 
>> 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 [email protected]<javascript:>
>> .
>> To post to this group, send email to 
>> [email protected]<javascript:>
>> .
>> Visit this group at 
>> http://groups.google.com/group/google-visualization-api.
>> For more options, visit https://groups.google.com/groups/opt_out.
>>  
>>  
>>
>
>

-- 
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 [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/google-visualization-api.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to