Search code examples
c#.netlabelpaddingmschart

How to increase the padding of a MSChart Datapoint label


I created a chart control displaying the datapoints values as labels. How can I increase the distance between text and label border (padding) for this label (actually for all labels).

First I considered using SmartLabelStyle property of Series class, but I think this property deals with the relation between each label to another instead of their appearance.

MS Chart

the DataPoints themselves obviously do not provide any options to handle the padding.

maybe I can work with the Font property somehow?

Best regards


Solution

  • If you can do without the border you have, you can do this with a DataPoint point:

    point.LabelBorderWidth = 7;
    point.LabelBorderColor = point.LabelBackColor;