fix
This commit is contained in:
parent
af01e68047
commit
7bd832495b
@ -116,33 +116,32 @@ const GeneralItemTimeConv = ({
|
||||
const theme = useTheme();
|
||||
const isMobile = useMediaQuery(theme.breakpoints.down(700));
|
||||
|
||||
const data = Object.entries(general)
|
||||
.sort((a, b) => a[0] - b[0]);
|
||||
const data = Object.entries(general).sort((a, b) => a[0] - b[0]);
|
||||
|
||||
const days = [...data].map(e => e[0])
|
||||
const days = [...data].map((e) => e[0]);
|
||||
|
||||
let buffer = 0
|
||||
let buffer = 0;
|
||||
|
||||
const time = [...data].map(e => {
|
||||
const time = [...data].map((e) => {
|
||||
if (e[1] > 0) {
|
||||
buffer = e[1]
|
||||
buffer = e[1];
|
||||
}
|
||||
return buffer
|
||||
})
|
||||
|
||||
return buffer;
|
||||
});
|
||||
|
||||
console.log("data", data)
|
||||
console.log("time", time.reduce((a, b) => (Number(a) + Number(b)), 0))
|
||||
console.log("time", getCalculatedTime(time.reduce((a, b) => (Number(a) + Number(b)), 0)))
|
||||
console.log("days", days.length)
|
||||
const numberValue = calculateTime ?
|
||||
(
|
||||
(time.reduce((a, b) => (Number(a) + Number(b)), 0))
|
||||
/
|
||||
(days.length)
|
||||
) || 0
|
||||
:
|
||||
conversionValue
|
||||
console.log("data", data);
|
||||
console.log(
|
||||
"time",
|
||||
time.reduce((a, b) => Number(a) + Number(b), 0),
|
||||
);
|
||||
console.log(
|
||||
"time",
|
||||
getCalculatedTime(time.reduce((a, b) => Number(a) + Number(b), 0)),
|
||||
);
|
||||
console.log("days", days.length);
|
||||
const numberValue = calculateTime
|
||||
? time.reduce((a, b) => Number(a) + Number(b), 0) / days.length || 0
|
||||
: conversionValue;
|
||||
|
||||
if (
|
||||
Object.keys(general).length === 0 ||
|
||||
@ -153,7 +152,6 @@ const GeneralItemTimeConv = ({
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
return (
|
||||
<Paper
|
||||
sx={{
|
||||
@ -164,7 +162,9 @@ const GeneralItemTimeConv = ({
|
||||
>
|
||||
<Typography sx={{ margin: "20px 20px 0" }}>{title}</Typography>
|
||||
<Typography sx={{ margin: "10px 20px 0", fontWeight: "bold" }}>
|
||||
{calculateTime ? `${getCalculatedTime(numberValue)} с` : `${numberValue.toFixed(2)}%`}
|
||||
{calculateTime
|
||||
? `${getCalculatedTime(numberValue)} с`
|
||||
: `${numberValue.toFixed(2)}%`}
|
||||
</Typography>
|
||||
<LineChart
|
||||
xAxis={[
|
||||
@ -178,10 +178,11 @@ const GeneralItemTimeConv = ({
|
||||
{
|
||||
data: Object.values(time),
|
||||
valueFormatter: (value) => {
|
||||
console.log("log", value)
|
||||
return calculateTime ? getCalculatedTime(value) : String((value*100).toFixed(2)) + "%"
|
||||
}
|
||||
,
|
||||
console.log("log", value);
|
||||
return calculateTime
|
||||
? getCalculatedTime(value)
|
||||
: String((value * 100).toFixed(2)) + "%";
|
||||
},
|
||||
},
|
||||
]}
|
||||
// dataset={Object.entries(general).map(([, v]) => moment.unix(v).format("ss:mm:HH")).reduce((acc, [k, v]) => ({ ...acc, [k]: v }), {})}
|
||||
@ -196,7 +197,6 @@ const GeneralItemTimeConv = ({
|
||||
);
|
||||
};
|
||||
|
||||
|
||||
export const General: FC<GeneralProps> = ({ data, day }) => {
|
||||
const theme = useTheme();
|
||||
const isTablet = useMediaQuery(theme.breakpoints.down(1000));
|
||||
|
@ -462,10 +462,11 @@ export default function InstallQuiz() {
|
||||
отображаться автоматически после сохранения.
|
||||
</Typography>
|
||||
<Typography>
|
||||
Для установки размера добавьте в тег значения высоты и ширины, например:
|
||||
Для установки размера добавьте в тег значения высоты и
|
||||
ширины, например:
|
||||
</Typography>
|
||||
<Typography>
|
||||
{`<div id="idpena" style="width: 600px;height: 600px;"></div>`}
|
||||
{`<div id="idpena" style="width: 600px;height: 600px;"></div>`}
|
||||
</Typography>
|
||||
</Box>
|
||||
</>
|
||||
|
Loading…
Reference in New Issue
Block a user