Sets or returns where the data label should be placed relative to its data point |
public DataLabelPlacementType DataLabelPlacement{ get; set; } |
Public Property DataLabelPlacement() As DataLabelPlacementType |
Set the position of each SeriesDataLabel using the DataLabelPlacementType enum.
If the X or Y property of the DataLabel are set, then the DataLabelPlacement is also set to 'MovedByUser'. |
//--- Create chart Chart chart = ws.Charts.CreateChart(ChartType.Column.Stacked, ws.CreateAnchor(10, 0, 0, 0)); //--- Create data series Series series = chart.SeriesCollection.CreateSeries("A1:A10"); //--- Set the data label position for the first SeriesDataLabel to OutsideEnd series[0].Label.DataLabelPlacement = DataLabelPlacementType.OutsideEnd; |
'--- Create chart Dim chart As Chart = ws.Charts.CreateChart(ChartType.Column.Stacked, ws.CreateAnchor(10, 0, 0, 0)) '--- Create data series Dim series As Series = chart.SeriesCollection.CreateSeries("A1:A10") '--- Set the data label position for the first SeriesDataLabel to OutsideEnd series(0).Label.DataLabelPlacement = DataLabelPlacementType.OutsideEnd |
{example}