Hi,
I have a project successfully working with JFreeChart. In one of the forms, I have two charts as in the image below:
Everything works as expected but now I need to add two extra charts creating a layout like this:
Unfortunately from the moment I added the two charts on the right, the initial ones does not show anything. However, I get no errors... I have tried to go backwards step by step and it does not work from the very beginning, I mean, from my original form (which works) I just add these new panels (with no charts) and from that moment my charts do not get updated:
Any ideas?
Thanks!
Chart does not show data after adding a new panel
-
- Posts: 513
- Joined: Wed Sep 12, 2007 3:18 pm
Re: Chart does not show data after adding a new panel
It looks like your layout is working, but typically the same component may be added to a container only once. Depending on your environment, a second addition typically replaces the first. Verify that your charts are distinct.
Re: Chart does not show data after adding a new panel
Yes, obviously I am creating specific objects for each of the charts. But as I said above, even replacing the two new charts and only leaving the new panels, it does not work...
Thanks for your time
Thanks for your time
-
- Posts: 513
- Joined: Wed Sep 12, 2007 3:18 pm
Re: Chart does not show data after adding a new panel
In Java Swing, I use a JPanel having GridLayout or a JTable having a custom TableCellRenderer. What environment are you using? Can you post a short example?
Re: Chart does not show data after adding a new panel
If you can show us the part of the code when you add your ChartPanel into your layout, because juste with that I think that you have made a mistake like you add 2 chart at the same place