学员学习折线图样式

This commit is contained in:
禺狨 2023-04-20 11:09:59 +08:00
parent 41ef729b3f
commit 922708647e

View File

@ -61,12 +61,12 @@ const MemberLearnPage = () => {
const minuteFormat = (duration: number) => {
if (duration === 0) {
return 0;
return "0小时0分0秒";
}
let h = Math.trunc(duration / 3600);
let m = Math.trunc((duration % 3600) / 60);
let s = Math.trunc((duration % 3600) % 60);
return h + "小时" + m + "分";
return h + "小时" + m + "分" + s + "秒";
};
const renderView = (params: any) => {
@ -75,7 +75,7 @@ const MemberLearnPage = () => {
params.map((item: any) => {
let time = minuteFormat(item.value / 1000);
timeData.push(item.key);
valueData.push(item.value / 1000);
valueData.push(time);
});
let dom: any = chartRef.current;
let myChart = echarts.init(dom);
@ -99,7 +99,8 @@ const MemberLearnPage = () => {
data: timeData,
},
yAxis: {
type: "value",
type: "category",
boundaryGap: false,
},
series: [
{