Title of the Point

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
amol
Advanced
Posts: 231
Joined: Tue Mar 29, 2005 5:00 am

Title of the Point

Post by amol » Wed Jun 04, 2014 8:02 am

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
Attachments
2.png
2.png (6.66 KiB) Viewed 23635 times

Christopher
Guru
Posts: 1603
Joined: Fri Nov 15, 2002 12:00 am

Re: Title of the Point

Post by Christopher » Wed Jun 04, 2014 8:22 am

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.
You could try:

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

amol
Advanced
Posts: 231
Joined: Tue Mar 29, 2005 5:00 am

Re: Title of the Point

Post by amol » Wed Jun 04, 2014 10:38 am

Hi
Thanks for the quick response but I need point title same as Image. Means right of the point.

amol
Advanced
Posts: 231
Joined: Tue Mar 29, 2005 5:00 am

Re: Title of the Point

Post by amol » Wed Jun 04, 2014 10:39 am

and the point shape should be same as image

Christopher
Guru
Posts: 1603
Joined: Fri Nov 15, 2002 12:00 am

Re: Title of the Point

Post by Christopher » Thu Jun 05, 2014 10:52 am

amol wrote: Thanks for the quick response but I need point title same as Image. Means right of the point.
amol wrote:and the point shape should be same as image
You could try something like this:

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

amol
Advanced
Posts: 231
Joined: Tue Mar 29, 2005 5:00 am

Re: Title of the Point

Post by amol » Mon Jun 30, 2014 2:59 pm

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.

Christopher
Guru
Posts: 1603
Joined: Fri Nov 15, 2002 12:00 am

Re: Title of the Point

Post by Christopher » Tue Jul 01, 2014 8:21 am

Hello,
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.
Would you be so kind as to produce a short, self contained, correct (compilable) example with which I can reproduce this issue here?
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

amol
Advanced
Posts: 231
Joined: Tue Mar 29, 2005 5:00 am

Re: Title of the Point

Post by amol » Sat Jul 19, 2014 7:52 am

Please look the issue at your end. i will be very thankful.


Thanks

amol
Advanced
Posts: 231
Joined: Tue Mar 29, 2005 5:00 am

Re: Title of the Point

Post by amol » Mon Jul 21, 2014 6:47 am

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.

amol
Advanced
Posts: 231
Joined: Tue Mar 29, 2005 5:00 am

Re: Title of the Point

Post by amol » Mon Jul 21, 2014 6:48 am

plz look above problem as soon as possible, i am very afraid.

Thanks

Christopher
Guru
Posts: 1603
Joined: Fri Nov 15, 2002 12:00 am

Re: Title of the Point

Post by Christopher » Mon Jul 21, 2014 9:05 am

amol wrote:plz look above problem as soon as possible, i am very afraid.

Thanks
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?

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

amol
Advanced
Posts: 231
Joined: Tue Mar 29, 2005 5:00 am

Re: Title of the Point

Post by amol » Mon Jul 21, 2014 10:22 am

if i comment the line-> customMarks.Text = lstCustomPointsSeries.Title; then it works fine but problem is, Point title not displayed.



Thanks

Christopher
Guru
Posts: 1603
Joined: Fri Nov 15, 2002 12:00 am

Re: Title of the Point

Post by Christopher » Mon Jul 21, 2014 10:33 am

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

amol
Advanced
Posts: 231
Joined: Tue Mar 29, 2005 5:00 am

Re: Title of the Point

Post by amol » Mon Jul 21, 2014 11:03 am

i used


g.TextOut(lstCustomPointsSeries.CalcXPos(0), lstCustomPointsSeries.CalcYPos(0), lstCustomPointsSeries.Title); and problem is resolved.

Post Reply