Skip to content

Commit cb54ae7

Browse files
committed
Update to be outside instead of above
1 parent 0e9f1fa commit cb54ae7

File tree

12 files changed

+21
-18
lines changed

12 files changed

+21
-18
lines changed

docs/data/charts/bars/BarLabelPlacement.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ export default function BarLabelPlacement() {
55
<BarChart
66
xAxis={[{ data: ['group A', 'group B', 'group C'] }]}
77
series={[
8-
{ data: [1, 1, -4], barLabel: 'value', barLabelPlacement: 'above' },
8+
{ data: [1, 1, -4], barLabel: 'value', barLabelPlacement: 'outside' },
99
{ data: [2, 0, -1], barLabel: 'value', barLabelPlacement: 'inside' },
1010
{ data: [3, -1, 4], barLabel: 'value' },
1111
]}

docs/data/charts/bars/BarLabelPlacement.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ export default function BarLabelPlacement() {
55
<BarChart
66
xAxis={[{ data: ['group A', 'group B', 'group C'] }]}
77
series={[
8-
{ data: [1, 1, -4], barLabel: 'value', barLabelPlacement: 'above' },
8+
{ data: [1, 1, -4], barLabel: 'value', barLabelPlacement: 'outside' },
99
{ data: [2, 0, -1], barLabel: 'value', barLabelPlacement: 'inside' },
1010
{ data: [3, -1, 4], barLabel: 'value' },
1111
]}

docs/data/charts/bars/BarLabelPlacement.tsx.preview

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<BarChart
22
xAxis={[{ data: ['group A', 'group B', 'group C'] }]}
33
series={[
4-
{ data: [1, 1, -4], barLabel: 'value', barLabelPlacement: 'above' },
4+
{ data: [1, 1, -4], barLabel: 'value', barLabelPlacement: 'outside' },
55
{ data: [2, 0, -1], barLabel: 'value', barLabelPlacement: 'inside' },
66
{ data: [3, -1, 4], barLabel: 'value' },
77
]}

docs/data/charts/bars/bars.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ In the example below, the value of the first series is displayed using the defau
183183

184184
You can also display the labels on top of the bars.
185185
To do so, provide the `barLabelPlacement` prop.
186-
This prop accepts two values: `'inside'` (default) and `'above'`.
186+
This prop accepts two values: `'inside'` (default) and `'outside'`.
187187

188188
{{"demo": "BarLabelPlacement.js"}}
189189

docs/pages/x/api/charts/bar-series.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,10 @@
1212
"description": "'value' | ((item: BarItem, context: BarLabelContext) =&gt; string | null | undefined)"
1313
}
1414
},
15-
"barLabelPlacement": { "type": { "description": "'inside' | 'above'" }, "default": "'inside'" },
15+
"barLabelPlacement": {
16+
"type": { "description": "'inside' | 'outside'" },
17+
"default": "'inside'"
18+
},
1619
"color": { "type": { "description": "string" } },
1720
"colorGetter": {
1821
"type": { "description": "(data: ColorCallbackValue&lt;TValue&gt;) =&gt; string" }

docs/translations/api-docs/charts/bar-label/bar-label.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"componentDescription": "",
33
"propDescriptions": {
44
"barLabelPlacement": {
5-
"description": "The placement of the bar label. It controls whether the label is placed inside the bar or above it."
5+
"description": "The placement of the bar label. It controls whether the label is rendered inside or outside the bar."
66
},
77
"height": { "description": "Height of the bar this label belongs to." },
88
"width": { "description": "Width of the bar this label belongs to." },

docs/translations/api-docs/charts/bar-plot/bar-plot.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"description": "If provided, the function will be used to format the label of the bar. It can be set to &#39;value&#39; to display the current value."
66
},
77
"barLabelPlacement": {
8-
"description": "The placement of the bar label. It controls whether the label is placed inside the bar or above it."
8+
"description": "The placement of the bar label. It controls whether the label is rendered inside or outside the bar."
99
},
1010
"borderRadius": { "description": "Defines the border radius of the bar element." },
1111
"onItemClick": {

docs/translations/api-docs/charts/bar-series.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"description": "If provided, the function will be used to format the label of the bar.<br />It can be set to &#39;value&#39; to display the current value."
77
},
88
"barLabelPlacement": {
9-
"description": "The placement of the bar label.<br />It controls whether the label is placed inside the bar or above it."
9+
"description": "The placement of the bar label.<br />It controls whether the label is rendered inside or outside the bar."
1010
},
1111
"color": {
1212
"description": "Color to use when displaying the series.<br />If <code>colorGetter</code> is provided, it will be used to get the color for each data point instead.<br />Otherwise, this color will be used for all data points in the series."

packages/x-charts/src/BarChart/BarLabel/BarLabel.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,10 +59,10 @@ export type BarLabelProps = Omit<
5959
height: number;
6060
/**
6161
* The placement of the bar label.
62-
* It controls whether the label is placed inside the bar or above it.
62+
* It controls whether the label is rendered inside or outside the bar.
6363
* @default 'inside'
6464
*/
65-
barLabelPlacement?: 'inside' | 'above';
65+
barLabelPlacement?: 'inside' | 'outside';
6666
value: number | null;
6767
};
6868

@@ -95,7 +95,7 @@ BarLabel.propTypes = {
9595
// | These PropTypes are generated from the TypeScript type definitions |
9696
// | To update them edit the TypeScript types and run "pnpm proptypes" |
9797
// ----------------------------------------------------------------------
98-
barLabelPlacement: PropTypes.oneOf(['above', 'inside']),
98+
barLabelPlacement: PropTypes.oneOf(['outside', 'inside']),
9999
classes: PropTypes.object,
100100
dataIndex: PropTypes.number.isRequired,
101101
/**

packages/x-charts/src/BarChart/BarPlot.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -185,9 +185,9 @@ BarPlot.propTypes = {
185185
barLabel: PropTypes.oneOfType([PropTypes.oneOf(['value']), PropTypes.func]),
186186
/**
187187
* The placement of the bar label.
188-
* It controls whether the label is placed inside the bar or above it.
188+
* It controls whether the label is rendered inside or outside the bar.
189189
*/
190-
barLabelPlacement: PropTypes.oneOf(['above', 'inside']),
190+
barLabelPlacement: PropTypes.oneOf(['outside', 'inside']),
191191
/**
192192
* Defines the border radius of the bar element.
193193
*/

0 commit comments

Comments
 (0)