Page 1 of 1

Title of the Point

Posted: Wed Jun 04, 2014 8:02 am
by 9526439
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

Re: Title of the Point

Posted: Wed Jun 04, 2014 8:22 am
by Christopher
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;

    }

Re: Title of the Point

Posted: Wed Jun 04, 2014 10:38 am
by 9526439
Hi
Thanks for the quick response but I need point title same as Image. Means right of the point.

Re: Title of the Point

Posted: Wed Jun 04, 2014 10:39 am
by 9526439
and the point shape should be same as image

Re: Title of the Point

Posted: Thu Jun 05, 2014 10:52 am
by Christopher
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));
      }
    }

Re: Title of the Point

Posted: Mon Jun 30, 2014 2:59 pm
by 9526439
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.

Re: Title of the Point

Posted: Tue Jul 01, 2014 8:21 am
by Christopher
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?

Re: Title of the Point

Posted: Sat Jul 19, 2014 7:52 am
by 9526439
Please look the issue at your end. i will be very thankful.


Thanks

Re: Title of the Point

Posted: Mon Jul 21, 2014 6:47 am
by 9526439
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.

Re: Title of the Point

Posted: Mon Jul 21, 2014 6:48 am
by 9526439
plz look above problem as soon as possible, i am very afraid.

Thanks

Re: Title of the Point

Posted: Mon Jul 21, 2014 9:05 am
by Christopher
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.

Re: Title of the Point

Posted: Mon Jul 21, 2014 10:22 am
by 9526439
if i comment the line-> customMarks.Text = lstCustomPointsSeries.Title; then it works fine but problem is, Point title not displayed.



Thanks

Re: Title of the Point

Posted: Mon Jul 21, 2014 10:33 am
by Christopher
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.

Re: Title of the Point

Posted: Mon Jul 21, 2014 11:03 am
by 9526439
i used


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