blob: 9e61b2743702ecf33dad9d95f1f3115dee74b2d4 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
|
import React from 'react';
import { createMuiTheme } from '@material-ui/core/styles';
import ThemePallete from 'ba-api/themePalette';
import {
ScatterChart,
Scatter,
XAxis,
YAxis,
ZAxis,
CartesianGrid,
Tooltip,
Legend
} from 'recharts';
import { data8, data9 } from './sampleData';
const theme = createMuiTheme(ThemePallete.orangeTheme);
const color = ({
primary: theme.palette.primary.main,
secondary: theme.palette.secondary.main,
});
function ScatterCustom() {
return (
<ScatterChart
width={800}
height={450}
margin={{
top: 5,
right: 30,
left: 20,
bottom: 5
}}
>
<CartesianGrid />
<XAxis dataKey="x" type="number" name="stature" unit="cm" />
<YAxis dataKey="y" type="number" name="weight" unit="kg" />
<ZAxis range={[100]} />
<Tooltip cursor={{ strokeDasharray: '3 3' }} />
<Legend />
<Scatter name="A school" data={data8} fillOpacity="0.8" fill={color.primary} shape="star" />
<Scatter name="B school" data={data9} fillOpacity="0.8" fill={color.secondary} shape="triangle" />
</ScatterChart>
);
}
export default ScatterCustom;
|