-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
update AccidentCountByRoadLight as piechart
- Loading branch information
1 parent
219336d
commit 3608524
Showing
1 changed file
with
16 additions
and
4 deletions.
There are no files selected for viewing
20 changes: 16 additions & 4 deletions
20
src/components/molecules/widgets/AccidentCountByRoadLight.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,24 @@ | ||
import React, { FC } from 'react'; | ||
import { IWidgetAccidentCountByRoadLight } from 'models/WidgetData'; | ||
import PieChartView from 'components/molecules/PieChartView'; | ||
|
||
const ROAD_LIGHT = 'road_light'; | ||
const COUNT = 'count'; | ||
const INNER_RADIUS = '40%'; | ||
const OUTER_RADIUS = '70%'; | ||
interface IProps { | ||
data: IWidgetAccidentCountByRoadLight; | ||
segmentText: string; | ||
} | ||
|
||
const AccidentCountByRoadLight: FC<IProps> = () => { | ||
return <div> {} </div>; | ||
const AccidentCountByRoadLight: FC<IProps> = ({ data }) => { | ||
return ( | ||
<PieChartView | ||
data={data.items} | ||
xLabel={ROAD_LIGHT} | ||
yLabel={COUNT} | ||
outerRadius={OUTER_RADIUS} | ||
innerRadius={INNER_RADIUS} | ||
/> | ||
); | ||
}; | ||
export default AccidentCountByRoadLight; | ||
export default AccidentCountByRoadLight; |