In the ScrollPagerDemo code
the size [height] of the lower window is fixed.
Is it possible to adjust the height?
Also it seems the lower panel used to scroll is not using gridbag layouts so that when I resize the main window the lower panel is not resized automatically.
Is this true?
This cannot be used for commercial use without this feature [ autoresizing ]
scrollpager
Re: scrollpager
Hi,
You can use the divisionRatio for this. You can get it's value through getDivisionRatio() and you can set a new one through setDivisionRatio(double value). By default its value is 3. The height of the TSubChart below is the result of the division of the main chart height between this divisionRatio value.SetOnHi wrote:In the ScrollPagerDemo code
the size [height] of the lower window is fixed.
Is it possible to adjust the height?
It seems to work fine for me. Look at the following screenshots: This is the code I used, with TeeChart Java SWTSetOnHi wrote:Also it seems the lower panel used to scroll is not using gridbag layouts so that when I resize the main window the lower panel is not resized automatically.
Is this true?
This cannot be used for commercial use without this feature [ autoresizing ]
Code: Select all
tChart1.getAspect().setView3D(false);
tChart1.getLegend().setVisible(false);
Line line1 = new Line(tChart1.getChart());
line1.fillSampleValues(100);
tChart1.setBounds(Utils.fromLTRB(0, 0, tChart1.getParent().getSize().x, tChart1.getParent().getSize().y-20));
ScrollPager scroPag1 = new ScrollPager(tChart1.getChart(), tChart1.getParent(), 0);
scroPag1.setSeries(line1);
Best Regards,
![]() | Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) |
![]() ![]() ![]() ![]() ![]() ![]() |
Please read our Bug Fixing Policy |
Re: scrollpager
I am afraid i am still having problems with resizing.
I didnt find your code worked but as your response was not a fully working app I may have missed something
I have attached a complete working eclipse project which is fairly closely based on the sample PageScroller.
if you start the application (GVApplication)
and then just maximize the window, the scrollpager is not resized.
I have tried all kinds of things including gridbags but I can't ever get the scrollpager to resize.
In addition to that the cursor tool invades the lower chart as I indicated in an earlier posting.
It may be related but I would really appreciate it if you not only take a look but reply with a working version.
I apologize if the error is mine but I am not convinced it is.
I didnt find your code worked but as your response was not a fully working app I may have missed something
I have attached a complete working eclipse project which is fairly closely based on the sample PageScroller.
if you start the application (GVApplication)
and then just maximize the window, the scrollpager is not resized.
I have tried all kinds of things including gridbags but I can't ever get the scrollpager to resize.
In addition to that the cursor tool invades the lower chart as I indicated in an earlier posting.
It may be related but I would really appreciate it if you not only take a look but reply with a working version.
I apologize if the error is mine but I am not convinced it is.
- Attachments
-
- New jZip archive file.zip
- (487.94 KiB) Downloaded 1056 times
Re: scrollpager
Hello,
Note the ScrollPager tool is a bit special. As you'll see in the sources, this tool calculates both charts sizes and positions at the setUpChartLayout method, at ScrollPager.java.
To make the charts to resize with the application, you just have to do the same at your componentResized event. At GVScrollPager.java:
And regarding the Cursor tool clipping, take a look at the discussion here:
http://www.teechart.net/support/viewtop ... 10&t=12211
Note the ScrollPager tool is a bit special. As you'll see in the sources, this tool calculates both charts sizes and positions at the setUpChartLayout method, at ScrollPager.java.
To make the charts to resize with the application, you just have to do the same at your componentResized event. At GVScrollPager.java:
Code: Select all
public GVScrollPager()
{
super();
addComponentListener(new java.awt.event.ComponentAdapter()
{
public void componentResized(java.awt.event.ComponentEvent evt)
{
scrollPagerDemoResized(evt);
System.out.println("*********** " + evt.paramString());
java.awt.Dimension d = GVFrame.contentPane.getSize();
setSize(d);
setPreferredSize(d);
//chart1.setBounds(Utils.fromLTRB(0, 0, (int)chart1.getParent().getSize().getWidth(), (int)chart1.getParent().getSize().getHeight()-20));
setUpChartLayout();
}
});
last3XClicks[0] = 0;
last3XClicks[1] = 0;
last3XClicks[2] = 0;
last3YClicks[0] = 0;
last3YClicks[1] = 0;
last3YClicks[2] = 0;
}
private void setUpChartLayout() {
int width = Math.max(chart1.getChart().getParent().getControlWidth(), chart1.getChart().getWidth());
int height = Math.max(chart1.getChart().getParent().getControlHeight(), chart1.getChart().getHeight());
tool1.getSubChartTChart().getAspect().setView3D(false);
tool1.getSubChartTChart().setWidth(width);
tool1.getSubChartTChart().setHeight(Utils.round(height / tool1.getDivisionRatio()));
int top = height - tool1.getSubChartTool().getCharts().get(0).getHeight();
tool1.getSubChartTool().getCharts().get(0).setLeft(0);
tool1.getSubChartTool().getCharts().get(0).setTop(top);
chart1.getChart().setCustomChartRect(true);
Rectangle rect = Utils.fromLTRB(0, 10, tool1.getSubChartTChart().getWidth() - 20, tool1.getSubChartTChart().getY());
chart1.getChart().setChartRect(rect);
tool1.getSubChartTChart().getPanel().setMarginUnits(PanelMarginUnits.PIXELS);
tool1.getSubChartTChart().getPanel().setMarginRight(width - chart1.getChart().getChartRect().getRight());
tool1.getSubChartTChart().getPanel().setMarginBottom(5);
}
http://www.teechart.net/support/viewtop ... 10&t=12211
Best Regards,
![]() | Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) |
![]() ![]() ![]() ![]() ![]() ![]() |
Please read our Bug Fixing Policy |
Re: scrollpager
Thats perfect
Thank you for you excellent support
Really appreciated.
Thank you for you excellent support
Really appreciated.