After add scrollpager the chart dock property doesn't run

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
acastro
Advanced
Posts: 204
Joined: Tue Oct 27, 2009 12:00 am

After add scrollpager the chart dock property doesn't run

Post by acastro » Tue Nov 05, 2013 12:19 pm

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?

Sandra
Site Admin
Site Admin
Posts: 3132
Joined: Fri Nov 07, 2008 12:00 am

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

Post by Sandra » Tue Nov 05, 2013 3:53 pm

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,
Best Regards,
Sandra Pazos / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

acastro
Advanced
Posts: 204
Joined: Tue Oct 27, 2009 12:00 am

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

Post by acastro » Tue Feb 11, 2014 2:16 pm

I have installed the new version of teechart but I see it is not solved yet. What happened?

Thanks

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

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

Post by Narcís » Thu Feb 13, 2014 2:06 pm

Hi wakeup,

As Christopher Ireland commented here, you need to use TChart's Resize event as shown in the bugzilla ticket.
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

acastro
Advanced
Posts: 204
Joined: Tue Oct 27, 2009 12:00 am

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

Post by acastro » Thu Feb 13, 2014 2:52 pm

Ok, now it is resized when the is a scrollpager, but if I remove the ScrollPager the chart doesn't resize...

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

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

Post by Narcís » Thu Feb 13, 2014 2:58 pm

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;
      }
    }
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

acastro
Advanced
Posts: 204
Joined: Tue Oct 27, 2009 12:00 am

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

Post by acastro » Thu Feb 13, 2014 3:09 pm

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...
Attachments
pagescrollerdeleted.png
pagescrollerdeleted.png (19.76 KiB) Viewed 16492 times

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

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

Post by Narcís » Thu Feb 13, 2014 3:16 pm

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.
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

acastro
Advanced
Posts: 204
Joined: Tue Oct 27, 2009 12:00 am

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

Post by acastro » Fri Feb 14, 2014 8:24 am

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

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

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

Post by Narcís » Fri Feb 14, 2014 8:32 am

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.
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

acastro
Advanced
Posts: 204
Joined: Tue Oct 27, 2009 12:00 am

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

Post by acastro » Fri Feb 14, 2014 8:37 am

Hi

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

Try this example, press button1 and then button2

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

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

Post by Narcís » Fri Feb 14, 2014 9:20 am

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);
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

acastro
Advanced
Posts: 204
Joined: Tue Oct 27, 2009 12:00 am

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

Post by acastro » Fri Feb 14, 2014 9:38 am

Now it runs. Thanks a lot!

Post Reply