Skip to content

Commit cd0386b

Browse files
committed
update AccidentCountByRoadLight as piechart
1 parent 219336d commit cd0386b

File tree

1 file changed

+17
-5
lines changed

1 file changed

+17
-5
lines changed
Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,24 @@
11
import React, { FC } from 'react';
22
import { IWidgetAccidentCountByRoadLight } from 'models/WidgetData';
3+
import PieChartView from 'components/molecules/PieChartView';
34

5+
const ROAD_LIGHT = 'road_light';
6+
const COUNT = 'count';
7+
const INNER_RADIUS = '40%';
8+
const OUTER_RADIUS = '70%';
49
interface IProps {
5-
data: IWidgetAccidentCountByRoadLight;
6-
segmentText: string;
10+
data: IWidgetAccidentCountByDriverType;
711
}
812

9-
const AccidentCountByRoadLight: FC<IProps> = () => {
10-
return <div> {} </div>;
13+
const AccidentCountByRoadLight: FC<IProps> = ({ data }) => {
14+
return (
15+
<PieChartView
16+
data={data.items}
17+
xLabel={ROAD_TYPE}
18+
yLabel={COUNT}
19+
outerRadius={OUTER_RADIUS}
20+
innerRadius={INNER_RADIUS}
21+
/>
22+
);
1123
};
12-
export default AccidentCountByRoadLight;
24+
export default AccidentCountByRoadLight;

0 commit comments

Comments
 (0)