Jump to content

Retaining the date display in a time-series chart?


leeyuiwah

Recommended Posts

The time-series chart does auto-scaling on the time-axis (X-axis). It understands that a day has 24 hours, for example, and can render different time-axis tick labels with the appropriate units at different time scale (hours vs dates, for example). This is nice.

[/code]

 

[/code]

However, when the overall time range is a few data points, the "date" information is lost in this auto-scaling. For example, when there are five days of data, and the time-axis only shows

 

0:00 0:60 12:00 18:00 0:00 ...

 

(the first 0:00 is for Aug 2, the 2nd 0:00 is for Aug 3, etc, but the date were not shown in the chart)

 

I wonder if there is a way to prevent this from happening.[/code]

Link to comment
Share on other sites

  • Replies 1
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

I researched a bit more on this issue. It seems that JFreeChart can present three types of labels for a timeseries chart (please see the attached PPT slide sd_2009_08_10.JFree.autoscaling.JasperSoft.ppt):



1. time-only (e.g. 12:00) Slide 1


2. date-time (e.g. 8-Aug, 00:00) Slide 2


3. date-only (e.g. 4-Aug) Slide 3

It picks a certain type of labels depends on how many days there are for the full range of the time axis (x-axis). They probably has some internal thresholds for these.

I think if we can change the internal threshold such that Case 1 (time-only) never happens, then we should be good. But I don't know how to do that.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...