The Margin property in data label can be used to customize the space between margins, be it left, right, top or bottom, of the shape and text in data label. The following code example illustrates this. JS $("#container").ejChart({ commonSeriesOptions: { marker: { dataLabel: { visible: true, shape: 'rectangle', fill: 'yellow', offset: 20, margin: { left: 10, right: 10, top: 10, bottom: 10 } } } } }); Screenshot:The following screenshot displays the Chart with 10 pixel space between margins of the shape and text in data label. Figure 1: Margin with Chart JS Playground sample link: Data labels |
This page will automatically be redirected to the sign-in page in 10 seconds.