Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migration of unmigrated content due to installation of a new plugin

Introducedin
4.5.1
4.5.1
Description

Excerpt

Sets or returns where the data label should be placed relative to its data point

Signature
C#
C#
public DataLabelPlacementType DataLabelPlacement{ get; set; }
Signature
vb.net
vb.net
Public Property DataLabelPlacement() As DataLabelPlacementType

Remarks

Set the position of each SeriesDataLabel using the DataLabelPlacementType enum.
Only certain combinations of Placement types and chart types go together. Any invalid combinations will result in an ArgumentException.

Web only
A complete table of valid combinations are available on on the SoftArtisans documentation
A complete table of valid combinations are available on on the SoftArtisans documentation

 

Area

Bar

Bubble

Column

Doughnut

Line

Pie

Radar

Scatter

Above

 

 

Center

(tick)

 

 

Center

(tick)

 

 

Center

(tick)

Auto

 

 

 

 

 

 

Center

(tick)

 

 

Below

 

 

Center

(tick)

 

 

Center

(tick)

 

 

Center

(tick)

Center

 

Center

(tick)

Center

(tick)

Center

(tick)

 

Center

(tick)

Center

(tick)

 

Center

(tick)

Default

Center

(tick)

Center

(tick)

Center

(tick)

Center

(tick)

Center

(tick)

Center

(tick)

Center

(tick)

Center

(tick)

Center

(tick)

InsideBase

 

Center

(tick)

 

Center

(tick)

 

 

 

 

 

InsideEnd

 

Center

(tick)

 

Center

(tick)

 

 

Center

(tick)

 

 

Left

 

 

Center

(tick)

 

 

Center

(tick)

 

 

Center

(tick)

MovedByUser

Center

(tick)

Center

(tick)

Center

(tick)

Center

(tick)

Center

(tick)

Center

(tick)

Center

(tick)

Center

(tick)

Center

(tick)

Right

 

 

Center

(tick)

 

 

Center

(tick)

 

 

Center

(tick)

OutsideEnd

 

Center

(tick)

 

Center

(tick)

 

 

Center

(tick)

 

 

Web only

If the X or Y property of the DataLabel are set, then the DataLabelPlacement is also set to 'MovedByUser'.

Example
Code Block
csharp
csharp
//--- 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;
Code Block
vbnet
vbnet
'--- 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
Scrollbar