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.