From 70807c84191a47ac814f9c10d1aff6fac1f106b9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Sun, 15 Mar 2020 00:24:22 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Signinstatistics/Signinstatistics.js | 35 +++++++++++++++---- 1 file changed, 28 insertions(+), 7 deletions(-) diff --git a/public/react/src/modules/courses/signin/Signinstatistics/Signinstatistics.js b/public/react/src/modules/courses/signin/Signinstatistics/Signinstatistics.js index 9eedb8e3e..a19eb05c8 100644 --- a/public/react/src/modules/courses/signin/Signinstatistics/Signinstatistics.js +++ b/public/react/src/modules/courses/signin/Signinstatistics/Signinstatistics.js @@ -38,21 +38,23 @@ class Signinstatistics extends Component { if(response.data.history_attendances.length>0){ response.data.history_attendances.map((item,key)=>{ newlists.push({ - // month: item.index, - // month: item.name+" "+item.attendance_date+" "+item.start_time+"-"+item.end_time, - month:item.name, + month: item.index, + name: item.name+" "+item.attendance_date+" "+item.start_time+"-"+item.end_time, + // month:item.name, city:"到课率", temperature: (item.normal_rate*100).toFixed(0) }) newlists.push({ - //month: item.index, - month:item.name, + month: item.index, + name: item.name+" "+item.attendance_date+" "+item.start_time+"-"+item.end_time, + // month:item.name, city: "旷课率", temperature: (item.absence_rate*100).toFixed(0) }) newlists.push({ - //month: item.index, - month:item.name, + month: item.index, + name: item.name+" "+item.attendance_date+" "+item.start_time+"-"+item.end_time, + // month:item.name, city: "请假率", temperature: (item.leave_rate*100).toFixed(0) }) @@ -105,6 +107,9 @@ class Signinstatistics extends Component { let {datas,newlist,course_groups,spal}=this.state; const cols = { + month:{ + range: [0, 1] + }, temperature: { type: 'log', base: 10 @@ -229,6 +234,14 @@ class Signinstatistics extends Component { // color={"city"} shape={"smooth"} color={["city", ["#26C7C9", "#FF835C","#EDBA6F"]]} + tooltip={['name*temperature*city', (name, temperature,city) => { + return { + //自定义 tooltip 上显示的 title 显示内容等。 + name: city, + title: name, + value: temperature+"%" + }; + }]} /> { + // return { + // //自定义 tooltip 上显示的 title 显示内容等。 + // name: 'sold1', + // title: 'dddd' + month, + // value: temperature + // }; + // }]} />