This week's book giveaway is in the Programmer Certification forum.
We're giving away four copies of OCP Oracle Certified Professional Java SE 11 Programmer I Study Guide: Exam 1Z0-815 and have Jeanne Boyarsky & Scott Selikoff on-line!
See this thread for details.
Win a copy of OCP Oracle Certified Professional Java SE 11 Programmer I Study Guide: Exam 1Z0-815 this week in the Programmer Certification forum!
  • 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
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Ron McLeod
  • Carey Brown
Bartenders:
  • Paweł Baczyński
  • Piet Souris
  • Vijitha Kumara

JFreeChart problem (No axis label)

 
Ranch Hand
Posts: 634
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have modified the source code of JFreeChart in the file called BarRenderer. In this file, I made the following change to it


So that it animates when the chart comes in (fly-in effect)
Here it how it is called.

However, I didn't know why the axis labels were gone
Here is how it looks on rendering


I wanna know why the labels were gone.

Thanks
Jack
 
Bartender
Posts: 1166
17
Netbeans IDE Java Linux
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I suspect you are going to have trouble getting a 'fix' for this problem. I for one am not going to go through all that code to try to understand it and I suspect most people here will feel the same. Also, I do not know which JFreeChart version you based this on to see what changes you made and though I use JFreeChart and have a version of the source code it may not be the version you started from. If there was an SSCCE then I might be inclined to run it and look for the obvious but I'm not willing to generate one for you.
 
Jacky Luk
Ranch Hand
Posts: 634
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sorry, I didn't clarify this

The changes I have made were
1) adding a branch to the drawItem method, so that when it is "set" and a count has been added




This will affect the g2.fill(bar) method, and there will be a repetition of g2.fill(bar) calls for i number of times.
which there was a pre-shift of location x for the bar, I didn't change the rest of the code.
The only I notice was

getItemLabelGenerator is using row and column parameters of drawItem method which shouldn't be affected by the
code preceding it. Here, when I set a breakpoint inside getItemLabelGenerator

I will get a null from the above method.
That's it. Hope you understand.
Thanks
Jack
 
Richard Tookey
Bartender
Posts: 1166
17
Netbeans IDE Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Jacky Luk wrote:Sorry, I didn't clarify this



To my mind you still haven't clarified it! In fact, if anything I think you have added to my confusion. In your first post you did not post the code for setMove() or Increment() and I still can't see what they are supposed to do. Sorry but I think you need to post an SSCCE ( <- follow the link) to stand any chance.
 
Always! Wait. Never. Shut up. Look at this tiny ad.
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!