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





Similar Topics


Reading This Topic