Commit ae9b59a9 authored by 喻春霖's avatar 喻春霖

Merge branch 'master' into 'release'

Master

See merge request !1
parents 9dbeb922 ac01ef73
......@@ -220,7 +220,8 @@
var option = {
tooltip: {
trigger: "item",
formatter: "{a} <br/>{b}: {c}人次 ({d}%)"
formatter: "{a} <br/>{b}: {c}人次 ({d}%)",
position: [20, 20],
},
legend: {
icon: "circle",
......@@ -297,10 +298,11 @@
if (result.data.os.length) {
result.data.os.sort((a, b) => { return b.count - a.count })
}
var others = { name: 'others', value: 0 };
var others = { name: '其他', value: 0 };
var t = 0;
for (var i = 0; i < result.data.os.length; i++) {
var element = result.data.os[i];
if (element.name === 'unknown') element.name = '未知'
if (element.name === 'others' || t >= 4) {
others.value += element.count;
continue;
......@@ -310,17 +312,18 @@
dataSystem.push({ value: element.count, name: element.name })
}
if (others.value) {
legendSystem.push('others');
legendSystem.push('其他');
dataSystem.push(others)
}
if (result.data.browser.length) {
result.data.browser.sort((a, b) => { return b.count - a.count })
}
others = { name: 'others', value: 0 };
others = { name: '其他', value: 0 };
t = 0;
for (var i = 0; i < result.data.browser.length; i++) {
var element = result.data.browser[i];
if (element.name === 'unknown') element.name = '未知'
if (element.name === 'others' || t >= 4) {
others.value += element.count;
continue;
......@@ -330,7 +333,7 @@
dataBrowser.push({ value: element.count, name: element.name })
}
if (others.value) {
legendBroswer.push('others');
legendBroswer.push('其他');
dataBrowser.push(others)
}
......@@ -338,7 +341,8 @@
var optionBrowser = {
tooltip: {
trigger: "item",
formatter: "{a} <br/>{b}: {c}人次 ({d}%)"
formatter: "{a} <br/>{b}: {c}人次 ({d}%)",
position: [20, 20],
},
legend: {
icon: "circle",
......@@ -386,7 +390,8 @@
var optionSystem = {
tooltip: {
trigger: "item",
formatter: "{a} <br/>{b}: {c}人次 ({d}%)"
formatter: "{a} <br/>{b}: {c}人次 ({d}%)",
position: [20, 20],
},
legend: {
icon: "circle",
......@@ -587,7 +592,8 @@
var optionUserType = {
tooltip: {
trigger: "item",
formatter: "{a} <br/>{b}: {c}人次 ({d}%)"
formatter: "{a} <br/>{b}: {c}人次 ({d}%)",
position: [20, 20],
},
legend: {
icon: "circle",
......
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