Hello,
I have a split container with three panels. Each panel contains a chart, which fills the entire area. Is there a way to make charts left and width the same? Playing with Width and Left properties does not make any effect.
Thanks.
Set chart inner left and width
-
- Guru
- Posts: 1603
- Joined: Fri Nov 15, 2002 12:00 am
Re: Set chart inner left and width
Hello,
You should be able to use the GetAxesChartRect event as shown in this simple example here.icecream wrote:Hello
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: Set chart inner left and width
Thank you Cristopher!
I was able to do this with the following code:
However, I cannot understand why do X and Width not equal to etalon X and Width every time event handler is triggered? Chart1 size and position are the same.
I was able to do this with the following code:
Code: Select all
protected override void OnLoad(EventArgs e)
{
base.OnLoad(e);
chart2.Chart.GetAxesChartRect += chart23_GetAxesChartRect;
chart3.Chart.GetAxesChartRect += chart23_GetAxesChartRect;
}
void chart23_GetAxesChartRect(object sender, Steema.TeeChart.GetAxesChartRectEventArgs e)
{
Rectangle etalonRect = chart1.Chart.Chart.ChartRect;
if (e.AxesChartRect.X != etalonRect.X || e.AxesChartRect.Width != etalonRect.Width)
{
Rectangle rect = new Rectangle();
rect.X = etalonRect.X;
rect.Y = e.AxesChartRect.Y;
rect.Width = etalonRect.Width;
rect.Height = e.AxesChartRect.Height;
e.AxesChartRect = rect;
}
}