Hi,
I would like to display some text on left top corner in tee chart. Can anyone help me how to do this. As shown in the image below.
Thanks.
How to display some text in Tee chart.
How to display some text in Tee chart.
- Attachments
-
- image.jpg (17.98 KiB) Viewed 14399 times
Re: How to display some text in Tee chart.
Hello bijit,
I think you can use annotation tool to add the titles let-top corner as do in next lines of code:
Could you confirm us if previous code works in your end?
I hope will helps.
Thanks,
I think you can use annotation tool to add the titles let-top corner as do in next lines of code:
Code: Select all
private void AddTitles()
{
tChart1.Draw();
//Create Annotations
anSeries1 = new Steema.TeeChart.Tools.Annotation(tChart1.Chart);
//First Title
anSeries1.Text = "Hello";
anSeries1.Shape.Font.Color = Color.Black;
anSeries1.Shape.Font.Bold = true;
//position
anSeries1.Left = rect.Left;
anSeries1.Top = tChart1.Axes.Right.IStartPos;
anSeries1.Shape.Pen.Visible = false;
anSeries1.Shape.Shadow.Visible = false;
anSeries1.Shape.Brush.Transparency = 100;
}
I hope will helps.
Thanks,
Best Regards,
Sandra Pazos / 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: How to display some text in Tee chart.
Hi sandra,
Thanks for your help. it works well.
regards,
biji
Thanks for your help. it works well.
regards,
biji
Re: How to display some text in Tee chart.
Hi Sandra,
The above code working well to display some text on teechart.
I have a small problem here, how to refresh the text because I have written one text first and when i load another chart data then it has to replace the old text with new text but what happening with the above code is it it was not replacing but it was overwriting the old text. Both text's are displaying at the same place.
could you tel me how to refresh or replace the old text with new?
I have tried withbut still i have same problem.
Thanks,
biji.
The above code working well to display some text on teechart.
I have a small problem here, how to refresh the text because I have written one text first and when i load another chart data then it has to replace the old text with new text but what happening with the above code is it it was not replacing but it was overwriting the old text. Both text's are displaying at the same place.
could you tel me how to refresh or replace the old text with new?
I have tried with
Code: Select all
tChart1.Refresh();
Thanks,
biji.
-
- Guru
- Posts: 1603
- Joined: Fri Nov 15, 2002 12:00 am
Re: How to display some text in Tee chart.
Hello Biji,
Maybe when you load another chart data you are creating two annotation tools, one of which is on top of the other. You could check if you already have an Annotation on the chart by code like this (press the button twice):
if this is not the problem you have, could you please add a little code to your reply so I can reproduce the problem here?
Thank you,
Christopher Ireland.
Maybe when you load another chart data you are creating two annotation tools, one of which is on top of the other. You could check if you already have an Annotation on the chart by code like this (press the button twice):
Code: Select all
Annotation anSeries1;
private void button1_Click(object sender, EventArgs e)
{
if (anSeries1 == null)
{
anSeries1 = new Steema.TeeChart.Tools.Annotation(tChart1.Chart);
//First Title
anSeries1.Text = "Hello";
anSeries1.Shape.Font.Color = Color.Black;
anSeries1.Shape.Font.Bold = true;
//position
anSeries1.Left = 100;
anSeries1.Top = tChart1.Axes.Right.IStartPos;
anSeries1.Shape.Pen.Visible = false;
anSeries1.Shape.Shadow.Visible = false;
anSeries1.Shape.Brush.Transparency = 100;
}
else
{
anSeries1.Text = "New Hello";
}
}
Thank you,
Christopher Ireland.
Re: How to display some text in Tee chart.
Hi Christopher,
yes, your guess was correct. I was creating two annotation tools, but i thought when you refresh chart it will disappear. Now i have used your logic, it works well.
Thanks allot.
biji.
yes, your guess was correct. I was creating two annotation tools, but i thought when you refresh chart it will disappear. Now i have used your logic, it works well.
Thanks allot.
biji.
-
- Guru
- Posts: 1603
- Joined: Fri Nov 15, 2002 12:00 am
Re: How to display some text in Tee chart.
Hello Biji,
You're very welcome.
_/|\_
You're very welcome.
_/|\_
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 |