Page 1 of 1

TeeChart with JScrollViewer

Posted: Thu May 08, 2014 10:03 pm
by 17467436
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

Re: TeeChart with JScrollViewer

Posted: Fri May 09, 2014 2:00 pm
by yeray
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 9728 times

Re: TeeChart with JScrollViewer

Posted: Fri May 09, 2014 5:49 pm
by 17467436
Hi Yeray,

I am using TeeChart Java v3.2013.0517.

How should I proceed in this case?

Thanks.

Re: TeeChart with JScrollViewer

Posted: Mon May 12, 2014 8:26 am
by yeray
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.