Skip to content
Original file line number Diff line number Diff line change
Expand Up @@ -83,5 +83,5 @@ export function EChart({
}
}, [loading, theme]);

return <div ref={chartRef} style={{ width: "100em", height: "50em", margin: 'auto', ...style }}/>;
return <div ref={chartRef} style={{ width: "100%", height: "50em", ...style }}/>;
}
Original file line number Diff line number Diff line change
Expand Up @@ -118,4 +118,4 @@ export const checkResponseError = (responses: Awaited<Promise<any>>[]) => {
}
})
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -144,9 +144,10 @@ const DUPieChart: React.FC<PieChartProps> = ({

const eChartsOptions = {
title: {
text: `${byteToSize(subpathSize, 1)} / ${byteToSize(size, 1)}`,
left: 'center',
top: '95%'
text: `${byteToSize(subpathSize, 1)} / ${byteToSize(size, 1)}`,
textAlign: 'center',
top: '95%',
left: '58%',
},
tooltip: {
trigger: 'item',
Expand All @@ -158,10 +159,24 @@ const DUPieChart: React.FC<PieChartProps> = ({
}
},
legend: {
top: '10%',
type: 'scroll',
orient: 'vertical',
left: '0%',
width: '80%'
height: '99%',
width: 150,
left: 0,
top: 0,
tooltip: {
show: true,
formatter: ({ name }) => {
const nameEl = `<strong'>${name}</strong><br>`;
return `${nameEl}`
},
},
textStyle: {
width: 145,
overflow: 'truncate',
ellipsis: '…',
},
},
grid: {

Expand All @@ -170,6 +185,7 @@ const DUPieChart: React.FC<PieChartProps> = ({
{
type: 'pie',
radius: '70%',
center: ['58%', '45%'],
data: pieData.map((value) => {
return {
value: value.value,
Expand All @@ -182,6 +198,14 @@ const DUPieChart: React.FC<PieChartProps> = ({
shadowOffsetX: 0,
shadowColor: 'rgba(0, 0, 0, 0.5)'
}
},
label: {
show: true,
overflow: 'truncate',
width: 100
},
labelLayout: {
hideOverlap: true
}
}
]
Expand All @@ -208,4 +232,4 @@ const DUPieChart: React.FC<PieChartProps> = ({
);
}

export default DUPieChart;
export default DUPieChart;
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ import {
} from 'antd';
import { MenuProps } from 'antd/es/menu';
import {
CloseOutlined,
InfoCircleOutlined,
LeftOutlined,
LoadingOutlined,
Expand Down Expand Up @@ -573,7 +572,8 @@ export class DiskUsage extends React.Component<Record<string, object>, IDUState>
const eChartsOptions = {
title: {
text: `Disk Usage for ${returnPath} (Total Size: ${byteToSize(duResponse.size, 1)})`,
left: 'center'
left: '50%',
textAlign: 'center',
},
tooltip: {
trigger: 'item',
Expand All @@ -592,7 +592,8 @@ export class DiskUsage extends React.Component<Record<string, object>, IDUState>
series: [
{
type: 'pie',
radius: '50%',
radius: '55%',
center: ['50%', '50%'],
data: plotData.map((value) => {
return {
value: value.value,
Expand All @@ -605,6 +606,14 @@ export class DiskUsage extends React.Component<Record<string, object>, IDUState>
shadowOffsetX: 0,
shadowColor: 'rgba(0, 0, 0, 0.5)'
}
},
label: {
show: true,
overflow: 'truncate',
width: 120
},
labelLayout: {
hideOverlap: true
}
}
]
Expand Down Expand Up @@ -670,7 +679,7 @@ export class DiskUsage extends React.Component<Record<string, object>, IDUState>
{(duResponse.size > 0) ?
<div style={{
height: 700,
margin: 'auto',
width: '100%',
marginTop: '5%'
}}>
<EChart
Expand Down
Loading