Page 1 of 1

After add scrollpager the chart dock property doesn't run

Posted: Tue Nov 05, 2013 12:19 pm
by 15654539
I have a example
http://193.145.251.126/pnp/files/KwANvF ... echart.zip

If you run the project and maximize the window, the chart is also maximized. But if you push the button2 (for seeing the scroll pager) and then you maximize the window, the chart is not maximized.
Is that behaviour correct?

Re: After add scrollpager the chart dock property doesn't run

Posted: Tue Nov 05, 2013 3:53 pm
by 10050769
Hello wakeup,

Thanks for your information. I have added the problem in bug list report with number [ID72 ]. We will try to fix it to upcoming versions of TeeChartFor.Net. To following the progress of your bug, I recommend you taking a look in the bug tracker .


Thanks,

Re: After add scrollpager the chart dock property doesn't run

Posted: Tue Feb 11, 2014 2:16 pm
by 15654539
I have installed the new version of teechart but I see it is not solved yet. What happened?

Thanks

Re: After add scrollpager the chart dock property doesn't run

Posted: Thu Feb 13, 2014 2:06 pm
by narcis
Hi wakeup,

As Christopher Ireland commented here, you need to use TChart's Resize event as shown in the bugzilla ticket.

Re: After add scrollpager the chart dock property doesn't run

Posted: Thu Feb 13, 2014 2:52 pm
by 15654539
Ok, now it is resized when the is a scrollpager, but if I remove the ScrollPager the chart doesn't resize...

Re: After add scrollpager the chart dock property doesn't run

Posted: Thu Feb 13, 2014 2:58 pm
by narcis
Hello,

You can either unsubscribe the event when the tool is removed:

Code: Select all

      tChart1.Tools.Remove(scrollPager1);
      tChart1.Resize -= tChart1_Resize;
or check that the tool exists in the event implementation:

Code: Select all

    void tChart1_Resize(object sender, EventArgs e)
    {
      if (tool != null)
      {
        tool.Series = num;
      }
    }

Re: After add scrollpager the chart dock property doesn't run

Posted: Thu Feb 13, 2014 3:09 pm
by 15654539
I tried it but it still does doesn't resice. In fact the chart doesn't go to his place, there is still below the chart the space ocuped previously by the pagescroller...

Re: After add scrollpager the chart dock property doesn't run

Posted: Thu Feb 13, 2014 3:16 pm
by narcis
Hello wakeup,

Using the code below works fine for me. Click the chart to remove the ScrollPager tool. Does this code work fine for you?

Code: Select all

  public partial class Form1 : Form
  {
    public Form1()
    {
      InitializeComponent();
      InitializeChart();
    }

    Steema.TeeChart.Styles.Line num;
    ScrollPager tool;

    private void InitializeChart()
    {
      num = new Steema.TeeChart.Styles.Line();
      tChart1.Series.Add(num);
      num.FillSampleValues();

      tool = new ScrollPager(tChart1.Chart);
      tool.Series = num;

      tChart1.Dock = DockStyle.Fill;
      tChart1.Click +=tChart1_Click;
      tChart1.Resize += tChart1_Resize;
    }

    void tChart1_Click(object sender, EventArgs e)
    {
      tChart1.Tools.Remove(tool);
    }

    void tChart1_Resize(object sender, EventArgs e)
    {
      if (tool != null)
      {
        tool.Series = num;
      }
    }
  }
Thanks in advance.

Re: After add scrollpager the chart dock property doesn't run

Posted: Fri Feb 14, 2014 8:24 am
by 15654539
It runs for me too, but I I put the " tChart1.Tools.Remove(tool);" in the event of a button and not in the _click event it doesn't run

Re: After add scrollpager the chart dock property doesn't run

Posted: Fri Feb 14, 2014 8:32 am
by narcis
Hi wakeup,

Code below works fine for me here. Can you please attach a simple example project we can run "as-is" and let us know the exact steps we should follow to reproduce the problem here?

Code: Select all

    public Form1()
    {
      InitializeComponent();
      InitializeChart();
    }

    Steema.TeeChart.Styles.Line num;
    ScrollPager tool;

    private void InitializeChart()
    {
      button1.Dock = DockStyle.Bottom;

      num = new Steema.TeeChart.Styles.Line();
      tChart1.Series.Add(num);
      num.FillSampleValues();

      tool = new ScrollPager(tChart1.Chart);
      tool.Series = num;

      tChart1.Dock = DockStyle.Fill;
      tChart1.Resize += tChart1_Resize;
    }

    void tChart1_Resize(object sender, EventArgs e)
    {
      if (tool != null)
      {
        tool.Series = num;
      }
    }

    private void button1_Click(object sender, EventArgs e)
    {
      tChart1.Tools.Remove(tool);
    }
Thanks in advance.

Re: After add scrollpager the chart dock property doesn't run

Posted: Fri Feb 14, 2014 8:37 am
by 15654539
Hi

http://193.145.251.126/pnp/files/DYjQEI ... Scroll.zip

Try this example, press button1 and then button2

Re: After add scrollpager the chart dock property doesn't run

Posted: Fri Feb 14, 2014 9:20 am
by narcis
Hi wakeup,

Thanks for the project. You have 2 options for this to work:

1. Dispose the tool after you remove it:

Code: Select all

          tChart1.Tools.RemoveAt(0);
          tool.Dispose();
2. Use Remove instead of RemoveAt:

Code: Select all

          tChart1.Tools.Remove(tool);

Re: After add scrollpager the chart dock property doesn't run

Posted: Fri Feb 14, 2014 9:38 am
by 15654539
Now it runs. Thanks a lot!