This is an issue that I'm struggling with as well. If you choose data
type "timeofday" then sorting and display in datatables works ok but
you can not chart values of that datatype

my solution has been to add a col to the datatable that holds the
second value and use that for charting while the timeofday col I use
for display.

I think (but have not tested yet) that another solution would be to
produce the following (from server side)


data.setCell(0,3,88.22,'1:22:34'',{'style': 'border: 3px solid
deeppink)


This will I hope result is the user seeing the 1:22:34 value in
tooltip and yet having the chart plot the numerical value 88.22

bill
On Jan 1, 4:45 am, Budband <[email protected]> wrote:
> Is it possible to format the number(which is a time) from decimal to
> minute:seconds.milliseconds and display it on the Chart ?
> For example if the number is  88.22 seconds (1 min and 22.22 seconds)
> the number should be displayed as 1:22.22 in the chart (tooltip).
>
> I was almost able to do that in the LineChart using the following:
>
> com.google.gwt.visualization.client.formatters.NumberFormat.Options
> nOptions =
> com.google.gwt.visualization.client.formatters.NumberFormat.Options.create
> ();
>         nOptions.setFractionDigits(2);
>         nOptions.setDecimalSymbol(":");
>         nOptions.setPrefix("New Formatted Time is -> ");
>         nOptions.setSuffix(".22");
> NumberFormat formatter = NumberFormat.create(nOptions);
>
> // Drop the decimal part from the number when populating the DataTable
> DataTable data = getCompanyPerformance();
> formatter.format(data, 1);
>
> Well, there are 2 problems with this approach.
> 1 - The Suffix can not be dynamic, i.e. couldn't find a way to pass a
> parameter to the setSuffix method, neither was able to apply the
> formatter with different Suffix to each number.
> 2 - The NumberFormat won't work on the datatable used for
> AnnotatedTimeLine !!
>
> I also checked the PatternFormat with no success.
>
> Thanks for your help.

--

You received this message because you are subscribed to the Google Groups 
"Google Visualization API" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-visualization-api?hl=en.


Reply via email to