How to dynamically set DataLabelStyle position


Author
Message
Nevron Support
Nevron Support
Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)
Group: Administrators
Posts: 3.1K, Visits: 4.1K
Hi Jerry,
Yes - you can assign a data label style per data point:

   NBarSeries bar = new NBarSeries();

   bar.Values.Add(10);
   bar.Values.Add(-10);

   NDataLabelStyle dls1 = new NDataLabelStyle();
   dls1.ArrowLength = new NLength(10);
   bar.DataLabelStyles[0] = dls1;

   NDataLabelStyle dls2 = new NDataLabelStyle();
   dls2.ArrowLength = new NLength(-10);
   bar.DataLabelStyles[1] = dls2;


Hope this helps - let us know if you have any questions.


Best Regards,
Nevron Support Team


jerry tovar
jerry tovar
Forum Newbie (0 reputation)Forum Newbie (0 reputation)Forum Newbie (0 reputation)Forum Newbie (0 reputation)Forum Newbie (0 reputation)Forum Newbie (0 reputation)Forum Newbie (0 reputation)Forum Newbie (0 reputation)Forum Newbie (0 reputation)
Group: Forum Members
Posts: 2, Visits: 5
I have a Nevron bar chart that displays the value for each datapoint in each bar.

The problem that I have is that some labels in the bar have a low value and the label displays below the x axis while the other larger values display fine in their bar.

I set the arrowlength like so:
series.DataLabelStyle.ArrowLength = new NLength(-10);  //this displays the larger values fine

Is there a way to set the ArrowLength based on the value that is going to be shown in the bar? Like so:

If (value <= 50)
{
series.DataLabelStyle.ArrowLength = new NLength(+20)
}
else
{
series.DataLabelStyle.ArrowLength = new NLength(-10)
}


GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Similar Topics

Reading This Topic
2 active, 2 guests, 0 members, 0 anonymous
No members currently viewing this topic!

Login

Explore
Messages
Mentions
Search