Chart does not show data after adding a new panel

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
afcec
Posts: 2
Joined: Fri May 12, 2017 8:28 am
antibot: No, of course not.

Chart does not show data after adding a new panel

Post by afcec » Fri May 12, 2017 8:57 am

Hi,

I have a project successfully working with JFreeChart. In one of the forms, I have two charts as in the image below:

Image

Everything works as expected but now I need to add two extra charts creating a layout like this:

Image

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:

Image

Any ideas?

Thanks!

John Matthews
Posts: 513
Joined: Wed Sep 12, 2007 3:18 pm

Re: Chart does not show data after adding a new panel

Post by John Matthews » Fri May 12, 2017 9:32 am

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.

afcec
Posts: 2
Joined: Fri May 12, 2017 8:28 am
antibot: No, of course not.

Re: Chart does not show data after adding a new panel

Post by afcec » Fri May 12, 2017 11:42 am

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

John Matthews
Posts: 513
Joined: Wed Sep 12, 2007 3:18 pm

Re: Chart does not show data after adding a new panel

Post by John Matthews » Sat May 13, 2017 12:38 am

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?

MrJack
Posts: 13
Joined: Thu May 18, 2017 3:41 pm
antibot: No, of course not.

Re: Chart does not show data after adding a new panel

Post by MrJack » Tue May 23, 2017 3:45 pm

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

Locked