Commit ac8e0215 by zsh

修改学习内容

parent 0214262a
...@@ -348,24 +348,26 @@ export default { ...@@ -348,24 +348,26 @@ export default {
this.visible = flag this.visible = flag
}, },
// 学习内容 // 学习内容
getlearn (data) { getlearn ({ data = {} } = {}) {
const learn = data.data.list || [] const xData = []
const xData = learn.map(v => v.key) const seriesData = []
const Data = learn.map(v => v.value) if (data.list) {
const max = Math.max.apply(null, Data) data.list.forEach(item => {
const maxdata = learn.map(v => { xData.push(item.key)
return ((v.value / max) * 100).toFixed(2) seriesData.push(item.value)
}) })
}
this.learnConfig = { this.learnConfig = {
option: { option: {
base: { base: {
tooltip: { tooltip: {
textStyle: { textStyle: {
color: '#ffffff' color: '#fff'
}, },
formatter: function (params) { formatter: function (params) {
let str let str
learn.forEach((item, l) => { data.list && data.list.forEach((item, l) => {
if (item.key === params[0].name) { if (item.key === params[0].name) {
str = '<span style="display:inline-block;width: 6px;height: 6px;background: linear-gradient(0deg, #1B5BAC 0%, #3680F6 0%, #4BBCF9 100%);border-radius: 50%;" /></span>' + str = '<span style="display:inline-block;width: 6px;height: 6px;background: linear-gradient(0deg, #1B5BAC 0%, #3680F6 0%, #4BBCF9 100%);border-radius: 50%;" /></span>' +
'<span style="padding-left:5px;font-size: 13px;font-family: Century Gothic;font-weight: 400;color: #FFFFFF">' + '<span style="padding-left:5px;font-size: 13px;font-family: Century Gothic;font-weight: 400;color: #FFFFFF">' +
...@@ -381,11 +383,14 @@ export default { ...@@ -381,11 +383,14 @@ export default {
}, },
xAxis: { xAxis: {
data: xData data: xData
} },
yAxis: [{
max: 100
}]
}, },
seriesData: [ seriesData: [
{ {
data: maxdata data: seriesData
} }
] ]
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment