• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Junilu Lacar
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Knute Snortum
  • Tim Cooke
  • Devaka Cooray
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Ganesh Patekar

JFreeChart Deprecated TimeSeries Constructor

 
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.
 
Bartender
Posts: 5167
11
Netbeans IDE Opera Java
  • 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: 5167
11
Netbeans IDE Opera Java
  • 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: 5167
11
Netbeans IDE Opera Java
  • 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.
 
Your mind is under my control .... your will is now mine .... read this tiny ad
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!