On chart resizing manage series and tools size

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
amol
Advanced
Posts: 231
Joined: Tue Mar 29, 2005 5:00 am

On chart resizing manage series and tools size

Post by amol » Sat Feb 07, 2015 9:03 am

Hi Steema Support,

Is there is any way manage Series size, tools size ,Axis labels size,header text size when we resize the chart.
As shown in image1 with full screen.
5.png
Image1
5.png (73.55 KiB) Viewed 7308 times
and image2 when screen size is small.
6.png
Image2
6.png (10.53 KiB) Viewed 7307 times
There is any property in teechart to resize whole chart when chart size changes.

Thanks in advance.

Regards
PlanoResearch

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

Re: On chart resizing manage series and tools size

Post by Narcís » Mon Feb 09, 2015 9:12 am

Hi PlanoResearch,

No, there's no built-in functionality for that. However, you could implement that in TChart's Resize event. You may also be interested in applying custom themes upon chart resize, see the All Features\Welcome !\Themes\Custom Themes example in the features demo, available at TeeChart's program group.
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

amol
Advanced
Posts: 231
Joined: Tue Mar 29, 2005 5:00 am

Re: On chart resizing manage series and tools size

Post by amol » Wed Feb 11, 2015 7:36 am

Hi Narcis,

Thanks for your reply. I agree with you to use Resize event but what code we should use inside resize event to achieve the same functionality.

Thanks
PlanoResearch

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

Re: On chart resizing manage series and tools size

Post by Narcís » Wed Feb 11, 2015 9:31 am

Hi PlanoResearch,

You can do something as in the example below. This example just changes the LinePen.Width property. You should do the same with other properties you'd like to change or apply a custom theme of your choice.

Code: Select all

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

    private Steema.TeeChart.Styles.Line line1;

    private void InitializeChart()
    {
      Steema.TeeChart.Utils.UseCaches = false;

      tChart1.Dock = DockStyle.Fill;
      tChart1.Aspect.View3D = false;

      line1 = new Steema.TeeChart.Styles.Line(tChart1.Chart);
      line1.LinePen.Width = 10;
      line1.FillSampleValues();

      tChart1.Resize += tChart1_Resize;
    }

    void tChart1_Resize(object sender, EventArgs e)
    {
      int w = tChart1.Width;
      int h = tChart1.Height;

      if ((w > 500) && (h > 400))
      {
        line1.LinePen.Width = 5;
      }
      else
      {
        line1.LinePen.Width = 2;
      }
    }
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

Post Reply