Title of the Point
Title of the Point
Hi ,
I need to show the title of the point and shape of the point same as attached image. How can i implement this.
Thanks
I need to show the title of the point and shape of the point same as attached image. How can i implement this.
Thanks
- Attachments
-
- 2.png (6.66 KiB) Viewed 23645 times
-
- Guru
- Posts: 1603
- Joined: Fri Nov 15, 2002 12:00 am
Re: Title of the Point
You could try:amol wrote: I need to show the title of the point and shape of the point same as attached image. How can i implement this.
Code: Select all
private void InitializeChart()
{
tChart1.Aspect.View3D = false;
Points point = new Points(tChart1.Chart);
Random rnd = new Random();
for (int i = 0; i < 10; i++)
{
point.Add(i, rnd.Next(10, 100), Convert.ToChar(65 + i) + i.ToString());
}
point.Marks.Visible = true;
point.Marks.Transparent = true;
point.Marks.ArrowLength = 5;
point.Marks.Arrow.Visible = false;
}
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: Title of the Point
Hi
Thanks for the quick response but I need point title same as Image. Means right of the point.
Thanks for the quick response but I need point title same as Image. Means right of the point.
Re: Title of the Point
and the point shape should be same as image
-
- Guru
- Posts: 1603
- Joined: Fri Nov 15, 2002 12:00 am
Re: Title of the Point
amol wrote: Thanks for the quick response but I need point title same as Image. Means right of the point.
You could try something like this:amol wrote:and the point shape should be same as image
Code: Select all
List<SeriesMarks> customMarks = new List<SeriesMarks>();
private void InitializeChart()
{
tChart1.Aspect.View3D = false;
Points point = new Points(tChart1.Chart);
Random rnd = new Random();
for (int i = 0; i < 10; i++)
{
point.Add(i, rnd.Next(10, 100), Convert.ToChar(65 + i) + i.ToString());
customMarks.Add(new SeriesMarks(point));
}
point.Pointer.Style = PointerStyles.Circle;
tChart1.AfterDraw +=tChart1_AfterDraw;
}
void tChart1_AfterDraw(object sender, Graphics3D g)
{
for (int i = 0; i < customMarks.Count; i++)
{
customMarks[i].Text = tChart1[0][i].Label;
customMarks[i].Transparent = true;
customMarks[i].Paint(g, Utils.FromLTRB(tChart1[0].CalcXPos(i), tChart1[0].CalcYPos(i), tChart1[0].CalcXPos(i) + 50, tChart1[0].CalcYPos(i) + 50));
}
}
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: Title of the Point
customMarks.Paint(g, Utils.FromLTRB(tChart1[0].CalcXPos(i), tChart1[0].CalcYPos(i), tChart1[0].CalcXPos(i) + 50, tChart1[0].CalcYPos(i) + 50)); // This line is showing error " object reference not to set an instance of object".
I am saving all the information of chart in list object and close the form. my requirement is, when i open the form then data present in list should show in chart. this time above line gives error.
I am saving all the information of chart in list object and close the form. my requirement is, when i open the form then data present in list should show in chart. this time above line gives error.
-
- Guru
- Posts: 1603
- Joined: Fri Nov 15, 2002 12:00 am
Re: Title of the Point
Hello,
Would you be so kind as to produce a short, self contained, correct (compilable) example with which I can reproduce this issue here?amol wrote:I am saving all the information of chart in list object and close the form. my requirement is, when i open the form then data present in list should show in chart. this time above line gives error.
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: Title of the Point
Please look the issue at your end. i will be very thankful.
Thanks
Thanks
Re: Title of the Point
private void Chart_AfterDraw(object sender, Steema.TeeChart.Drawing.Graphics3D g)
{
for (int i = 0; i < customMarks.Count; i++)
{
if (customMarks.Series[0].Label == lstCustomPointsSeries.Title)
{
customMarks.Transparent = true;
customMarks.Color = Color.DarkBlue;
customMarks.Text = lstCustomPointsSeries.Title;
customMarks.OnTop = true;
// customMarks.Paint(g, Utils.FromLTRB(lstCustomPointsSeries.CalcXPos(0), lstCustomPointsSeries.CalcYPos(0), lstCustomPointsSeries[i].CalcXPos(0) + 75, lstCustomPointsSeries[i].CalcYPos(0) + 15));
customMarks[i].Paint(g);
}
}
}
When i value increment to more than 0 then line -> customMarks[i].Paint(g); method shows g shows null reference exception.
{
for (int i = 0; i < customMarks.Count; i++)
{
if (customMarks.Series[0].Label == lstCustomPointsSeries.Title)
{
customMarks.Transparent = true;
customMarks.Color = Color.DarkBlue;
customMarks.Text = lstCustomPointsSeries.Title;
customMarks.OnTop = true;
// customMarks.Paint(g, Utils.FromLTRB(lstCustomPointsSeries.CalcXPos(0), lstCustomPointsSeries.CalcYPos(0), lstCustomPointsSeries[i].CalcXPos(0) + 75, lstCustomPointsSeries[i].CalcYPos(0) + 15));
customMarks[i].Paint(g);
}
}
}
When i value increment to more than 0 then line -> customMarks[i].Paint(g); method shows g shows null reference exception.
Re: Title of the Point
plz look above problem as soon as possible, i am very afraid.
Thanks
Thanks
-
- Guru
- Posts: 1603
- Joined: Fri Nov 15, 2002 12:00 am
Re: Title of the Point
Using the code example I provided in this message of mine, I'm afraid I cannot make the code you give me compile. Can you please provide me with some code I can run without having to try and modify it?amol wrote:plz look above problem as soon as possible, i am very afraid.
Thanks
Thank you.
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: Title of the Point
if i comment the line-> customMarks.Text = lstCustomPointsSeries.Title; then it works fine but problem is, Point title not displayed.
Thanks
Thanks
-
- Guru
- Posts: 1603
- Joined: Fri Nov 15, 2002 12:00 am
Re: Title of the Point
amol wrote:if i comment the line-> customMarks.Text = lstCustomPointsSeries.Title; then it works fine but problem is, Point title not displayed.
I really want to help you, but I cannot help you until you provide me with some code that I can run here without any need for me to modify it.
Could you please send me a full code example, a short, self-contained, correct (compilable) example as I asked you on the 1st of July?
Thank you.
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: Title of the Point
i used
g.TextOut(lstCustomPointsSeries.CalcXPos(0), lstCustomPointsSeries.CalcYPos(0), lstCustomPointsSeries.Title); and problem is resolved.
g.TextOut(lstCustomPointsSeries.CalcXPos(0), lstCustomPointsSeries.CalcYPos(0), lstCustomPointsSeries.Title); and problem is resolved.