Skip to content

Commit eb151d4

Browse files
[docs][charts] Similar introduction on most charts pages (#17374)
1 parent 76e0bfc commit eb151d4

File tree

8 files changed

+37
-27
lines changed

8 files changed

+37
-27
lines changed

docs/data/charts/axis/axis.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -119,9 +119,9 @@ You can change this behavior with the property `reverse`.
119119
You can add a grid in the background of the cartesian chart with the `grid` prop.
120120

121121
It accepts an object with `vertical` and `horizontal` properties.
122-
Setting those properties to `true` will display the grid lines.
122+
Setting those properties to `true` displays the grid lines.
123123

124-
If you use composition you can pass those properties to the `<ChartsGrid />` component.
124+
If you use composition you can pass those as props to the `<ChartsGrid />` component.
125125

126126
```jsx
127127
<BarChart grid={{ vertical: true }}>
@@ -230,7 +230,7 @@ If you would like to reduce clipping due to overflow, you can [apply an angle to
230230
In the following demo, the size of the x- and y-axes is modified to increase the space available for tick labels.
231231

232232
The first and last tick labels may bleed into the margin. If that margin is not enough to display the label, it might be clipped.
233-
To avoid this, you can use the `margin` property to increase the space between the chart and the edge of the container.
233+
To avoid this, you can use the `margin` prop to increase the space between the chart and the edge of the container.
234234

235235
{{"demo": "MarginAndLabelPosition.js"}}
236236

@@ -256,7 +256,7 @@ If you are using composition, you have to provide the axis settings in the `<Cha
256256
It will provide all the scaling properties to its children, and allows you to use `<XAxis/>` and `<YAxis/>` components as children.
257257
Those components require an `axisId` prop to link them to an axis you defined in the `<ChartContainer />`.
258258

259-
You can choose their position with `position` props which accept `'top'`/`'bottom'` for `<XAxis />` and `'left'`/`'right'` for `<YAxis />`.
259+
You can choose their position with `position` prop which accepts `'top'`/`'bottom'` for `<XAxis />` and `'left'`/`'right'` for `<YAxis />`.
260260
Other props are similar to the ones defined in the [previous section](/x/react-charts/axis/#rendering).
261261

262262
{{"demo": "AxisWithComposition.js"}}

docs/data/charts/bars/bars.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ components: BarChart, BarChartPro, BarElement, BarPlot, ChartsGrid, BarLabel
1212

1313
Bar charts series should contain a `data` property containing an array of values.
1414

15-
You can customize bar ticks with the `xAxis`.
15+
You can specify bar ticks with the `xAxis` prop.
1616
This axis might have `scaleType='band'` and its `data` should have the same length as your series.
1717

1818
{{"demo": "BasicBars.js"}}
@@ -111,7 +111,7 @@ It works with any positive value and is properly applied to horizontal layouts,
111111
## Labels
112112

113113
You can display labels on the bars.
114-
To do so, the `BarChart` or `BarPlot` accepts a `barLabel` property.
114+
To do so, the `BarChart` or `BarPlot` accepts a `barLabel` prop.
115115
It can either get a function that gets the bar item and some context.
116116
Or you can pass `'value'` to display the raw value of the bar.
117117

docs/data/charts/funnel/funnel.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ components: FunnelChart, FunnelPlot
1010

1111
## Basics
1212

13-
Funnel charts series should contain a data property containing an array of objects.
13+
Funnel charts series must contain a `data` property containing an array of objects.
1414
Each object corresponds to a section of the funnel.
1515
It must contain a property `value` and can have other optional properties, like `label` and `id`.
1616

@@ -21,7 +21,7 @@ It must contain a property `value` and can have other optional properties, like
2121
The funnel chart displays a legend by default.
2222
The only requirement is to provide a `label` value in the data objects.
2323

24-
To disable the legend, set the `hideLegend` property to `true`.
24+
To disable the legend, set the `hideLegend` prop to `true`.
2525

2626
{{"demo": "FunnelLegend.js"}}
2727

docs/data/charts/heatmap/heatmap.md

+14-6
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,20 @@ components: Heatmap, HeatmapPlot, HeatmapTooltip
1010

1111
## Basics
1212

13-
The Heatmap requires two axes with `data` properties.
14-
Those data defined the x and y categories.
15-
16-
The series `data` is an array of 3-tuples.
17-
The 2 first numbers are respectively the x and y indexes of the cell.
18-
And the third is its value.
13+
Heatmap charts series must contain a `data` property containing an array of 3-tuples.
14+
The first two numbers in each tuple correspond to the x and y indexes of the cell, respectively.
15+
The third number is the value for the given cell.
16+
17+
```jsx
18+
series={[{
19+
data: [
20+
[0, 2, 2.7], // Cell (0, 2) receives the value 2.7
21+
[1, 2, 4.5], // Cell (1, 2) receives the value 4.5
22+
]
23+
}]}
24+
```
25+
26+
You can specify x and y ticks with the `xAxis` and `yAxis` props.
1927

2028
{{"demo": "BasicHeatmap.js"}}
2129

docs/data/charts/legend/legend.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -43,15 +43,15 @@ It can also be moved with the `position: { vertical, horizontal }` property whic
4343
By default, the legend is placed above the charts.
4444

4545
:::warning
46-
The `position` property is only available in the `slotProps`, but not in the `<ChartsLegend />`.
46+
The `position` property is only available in the `slotProps`, but not in the `<ChartsLegend />` props.
4747
In the second case, you are free to place the legend where you want.
4848
:::
4949

5050
{{"demo": "LegendPosition.js", "hideToolbar": true, "bg": "playground"}}
5151

5252
### Hiding
5353

54-
You can hide the legend with the `hideLegend` property of the Chart.
54+
You can hide the legend with the `hideLegend` prop of the Chart.
5555

5656
{{"demo": "HiddenLegend.js"}}
5757

docs/data/charts/lines/lines.md

+6-4
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,13 @@ components: LineChart, LineChartPro, LineElement, LineHighlightElement, LineHigh
1212

1313
### Data format
1414

15-
To plot lines, a series must have a `data` property containing an array of numbers.
16-
This `data` array corresponds to y values.
15+
Line charts series should contain a `data` property containing an array of numbers.
16+
This `data` array corresponds to y-values.
1717

18-
By default, those y values will be associated with integers starting from 0 (0, 1, 2, 3, ...).
19-
To modify the x values, you should provide a `xAxis` with data property.
18+
You can specify x-values with the `xAxis` prop.
19+
This axis can have any `scaleType` and its `data` should have the same length as your series.
20+
21+
By default, those y-values will be associated with integers starting from 0 (0, 1, 2, 3, ...).
2022

2123
{{"demo": "BasicLineChart.js"}}
2224

docs/data/charts/pie/pie.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ components: PieArc, PieArcLabel, PieArcLabelPlot, PieArcPlot, PieChart, PiePlot
1010

1111
## Basics
1212

13-
To plot a pie chart, a series must have a data property containing an array of objects.
14-
Those objects should contain a property `value`.
15-
They can also have a `label` property.
13+
Pie charts series must contain a `data` property containing an array of objects.
14+
Each object corresponds to a slice of the pie.
15+
It must contain a property `value` and can have other optional properties like `label`.
1616

1717
If you plan to update/reorder those data, you should add an `id` property which is used for `key` props.
1818

docs/data/charts/radar/radar.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@ components: RadarChart, RadarGrid, RadarSeriesArea, RadarSeriesMarks, RadarSerie
1010

1111
## Basics
1212

13-
A radar chart is defined by two main props:
13+
Radar charts series should contain a `data` property containing an array of values.
1414

15-
- The `series` prop which provides the values to display thanks to the `data` property.
16-
- The `radar` prop which defines the radar axes.
15+
Radar charts also require a `radar` prop with a `metrics` property containing an array of string or objects.
16+
Each item of this array define a metric of the radar.
1717

1818
{{"demo": "BasicRadar.js"}}
1919

@@ -29,7 +29,7 @@ Radar series support `hideMark` and `fillArea` parameter to modify the rendering
2929

3030
{{"demo": "DemoRadarVisualisation.js"}}
3131

32-
## Axis
32+
## Metrics
3333

3434
The `metrics` property of `radar` takes an array with one item per corner of the radar.
3535
This item can either be:

0 commit comments

Comments
 (0)