|Dynamically changing the date format on the X axis [message #851151]
||Fri, 20 April 2012 13:51
| Mike Wulkan
Registered: July 2009
Currently in my reports I have logic that checks whether the range of datetimes on the X axis spans a calendar day. If it does it sets the format specifier to show both the date and time, otherwise it sets the format specifier to just show the time. It does this in the beforeGeneration script for the chart using:|
xAxis.setFormatSpecifier( JavaDateFormatSpecifierImpl.create(dateTimeFormat) );
What I would like to do is change this so that only the first label for a unique day gets the long format and the rest of the labels use the short time only format. This would reduce the clutter and highlight the point where the day changed.
I tried to change the format using the above API in the beforeDrawAxisLabel script but no matter what I set it to it doesn't appear to take effect. I'm thinking that I may have to define the X axis label as a string and format it myself in the beforeDrawAxisLabel.
I am hoping there is a better way
Powered by FUDForum
. Page generated in 0.01593 seconds