Skip to content

Commit 457d046

Browse files
MikeRyanDevblove
authored andcommitted
01-solution-line-chart
1 parent 0b381b2 commit 457d046

File tree

1 file changed

+26
-3
lines changed

1 file changed

+26
-3
lines changed

src/components/LineChart.tsx

Lines changed: 26 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,34 @@ export default function LineChart(): ReactElement {
1010
const options: AgChartOptions = useMemo(() => {
1111
return {
1212
data,
13-
series: [],
14-
axes: [],
13+
title: {
14+
text: 'Flight Time',
15+
},
16+
series: [
17+
{
18+
type: 'line',
19+
xKey: 'date',
20+
yKey: 'time',
21+
yName: 'Flight Time',
22+
},
23+
],
24+
axes: [
25+
{
26+
type: 'number',
27+
position: 'left',
28+
},
29+
{
30+
type: 'time',
31+
position: 'bottom',
32+
interval: { step: time.month },
33+
label: {
34+
format: '%b %Y',
35+
},
36+
},
37+
],
1538
theme,
1639
};
1740
}, [data]);
1841

19-
return <></>;
42+
return <AgCharts options={options} />;
2043
}

0 commit comments

Comments
 (0)