You can keep it a number type for the filter, and use the view.columns 
parameter of the chart's ChartWrapper object to convert it back into a 
string.

On Monday, July 8, 2013 8:05:53 AM UTC-4, Log Reader wrote:
>
> unfortunately I need the hAxis values to be of type "number" for the chart 
> range filter to work, which is a requirement for me unfortunately. I will 
> look into those axis customization parameters you mentioned.
>
> Thanks!
>
> On Thursday, July 4, 2013 7:22:37 PM UTC+2, asgallant wrote:
>>
>> You cannot use a function to format the hAxis values, though I am 
>> lobbying the dev team to add this functionality in (see 
>> this<http://code.google.com/p/google-visualization-api-issues/issues/detail?id=1232>feature
>>  request, you can star the issue to get updates on it).  Hopefully, 
>> the talented and wonderful folks at Google will come up with an ingenious 
>> solution to the problem.
>>
>> If you are starting with a string timestamp and converting to a number 
>> for the filter, why not just convert back to a string for the chart?  This 
>> skips the axis formatting problem entirely.  You can then use the myriad of 
>> hAxis suboptions for discrete axes to increase the number of labels.
>>
>> This may not be a viable solution if your timestamps don't increment in 
>> constant steps (as using strings converts the chart to a discrete axis 
>> instead of a continuous axis, see 
>> this<http://jsfiddle.net/asgallant/Xfx3h/>for a visualization of the 
>> difference).  If you have to use a continuous 
>> axis, the hAxis.gridlines.count option controls the number of labels on the 
>> axis; but it is currently broken with "date" type axes (if I recall 
>> correctly, the fix should be out soon for this).
>>
>> On Thursday, July 4, 2013 8:35:09 AM UTC-4, Log Reader wrote:
>>>
>>> Also, can anyone point me to the way to increase the frequency of labels 
>>> along the horizontal axis? Right now there are only 5, when I have hundreds 
>>> of data points. I don't need to include all of them, but increasing the 
>>> current number would help make the graph a lot more readable.
>>>
>>> On Thursday, July 4, 2013 2:30:04 PM UTC+2, Log Reader wrote:
>>>>
>>>> Hello,
>>>>
>>>> I am currently using a line chart to display events along a timeline. 
>>>> My events are marked with a string timestamp in the form 
>>>> hour:minute:second.millisecond. I am using a ChartRangeFilter as a 
>>>> scrolling bar, which requires me to convert the string timestamp into a 
>>>> number, milliseconds, and sort the events using this number. I am able to 
>>>> create custom tool tips for each point which convert the number of 
>>>> milliseconds back into a reasonable time stamp, but I am hoping to do that 
>>>> for the labels along the horizontal axis as well.
>>>>
>>>> Unfortunately, I cannot use the hAxis.format in the form shown here: 
>>>> https://developers.google.com/chart/interactive/docs/gallery/linechart 
>>>> because 
>>>> I need to do some division and subtraction to convert the number in 
>>>> milliseconds to a time stamp in the form I desire. In short, I need to 
>>>> pass 
>>>> the number to a function and display the result.
>>>>
>>>> Is this possible with the visualization API using line charts? Or, 
>>>> conversely, is there a better way to do what I'm trying to do?
>>>> Thanks!
>>>>
>>>

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