• Post Reply Bookmark Topic Watch Topic
  • New Topic

JFreeChart Deprecated TimeSeries Constructor

 
Dennis Putnam
Ranch Hand
Posts: 377
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am creating a time series chart that uses a minute scale. I am using a deprecated constructor to do it.

My problem is I cannot find the correct code to use that accomplishes this. If I simply use what the documentation says (i.e. the minute class is unnecessary):

I get this error:

You are trying to add data where the time period class is org.jfree.data.time.Minute, but the TimeSeries is expecting an instance of org.jfree.data.time.Day.

What should I be using? TIA.
 
Darryl Burke
Bartender
Posts: 5152
11
Java Netbeans IDE Opera
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't use JFreeChart, but have you tried using the only other constructor that isn't deprecated?
 
Dennis Putnam
Ranch Hand
Posts: 377
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes. Same problem. It is supposed to infer from the context what to use but it does not use minute even though I am using 'HH:mm' format. Its either a bug or an omission. I just hope the deprecated method does not go away until it is fixed.
 
Darryl Burke
Bartender
Posts: 5152
11
Java Netbeans IDE Opera
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can you show the line of code that adds the first data item to the dataset? And is that data item of class org.jfree.data.time.Minute?

If that's not it, check that you are using a version of JFreeChart that is 1.0.13 or later.
 
Dennis Putnam
Ranch Hand
Posts: 377
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for the reply. I'm not sure what all you need but hopefully this is sufficient.
Initialization of domain.

This is how data is added for all range data points including the first:
 
Darryl Burke
Bartender
Posts: 5152
11
Java Netbeans IDE Opera
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This compiles and runs without error with JFreeChart 1.0.19 (presently the latest version).
 
Dennis Putnam
Ranch Hand
Posts: 377
  • Likes 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Just to close this out. You hit the problem. It was a bug in the version I was using. I am now at 1.0.19 and it works. Thanks.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!