User (Old forums)MemberMay 25, 2011 at 12:12 amPost count: 23064
Given the data I’m charting, vertical offsets for DataLabels of the predefined “above,” “below,” and “none,” do more to hide the data than highlight it. Is there any way to customize DataLabel positioning?
Imported from legacy forums. Posted by Paul (had 1675 views)Xceed SupportMemberMay 26, 2011 at 3:00 pmPost count: 5658
Hi, Labels are texts that are always displayed on top of all other scene elements.
You can control the position of the label using the HorizontalMargin and VerticalMargin properties, which define an origin point for the displayed text.
In addition, you can tell the label how to align the text relative to this origin point by modifying the HorizontalAlign and VerticalAlign properties of the ChartText object assigned to the label.
The ChartLabelCollection class also possesses two methods called AddHeader and AddFooter, which allow you to add headers and footers with a single function call. When you call one of these functions, the control will initialize the header or footer by setting the margin and align properties to the appropriate values.You can also modify the font, font color, font orientation, backplane style, and fill effect. Finally, you can create transparent labels by modifying the value of the alpha channel of the Color property attached to the ChartText object.
You can find more information in the xceed chart samples, check in particular the “Text and Labels” samples.
Imported from legacy forums. Posted by Michel [Xceed] (had 820 views)User (Old forums)MemberFebruary 10, 2012 at 3:07 amPost count: 23064
I wasn’t the person who asked this question, but I was having the same issue and difficulty solving it.
I understand how to generally format DataLabels for a series, and I understand how to add ChartLabels in the form of headers and footers to the chart, but there doesn’t seem to be a way to adjust the HorizontalMargin for DataLabels, only for the ChartLabels (headers and footers). The “Text and Labels” samples unfortunately only dealt with ChartLabels and not at all with DataLabels, and not in the context of data points.
Is there a way to add individual ChartLabels to data points, or cast DataLabels to ChartLabels so these offsets can be applied? The only way I can think of doing this right now is by adding ChartLabels to the chart, computing a projection of where they should be located to match up near their respective points and whether they should be visible based on the viewport/zoom, and then adjusting that every time the viewport/zoom changes.
Imported from legacy forums. Posted by Paul (had 1489 views)
- You must be logged in to reply to this topic.