ScrollPager tool
ScrollPager tool
Hi steema,
We are using ScrollPager tool of Tchart and we have some issues given as below,
1- When first time chart opens, Bottom axis of subchart is not shown. So how it will display? 2- How to set Bottom Axis and width of subchart. 3- How decrease the height of Subchart.
4- How to Change the mouse Cursor on Tchart.
5- How to Know on Which Chart (Tchart,Subchart) mouse Cursor is Present.
6- Add or Delete some points of Line from Tchart. Then how subchart points will be updated.
7- How to know on which Tchart or Subchart Mouse Click is performed.
We are using ScrollPager tool of Tchart and we have some issues given as below,
1- When first time chart opens, Bottom axis of subchart is not shown. So how it will display? 2- How to set Bottom Axis and width of subchart. 3- How decrease the height of Subchart.
4- How to Change the mouse Cursor on Tchart.
5- How to Know on Which Chart (Tchart,Subchart) mouse Cursor is Present.
6- Add or Delete some points of Line from Tchart. Then how subchart points will be updated.
7- How to know on which Tchart or Subchart Mouse Click is performed.
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Re: ScrollPager tool
Hello,
It produces this chart:
So can you please check your code to find out which is causing it? If the problems persists modify the code snippet above or attach a simple example project we can run "as-is" to reproduce the problem here.
I'll add it to the bug list to be improved: http://bugs.teechart.net/show_bug.cgi?id=1281
None of this doesn't happens using a simple WinForms example with this code:amol wrote: 1- When first time chart opens, Bottom axis of subchart is not shown. So how it will display?
2- How to set Bottom Axis and width of subchart.
Code: Select all
tChart1.Aspect.View3D = false;
tChart1.Series.Add(new Steema.TeeChart.Styles.Line()).FillSampleValues(1000);
tChart1.Tools.Add(new Steema.TeeChart.Tools.ScrollPager());
((Steema.TeeChart.Tools.ScrollPager)tChart1.Tools[0]).Series = tChart1[0];
So can you please check your code to find out which is causing it? If the problems persists modify the code snippet above or attach a simple example project we can run "as-is" to reproduce the problem here.
Using the SubChartTChart.Height property, for example:amol wrote: 3- How decrease the height of Subchart.
Code: Select all
Steema.TeeChart.Tools.ScrollPager scrollPager1 = new Steema.TeeChart.Tools.ScrollPager(tChart1.Chart);
scrollPager1.Series = tChart1[0];
scrollPager1.SubChartTChart.Height = 50;
Have a lookt at this thread. Looks like the bug mentioned there is not completely fixed. I have added a comment to revisit it.amol wrote: 4- How to Change the mouse Cursor on Tchart.
The workaround Christopher Ireland suggested in the thread I pointed in the previous answer shows it.amol wrote: 5- How to Know on Which Chart (Tchart,Subchart) mouse Cursor is Present.
You need to remove ScrollPager's series and assign it again:amol wrote: 6- Add or Delete some points of Line from Tchart. Then how subchart points will be updated.
Code: Select all
scrollPager1.SubChartTChart.Series.Clear();
tChart1[0].Delete(0, 100);
scrollPager1.Series = tChart1[0];
Again, using Bounds.Contains method solves that, for example:amol wrote: 7- How to know on which Tchart or Subchart Mouse Click is performed.
Code: Select all
private void TChart1_MouseDown(object sender, MouseEventArgs e)
{
if (scrollPager1.SubChartTChart.Bounds.Contains(e.X, e.Y))
{
MessageBox.Show("SubChart clicked!");
}
else if (tChart1.Bounds.Contains(e.X, e.Y))
{
MessageBox.Show("tChart1 clicked!");
}
}
Best Regards,
Narcís Calvet / Development & Support Steema Software Avinguda Montilivi 33, 17003 Girona, Catalonia Tel: 34 972 218 797 http://www.steema.com |
Instructions - How to post in this forum |
Re: ScrollPager tool
Thanks for reply,
But we have more query.
1. Add or Delete Points From Tchart. The Location of Zoom Panel of Subchart is Changed ( to Default Location). But we want to preserve/set the last Zoom Panel location of Subchart.
2. When we set the Height of subchart, it will be decrease from below. and we want to decrease from Upper.[Want to set 80 - 20 ratio]
3.When we click outer boundary of axis,the point is getting added. However want to add point only within the axis.
4.When Chart is show, Subchart can not open in full window.However when we click on chart then it comes on full window. While Tchart Dock Property is DockStyle.Fill.
But we have more query.
1. Add or Delete Points From Tchart. The Location of Zoom Panel of Subchart is Changed ( to Default Location). But we want to preserve/set the last Zoom Panel location of Subchart.
2. When we set the Height of subchart, it will be decrease from below. and we want to decrease from Upper.[Want to set 80 - 20 ratio]
3.When we click outer boundary of axis,the point is getting added. However want to add point only within the axis.
4.When Chart is show, Subchart can not open in full window.However when we click on chart then it comes on full window. While Tchart Dock Property is DockStyle.Fill.
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Re: ScrollPager tool
Hello,
That's a consequence of bug #1281. You need to save ColorBand's start and end values and set them after deleting points:amol wrote: 1. Add or Delete Points From Tchart. The Location of Zoom Panel of Subchart is Changed ( to Default Location). But we want to preserve/set the last Zoom Panel location of Subchart.
Code: Select all
double start = scrollPager1.ColorBandTool.Start;
double end = scrollPager1.ColorBandTool.End;
scrollPager1.SubChartTChart.Series.Clear();
tChart1[0].Delete(0, 100);
scrollPager1.Series = tChart1[0];
scrollPager1.ColorBandTool.Start = start;
scrollPager1.ColorBandTool.End = end;
You may need to set DivisionRatio property, which has a defaul value of 3.0. For example:amol wrote: 2. When we set the Height of subchart, it will be decrease from below. and we want to decrease from Upper.[Want to set 80 - 20 ratio]
Code: Select all
scrollPager1.DivisionRatio = 2;
I'm sorry but I don't understand which is the problem here. Are you adding points when clicking on the chart? You can get axes boundaries coordinates with tChart1.Chart.ChartRect. If the problem persists please attach a simple example project we can run "as-is" to reproduce the problem here.amol wrote: 3.When we click outer boundary of axis,the point is getting added. However want to add point only within the axis.
Please send us a Short, Self Contained, Correct (Compilable), Example.amol wrote: 4.When Chart is show, Subchart can not open in full window.However when we click on chart then it comes on full window. While Tchart Dock Property is DockStyle.Fill.
Best Regards,
Narcís Calvet / Development & Support Steema Software Avinguda Montilivi 33, 17003 Girona, Catalonia Tel: 34 972 218 797 http://www.steema.com |
Instructions - How to post in this forum |
Re: ScrollPager tool
Thanks for reply,
But we have one more query.
1. In Sub chart , Move the Zoom Panel. 2. Add a point in the Series of Tchart. The Location of Zoom panel is automatically change ( to Default Location).
But we want to preserve/set the last Zoom Panel location of Subchart is here.
3. After Add point in line series of Tchart, Update subchart series and panel location is given as below,
double start =ScrollPagertool.ColorBandTool.Start;
double end = ScrollPagertool.ColorBandTool.End;
ScrollPagertool.SubChartTChart.Series.Clear();
ScrollPagertool.Series = line;
ScrollPagertool.ColorBandTool.Start = start;
ScrollPagertool.ColorBandTool.End = end;
But it does not giving desired result.
But we have one more query.
1. In Sub chart , Move the Zoom Panel. 2. Add a point in the Series of Tchart. The Location of Zoom panel is automatically change ( to Default Location).
But we want to preserve/set the last Zoom Panel location of Subchart is here.
3. After Add point in line series of Tchart, Update subchart series and panel location is given as below,
double start =ScrollPagertool.ColorBandTool.Start;
double end = ScrollPagertool.ColorBandTool.End;
ScrollPagertool.SubChartTChart.Series.Clear();
ScrollPagertool.Series = line;
ScrollPagertool.ColorBandTool.Start = start;
ScrollPagertool.ColorBandTool.End = end;
But it does not giving desired result.
-
- Guru
- Posts: 1603
- Joined: Fri Nov 15, 2002 12:00 am
Re: ScrollPager tool
Hello,
Just to check - is there anything in this query which is not in the questions you asked here?amol wrote: But we have one more query.
Best Regards,
Christopher Ireland / Development & Support Steema Software Avinguda Montilivi 33, 17003 Girona, Catalonia Tel: 34 972 218 797 http://www.steema.com |
Instructions - How to post in this forum |
Re: ScrollPager tool
thanks for reply,
But we have some more query given as below,
1. How to set subchart width is equal to tchart1 chart width. Please give the solution asap.
thanks
PlanoResearch
But we have some more query given as below,
1. How to set subchart width is equal to tchart1 chart width. Please give the solution asap.
thanks
PlanoResearch
-
- Guru
- Posts: 1603
- Joined: Fri Nov 15, 2002 12:00 am
Re: ScrollPager tool
Hello,
Could you please post a simple example project with which we can reproduce your problem here?amol wrote:1. How to set subchart width is equal to tchart1 chart width.
Best Regards,
Christopher Ireland / Development & Support Steema Software Avinguda Montilivi 33, 17003 Girona, Catalonia Tel: 34 972 218 797 http://www.steema.com |
Instructions - How to post in this forum |
-
- Guru
- Posts: 1603
- Joined: Fri Nov 15, 2002 12:00 am
Re: ScrollPager tool
Hello,
Simplifying your code to this:
I obtain the following here:
This image is what I would expect from the code.
Thank you.amol wrote:ScrollPagerDemo.rar
Simplifying your code to this:
Code: Select all
private void InitializeChart()
{
tChart1.Header.Text = "Scroll Pager Tool Demo";
tChart1.Series.Add(series = new Line());
series.FillSampleValues(1000);
tChart1.Tools.Add(tool = new ScrollPager());
this.SizeChanged += new System.EventHandler(this.Tools_ScrollPager_SizeChanged);
}
private void Tools_ScrollPager_SizeChanged(object sender, EventArgs e)
{
tool.Series = series;
}
Best Regards,
Christopher Ireland / Development & Support Steema Software Avinguda Montilivi 33, 17003 Girona, Catalonia Tel: 34 972 218 797 http://www.steema.com |
Instructions - How to post in this forum |
Re: ScrollPager tool
Thanks For reply,
The scrollpager1.PNG Image is correct.
In Demo
private void Tools_ScrollPager_SizeChanged(object sender, EventArgs e)
{
tool.Series = series;
}
we have also assign "tool.Series = series;". But Tchart,Subchart width seems not equal.
we want to show just Like as scrollpager1.PNG Image Tchart,Subchart width.
Thanks,
PlanoResearch
The scrollpager1.PNG Image is correct.
In Demo
private void Tools_ScrollPager_SizeChanged(object sender, EventArgs e)
{
tool.Series = series;
}
we have also assign "tool.Series = series;". But Tchart,Subchart width seems not equal.
we want to show just Like as scrollpager1.PNG Image Tchart,Subchart width.
Thanks,
PlanoResearch
-
- Guru
- Posts: 1603
- Joined: Fri Nov 15, 2002 12:00 am
Re: ScrollPager tool
Hello,
can you please post an image of the resulting chart here? Which version of TeeChart.dll are you using?
Using the following code in frmScrollPager.cs of your example project:amol wrote: we have also assign "tool.Series = series;". But Tchart,Subchart width seems not equal.
Code: Select all
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using Steema.TeeChart.Styles;
using Steema.TeeChart.Tools;
using Steema.TeeChart.Themes;
using Steema.TeeChart.Drawing;
using Steema.TeeChart.Editors.Tools;
using Steema.TeeChart.Editors;
namespace ScrollPagerDemo
{
public partial class frmScrollPager : Form
{
#region Member Variables
Line series;
ScrollPager tool;
#endregion
public frmScrollPager()
{
InitializeComponent();
InitializeChart();
}
private void InitializeChart()
{
tChart1.Header.Text = "Scroll Pager Tool Demo";
tChart1.Series.Add(series = new Line());
series.FillSampleValues(1000);
tChart1.Tools.Add(tool = new ScrollPager());
this.SizeChanged += new System.EventHandler(this.Tools_ScrollPager_SizeChanged);
}
private void Tools_ScrollPager_SizeChanged(object sender, EventArgs e)
{
tool.Series = series;
}
}
}
Best Regards,
Christopher Ireland / Development & Support Steema Software Avinguda Montilivi 33, 17003 Girona, Catalonia Tel: 34 972 218 797 http://www.steema.com |
Instructions - How to post in this forum |
Re: ScrollPager tool
We are using "4.1.2012.5130" version of TeeChart.
-
- Guru
- Posts: 1603
- Joined: Fri Nov 15, 2002 12:00 am
Re: ScrollPager tool
Hello,
This is due to defect id=589 which was fixed in "4.1.2014.02240". I am afraid there is no workaround to this fix other than an upgrade to at least this version.amol wrote:We are using "4.1.2012.5130" version of TeeChart.
Best Regards,
Christopher Ireland / Development & Support Steema Software Avinguda Montilivi 33, 17003 Girona, Catalonia Tel: 34 972 218 797 http://www.steema.com |
Instructions - How to post in this forum |