Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

For those who've used JClass Chart, how do I load data using a TableModel for x axis

 
Meghna ks
Ranch Hand
Posts: 122
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi
I've been using the JClass Chart and I load the data to the Chart by using a TableModel by extending the AbstractTableModel class. But the problem I'm facing is that only the values for the Y axis are generated according to the requirement whereas the X axis values are generated randomly by the Chart. If anyone has experimented with this before, please do let me know.This is an important requirement and I'd greatly appreciate any help.
Thanks
Meghna
 
Manfred Leonhardt
Ranch Hand
Posts: 1492
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Meghna,
As I understand it, the JCChart automatically generates the X axis values. If you want something else then you need to have the chart use PointLabels. Look at the following example at how I made the JCChart use PointLabels.

The bolded code on the bottom of the constructor is the important stuff.
Enjoy,
Manfred.
 
Meghna ks
Ranch Hand
Posts: 122
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks a lot Manfred
I really appreciate your help. I'll try out the logic with my data Model and see if I can come up with good results. Once again, I appreciate your help a lot.
Thanks
Meghna
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic