Page 1 of 1

ScrollPager tool

Posted: Wed Aug 26, 2015 10:55 am
by 9526439
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?
1.png
Image 1
1.png (171 KiB) Viewed 25927 times
2- How to set Bottom Axis and width of subchart.
2.png
image 2
2.png (235.94 KiB) Viewed 25926 times
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.

Re: ScrollPager tool

Posted: Wed Aug 26, 2015 11:34 am
by narcis
Hello,
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.
None of this doesn't happens using a simple WinForms example with this code:

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];
It produces this chart:
Chart1.png
Chart1.png (26.65 KiB) Viewed 25908 times
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.
amol wrote: 3- How decrease the height of Subchart.
Using the SubChartTChart.Height property, for example:

Code: Select all

      Steema.TeeChart.Tools.ScrollPager scrollPager1 = new Steema.TeeChart.Tools.ScrollPager(tChart1.Chart);
      scrollPager1.Series = tChart1[0];
      scrollPager1.SubChartTChart.Height = 50;
amol wrote: 4- How to Change the mouse Cursor on Tchart.
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: 5- How to Know on Which Chart (Tchart,Subchart) mouse Cursor is Present.
The workaround Christopher Ireland suggested in the thread I pointed in the previous answer shows it.
amol wrote: 6- Add or Delete some points of Line from Tchart. Then how subchart points will be updated.
You need to remove ScrollPager's series and assign it again:

Code: Select all

      scrollPager1.SubChartTChart.Series.Clear();
      tChart1[0].Delete(0, 100);
      scrollPager1.Series = tChart1[0];
I'll add it to the bug list to be improved: http://bugs.teechart.net/show_bug.cgi?id=1281
amol wrote: 7- How to know on which Tchart or Subchart Mouse Click is performed.
Again, using Bounds.Contains method solves that, for example:

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!");
      }
    }

Re: ScrollPager tool

Posted: Thu Aug 27, 2015 6:17 am
by 9526439
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.

Re: ScrollPager tool

Posted: Thu Aug 27, 2015 7:49 am
by narcis
Hello,
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.
That's a consequence of bug #1281. You need to save ColorBand's start and end values and set them after deleting points:

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;
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]
You may need to set DivisionRatio property, which has a defaul value of 3.0. For example:

Code: Select all

      scrollPager1.DivisionRatio = 2;
amol wrote: 3.When we click outer boundary of axis,the point is getting added. However want to add point only within the axis.
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: 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.
Please send us a Short, Self Contained, Correct (Compilable), Example.

Re: ScrollPager tool

Posted: Mon Aug 31, 2015 7:13 am
by 9526439
Thanks for reply,
But we have one more query.
1. In Sub chart , Move the Zoom Panel.
111.png
Image 1
111.png (30.5 KiB) Viewed 25861 times
2. Add a point in the Series of Tchart. The Location of Zoom panel is automatically change ( to Default Location).
1112.png
Image 2
1112.png (32.5 KiB) Viewed 25860 times

But we want to preserve/set the last Zoom Panel location of Subchart is here.
123.png
Image 3
123.png (35.22 KiB) Viewed 25859 times
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.
123.png
Image 3
123.png (35.22 KiB) Viewed 25859 times

Re: ScrollPager tool

Posted: Mon Aug 31, 2015 1:50 pm
by Christopher
Hello,
amol wrote: But we have one more query.
Just to check - is there anything in this query which is not in the questions you asked here?

Re: ScrollPager tool

Posted: Tue Sep 01, 2015 6:34 am
by 9526439
thanks for reply,

But we have some more query given as below,

1. How to set subchart width is equal to tchart1 chart width.
w1.png
Fig1
w1.png (36.52 KiB) Viewed 25807 times
Please give the solution asap.

thanks

PlanoResearch

Re: ScrollPager tool

Posted: Tue Sep 01, 2015 9:31 am
by Christopher
Hello,
amol wrote:1. How to set subchart width is equal to tchart1 chart width.
Could you please post a simple example project with which we can reproduce your problem here?

Re: ScrollPager tool

Posted: Tue Sep 01, 2015 9:36 am
by 9526439
ScrollPagerDemo.rar
Demo
(59.44 KiB) Downloaded 1205 times

Re: ScrollPager tool

Posted: Tue Sep 01, 2015 10:30 am
by Christopher
Hello,
amol wrote:ScrollPagerDemo.rar
Thank you.

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;
    }
I obtain the following here:
scrollpager1.PNG
scrollpager1.PNG (141.77 KiB) Viewed 25764 times
This image is what I would expect from the code.

Re: ScrollPager tool

Posted: Tue Sep 01, 2015 10:58 am
by 9526439
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

Re: ScrollPager tool

Posted: Tue Sep 01, 2015 11:04 am
by Christopher
Hello,
amol wrote: we have also assign "tool.Series = series;". But Tchart,Subchart width seems not equal.
Using the following code in frmScrollPager.cs of your example project:

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;
    }
  }
}
can you please post an image of the resulting chart here? Which version of TeeChart.dll are you using?

Re: ScrollPager tool

Posted: Tue Sep 01, 2015 12:14 pm
by 9526439
We are using "4.1.2012.5130" version of TeeChart.

Re: ScrollPager tool

Posted: Tue Sep 01, 2015 1:18 pm
by Christopher
Hello,
amol wrote:We are using "4.1.2012.5130" version of TeeChart.
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.