When I have in my chart scrollpager and also custom axis it is not possible to set the margin. Although I go to the chart editor and I put a very big margin it doesn't do anything.
Please find here an example. Press button1 to add scrollpager, and button4 to add custom margin
http://193.145.251.126/pnp/files/pycecb ... Scroll.zip
Thanks
ScrollPager and Custom axis, problem with margins
-
- Guru
- Posts: 1603
- Joined: Fri Nov 15, 2002 12:00 am
Re: ScrollPager and Custom axis, problem with margins
This can be ameliorated by code such as the following:wakeup wrote:When I have in my chart scrollpager and also custom axis it is not possible to set the margin. Although I go to the chart editor and I put a very big margin it doesn't do anything.
Code: Select all
private void button4_Click(object sender, EventArgs e)
{
Steema.TeeChart.Axis customAxis = new Steema.TeeChart.Axis(tChart1.Chart);
customAxis.Title.Visible = true;
customAxis.Visible = true;
customAxis.Automatic = true;
tChart1.Axes.Custom.Add(customAxis);
tChart1.Series[0].CustomVertAxis = customAxis;
//one possibility
//tChart1.Chart.CustomChartRect = false;
//tChart1.Panel.MarginUnits = Steema.TeeChart.PanelMarginUnits.Pixels;
//tChart1.Panel.MarginLeft = 100;
//tChart1.Panel.MarginRight = 100;
//tChart1.Panel.MarginBottom = 200;
//another possibility
tChart1.Chart.CustomChartRect = true;
Rectangle rect = tChart1.Chart.ChartRect;
rect.X += 100;
tChart1.Chart.ChartRect = rect;
}
Best Regards,
Christopher Ireland / Development & Support Steema Software Avinguda Montilivi 33, 17003 Girona, Catalonia Tel: 34 972 218 797 http://www.steema.com |
Instructions - How to post in this forum |
Re: ScrollPager and Custom axis, problem with margins
With the CustomChartRect = true; solution the chart is not resized automatically when the window is resized...
-
- Guru
- Posts: 1603
- Joined: Fri Nov 15, 2002 12:00 am
Re: ScrollPager and Custom axis, problem with margins
This is expected behaviour - when the tChart.Chart.ChartRect is not calculated automatically, that is, when CustomChartRect = true, the size of the chart remains at the size specified by tChart.Chart.ChartRect.wakeup wrote:With the CustomChartRect = true; solution the chart is not resized automatically when the window is resized...
Best Regards,
Christopher Ireland / Development & Support Steema Software Avinguda Montilivi 33, 17003 Girona, Catalonia Tel: 34 972 218 797 http://www.steema.com |
Instructions - How to post in this forum |
Re: ScrollPager and Custom axis, problem with margins
Where is CustomChartRect property in the chart editor?
Do you have any code to calculate the margins , and taking into account if the scrollpager is there or not?
Thanks
Do you have any code to calculate the margins , and taking into account if the scrollpager is there or not?
Thanks
-
- Guru
- Posts: 1603
- Joined: Fri Nov 15, 2002 12:00 am
Re: ScrollPager and Custom axis, problem with margins
It isn't the Chart Editor because it is considered an advanced property for use by the internal TeeChart code and experienced TeeChart developers. If you like, you could add it as an enhancement to http://bugs.teechart.net/.wakeup wrote:Where is CustomChartRect property in the chart editor?
Recalculating the margins can be done in the Resize event, as has been discussed in another recent thread.wakeup wrote: Do you have any code to calculate the margins , and taking into account if the scrollpager is there or not?
Best Regards,
Christopher Ireland / Development & Support Steema Software Avinguda Montilivi 33, 17003 Girona, Catalonia Tel: 34 972 218 797 http://www.steema.com |
Instructions - How to post in this forum |