Hi,
I want to text out a string on the right top corner of my TeeChart.
Here is how I would have implemented it :
private void afterDrawChart(object sender, Steema.TeeChart.Drawing.Graphics3D g)
{
int title_width = (int) mChart.Graphics3D.TextWidth("Mon titre");
int x = mChart.Chart.ChartRect.Right - 4 - title_width;
int y = mChart.Chart.ChartRect.Top + 4;
mChart.Graphics3D.TextOut(100, 100, "Mon titre");
}
But this generates me the following error at compilation time:
D:\C#\TChartRapidity\Form1.cs(153): Cannot pass 'Steema.TeeChart.Chart.ChartRect' as ref or out, because 'Steema.TeeChart.Chart.ChartRect' is a marshal-by-reference class
How can I get the information about chartRect top and right position ?
Thanks by advance,
Verane.
Getting ChartRect.Top and ChartRect.Right ?
Hi Verane,
you can do :
you can do :
Code: Select all
private void tChart1_AfterDraw(object sender, Steema.TeeChart.Drawing.Graphics3D g)
{
int title_width = (int) g.TextWidth("Mon titre");
Rectangle cr = tChart1.Chart.ChartRect;
g.TextOut(cr.Right - 4 - title_width, cr.Top + 4, "Mon titre");
}
Pep Jorge
http://support.steema.com
http://support.steema.com