TeeChart with JScrollViewer

TeeChart for Java (NetBeans, Eclipse, Android Studio, etc)
Post Reply
Gustavo
Newbie
Newbie
Posts: 2
Joined: Fri Oct 04, 2013 12:00 am

TeeChart with JScrollViewer

Post by Gustavo » Thu May 08, 2014 10:03 pm

Hi,

I am working on teechart using horizontal bar series and I would like to know, how can i use a TeeChart with JScrollViewer?

I realized an implementation, but when I scrolling, the component (TeeChart) paint wrong (out of limits).

Please help me to solve the problem.

Implementation:

Code: Select all

import com.steema.teechart.TChart;
import com.steema.teechart.styles.HorizBar;
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Dimension;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.JScrollPane;

public class Teste {

    public void initChart() {    
        JFrame jFrame = new JFrame();
        TChart chart = new TChart();
        JPanel baseChartJP = new JPanel();
        JPanel southJP = new JPanel();
        JScrollPane jScrollPane = new JScrollPane();      
        HorizBar horizBar;
        
        chart.getLegend().setCurrentPage(true);
        chart.getLegend().setVisible(false);
        chart.getAspect().setView3D(false);
        chart.getWalls().setVisible(true);
        chart.getWalls().setView3D(false);
        chart.getAxes().setVisible(false);
        chart.getLegend().setCurrentPage(true);
        chart.getAspect().setView3D(false);               
        
        horizBar = new HorizBar(chart.getChart());        
        for (int i = 1; i < 100; i++) {
            horizBar.add(i);
        }
        
        southJP.setPreferredSize(new Dimension(100, 200));
        southJP.setBackground(Color.BLUE);
        
        baseChartJP.setLayout(new BorderLayout());
        baseChartJP.setPreferredSize(new Dimension(100, 2000));
        baseChartJP.add(chart, BorderLayout.CENTER);
        
        jScrollPane.setViewportView(baseChartJP);
        
        jFrame.setSize(new Dimension(600, 600));
        jFrame.setLayout(new BorderLayout());
        jFrame.add(jScrollPane, BorderLayout.CENTER);
        jFrame.add(southJP, BorderLayout.SOUTH);
        jFrame.setVisible(true);        
    }

    public static void main(String[] args) {
        new Teste().initChart();
    }
}
Image

Yeray
Site Admin
Site Admin
Posts: 9613
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: TeeChart with JScrollViewer

Post by Yeray » Fri May 09, 2014 2:00 pm

Hi Gustavo,

Are you using TeeChart Java v3.2013.1219?
I've pasted your exact code in a NetBeans project and this how it looks for me here:
2014-05-09_1558.png
2014-05-09_1558.png (10.31 KiB) Viewed 10924 times
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

Gustavo
Newbie
Newbie
Posts: 2
Joined: Fri Oct 04, 2013 12:00 am

Re: TeeChart with JScrollViewer

Post by Gustavo » Fri May 09, 2014 5:49 pm

Hi Yeray,

I am using TeeChart Java v3.2013.0517.

How should I proceed in this case?

Thanks.

Yeray
Site Admin
Site Admin
Posts: 9613
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: TeeChart with JScrollViewer

Post by Yeray » Mon May 12, 2014 8:26 am

Hi Gustavo,

First of all I'd suggest you to download the latest evaluation version available and try to confirm this is fixed with it.
If you confirm it, then you can update your registered version, or, if you own the sources, try to apply the change that fixes the issue yourself.
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

Post Reply