summaryrefslogtreecommitdiff
path: root/src/components/TrafficChartSample.js
diff options
context:
space:
mode:
authorHaishan <[email protected]>2020-06-20 22:28:43 +0800
committerHaishan <[email protected]>2020-06-20 22:28:43 +0800
commit632c6a37350c830902046546fc07ce764ca009a0 (patch)
treeed90e7cef41865732dafe7de22e33a3a1c589927 /src/components/TrafficChartSample.js
parent71a7d8d4c125a5751c94ecb10468994634286425 (diff)
feat: add a simple filter for proxy names
Diffstat (limited to 'src/components/TrafficChartSample.js')
-rw-r--r--src/components/TrafficChartSample.js19
1 files changed, 10 insertions, 9 deletions
diff --git a/src/components/TrafficChartSample.js b/src/components/TrafficChartSample.js
index f59afe7..0723505 100644
--- a/src/components/TrafficChartSample.js
+++ b/src/components/TrafficChartSample.js
@@ -1,19 +1,20 @@
import React, { useMemo } from 'react';
+
import useLineChart from '../hooks/useLineChart';
import {
chartJSResource,
+ chartStyles,
commonDataSetProps,
- chartStyles
} from '../misc/chart';
const extraChartOptions = {
legend: {
- display: false
+ display: false,
},
scales: {
xAxes: [{ display: false }],
- yAxes: [{ display: false }]
- }
+ yAxes: [{ display: false }],
+ },
};
const data1 = [23e3, 35e3, 46e3, 33e3, 90e3, 68e3, 23e3, 45e3];
@@ -30,14 +31,14 @@ export default function TrafficChart({ id }) {
{
...commonDataSetProps,
...chartStyles[id].up,
- data: data1
+ data: data1,
},
{
...commonDataSetProps,
...chartStyles[id].down,
- data: data2
- }
- ]
+ data: data2,
+ },
+ ],
}),
[id]
);
@@ -49,7 +50,7 @@ export default function TrafficChart({ id }) {
<div
style={{
width: 130,
- padding: 5
+ padding: 5,
}}
>
<canvas id={eleId} />