mirror of
https://github.com/uroni/urbackup_backend.git
synced 2025-10-26 11:36:50 +00:00
Update process speed chart to use new fluentui preview charting library
This commit is contained in:
parent
c209393aee
commit
617573e872
@ -1,15 +1,9 @@
|
||||
import { type IChartProps, Sparkline } from "@fluentui/react-charting";
|
||||
import { Sparkline, ChartProps } from "@fluentui/react-charts-preview";
|
||||
import { tokens } from "@fluentui/react-components";
|
||||
|
||||
import type { ProcessItem } from "../../api/urbackupserver";
|
||||
import { format_speed_bpms_to_bps } from "../../utils/format";
|
||||
|
||||
const sparklineStyles = {
|
||||
valueText: {
|
||||
fill: tokens.colorNeutralForeground1,
|
||||
},
|
||||
};
|
||||
|
||||
export function ProcessSpeedChart(process: ProcessItem) {
|
||||
if (process.speed_bpms === 0 && process.past_speed_bpms.length === 0) {
|
||||
return "-";
|
||||
@ -18,7 +12,7 @@ export function ProcessSpeedChart(process: ProcessItem) {
|
||||
const legend =
|
||||
process.speed_bpms > 0 ? format_speed_bpms_to_bps(process.speed_bpms) : "";
|
||||
|
||||
const data: IChartProps = {
|
||||
const data: ChartProps = {
|
||||
chartTitle: "Speed chart",
|
||||
lineChartData: [
|
||||
{
|
||||
@ -32,5 +26,5 @@ export function ProcessSpeedChart(process: ProcessItem) {
|
||||
],
|
||||
};
|
||||
|
||||
return <Sparkline data={data} showLegend styles={sparklineStyles} />;
|
||||
return <Sparkline data={data} showLegend />;
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user