I'm using TeeCharts for Java with eclipse. I need to draw some custom labels on my chart. I implemented the chart paint listener chart painted method which is supposed to let me draw after my chart has been painted, but it is not working. If I set a breakpoint in the listener it does hit it, and I can see my custom text and then there is a small delay and the chart gets redrawn without my custom text. Here's my code:
chart1.addChartPaintListener( new ChartPaintAdapter() {
public void seriesPainted(ChartDrawEvent e) {
chart1.getGraphics().drawString("Label 1", 20, 20);
};
public void chartPainted(ChartDrawEvent e) {
chart1.getGraphics().drawString("Label 2", 10, 10);
};
});
I overwrote the series and chart painted methods to try to get one to work. I tried with auto paint on the chart true and false, manually calling the paint, but it made no difference. My chart is nested in some panels, but I don't see how this could affect the painting. What am I doing wrong?
Custom drawing getting painted over
Re: Custom drawing getting painted over
Hello mts,
The attached project seems to work fine for me here with TeeChart Java v2. Could you please check it? (Use import option in eclipse) If it works for you, the problem might be caused by some particular setting in your application. If that's the case, please, try to arrange a simple example project we can run as-is to reproduce the problem here.
The attached project seems to work fine for me here with TeeChart Java v2. Could you please check it? (Use import option in eclipse) If it works for you, the problem might be caused by some particular setting in your application. If that's the case, please, try to arrange a simple example project we can run as-is to reproduce the problem here.
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |
Re: Custom drawing getting painted over
I still cannot get it to work, though your example works fine. I was able to draw lines on the chart, but when I try to draw labels in the margins it doesn't refresh right, not sure why. Instead I just placed JLabels at the top of my chart to display the information I needed.