Profile Picture

Offsetting Series Labels

Posted By Irina 7 Years Ago
Author
Message
Irina
Question Posted 7 Years Ago
View Quick Profile
Junior Member

Junior Member (21 reputation)Junior Member (21 reputation)Junior Member (21 reputation)Junior Member (21 reputation)Junior Member (21 reputation)Junior Member (21 reputation)Junior Member (21 reputation)Junior Member (21 reputation)Junior Member (21 reputation)

Group: Forum Members
Last Active: 7 Years Ago
Posts: 23, Visits: 306
Hi,
Is it possible to change the position of the series labels? It seems that changing DataLabelStyle.TextStyle.Offset property has no effect.

Nevron Support
Posted 7 Years Ago
View Quick Profile
Supreme Being

Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)

Group: Forum Members
Last Active: Yesterday @ 1:54 AM
Posts: 3,054, Visits: 4,009
Hi Irina,
You need to use the ArrowLength property of the data label style:
point.DataLabelStyle.ArrowLength = new NLength(20, NGraphicsUnit.Point);

Let us know if you have any questions.



Best Regards,
Nevron Support Team



Irina
Posted 7 Years Ago
View Quick Profile
Junior Member

Junior Member (21 reputation)Junior Member (21 reputation)Junior Member (21 reputation)Junior Member (21 reputation)Junior Member (21 reputation)Junior Member (21 reputation)Junior Member (21 reputation)Junior Member (21 reputation)Junior Member (21 reputation)

Group: Forum Members
Last Active: 7 Years Ago
Posts: 23, Visits: 306
Hi,
Thank you for the answer, but I want to offset labels only horizontally (to the right). Is it possible?

Nevron Support
Posted 7 Years Ago
View Quick Profile
Supreme Being

Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)

Group: Forum Members
Last Active: Yesterday @ 1:54 AM
Posts: 3,054, Visits: 4,009
Hi Irina,
Can you please elaborate by sending us a small picture of how the label should be aligned / positioned.


Best Regards,
Nevron Support Team



Irina
Posted 7 Years Ago
View Quick Profile
Junior Member

Junior Member (21 reputation)Junior Member (21 reputation)Junior Member (21 reputation)Junior Member (21 reputation)Junior Member (21 reputation)Junior Member (21 reputation)Junior Member (21 reputation)Junior Member (21 reputation)Junior Member (21 reputation)

Group: Forum Members
Last Active: 7 Years Ago
Posts: 23, Visits: 306
Hi,
I want to show  labels in the middle of the step line segments. Please see the attached image. 



Attachments
LabelPosition.jpg (507 views, 40.00 KB)
Nevron Support
This post has been flagged as an answer
Posted 7 Years Ago
View Quick Profile
Supreme Being

Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)

Group: Forum Members
Last Active: Yesterday @ 1:54 AM
Posts: 3,054, Visits: 4,009
Hi Irina,
You can achieve this with the help of a second point series that has data points offset by 0,5 from the line series points. For example:

   NChart chart = nChartControl1.Charts[0];

   NStepLineSeries line = new NStepLineSeries();
   line.DataLabelStyle.Visible = false;

   line.Values.Add(10);
   line.Values.Add(20);
   line.Values.Add(30);

   chart.Series.Add(line);

   NPointSeries point = new NPointSeries();
   point.Size = new Nevron.GraphicsCore.NLength(0);
   point.UseXValues = true;

   for (int i = 0; i < line.Values.Count - 1; i++)
   {
    point.Values.Add(line.Values[i]);
    point.XValues.Add(i + 0.5);
   }

   chart.Series.Add(point);

Hope this helps - let us know if you meet any problems.


Best Regards,
Nevron Support Team



Irina
Posted 7 Years Ago
View Quick Profile
Junior Member

Junior Member (21 reputation)Junior Member (21 reputation)Junior Member (21 reputation)Junior Member (21 reputation)Junior Member (21 reputation)Junior Member (21 reputation)Junior Member (21 reputation)Junior Member (21 reputation)Junior Member (21 reputation)

Group: Forum Members
Last Active: 7 Years Ago
Posts: 23, Visits: 306
Thank you!



Similar Topics


Reading This Topic