Page 1 of 1

On chart resizing manage series and tools size

Posted: Sat Feb 07, 2015 9:03 am
by 9526439
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 7314 times
and image2 when screen size is small.
6.png
Image2
6.png (10.53 KiB) Viewed 7313 times
There is any property in teechart to resize whole chart when chart size changes.

Thanks in advance.

Regards
PlanoResearch

Re: On chart resizing manage series and tools size

Posted: Mon Feb 09, 2015 9:12 am
by narcis
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.

Re: On chart resizing manage series and tools size

Posted: Wed Feb 11, 2015 7:36 am
by 9526439
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

Re: On chart resizing manage series and tools size

Posted: Wed Feb 11, 2015 9:31 am
by narcis
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;
      }
    }