Commit b7dbf211 authored by 曹雷's avatar 曹雷

fix tooltips position and label

parent 764747d7
...@@ -220,7 +220,8 @@ ...@@ -220,7 +220,8 @@
var option = { var option = {
tooltip: { tooltip: {
trigger: "item", trigger: "item",
formatter: "{a} <br/>{b}: {c}人次 ({d}%)" formatter: "{a} <br/>{b}: {c}人次 ({d}%)",
position: [20, 20],
}, },
legend: { legend: {
icon: "circle", icon: "circle",
...@@ -301,6 +302,7 @@ ...@@ -301,6 +302,7 @@
var t = 0; var t = 0;
for (var i = 0; i < result.data.os.length; i++) { for (var i = 0; i < result.data.os.length; i++) {
var element = result.data.os[i]; var element = result.data.os[i];
if (element.name === 'unknown') element.name = '未知'
if (element.name === 'others' || t >= 4) { if (element.name === 'others' || t >= 4) {
others.value += element.count; others.value += element.count;
continue; continue;
...@@ -321,6 +323,7 @@ ...@@ -321,6 +323,7 @@
t = 0; t = 0;
for (var i = 0; i < result.data.browser.length; i++) { for (var i = 0; i < result.data.browser.length; i++) {
var element = result.data.browser[i]; var element = result.data.browser[i];
if (element.name === 'unknown') element.name = '未知'
if (element.name === 'others' || t >= 4) { if (element.name === 'others' || t >= 4) {
others.value += element.count; others.value += element.count;
continue; continue;
...@@ -338,7 +341,8 @@ ...@@ -338,7 +341,8 @@
var optionBrowser = { var optionBrowser = {
tooltip: { tooltip: {
trigger: "item", trigger: "item",
formatter: "{a} <br/>{b}: {c}人次 ({d}%)" formatter: "{a} <br/>{b}: {c}人次 ({d}%)",
position: [20, 20],
}, },
legend: { legend: {
icon: "circle", icon: "circle",
...@@ -386,7 +390,8 @@ ...@@ -386,7 +390,8 @@
var optionSystem = { var optionSystem = {
tooltip: { tooltip: {
trigger: "item", trigger: "item",
formatter: "{a} <br/>{b}: {c}人次 ({d}%)" formatter: "{a} <br/>{b}: {c}人次 ({d}%)",
position: [20, 20],
}, },
legend: { legend: {
icon: "circle", icon: "circle",
...@@ -587,7 +592,8 @@ ...@@ -587,7 +592,8 @@
var optionUserType = { var optionUserType = {
tooltip: { tooltip: {
trigger: "item", trigger: "item",
formatter: "{a} <br/>{b}: {c}人次 ({d}%)" formatter: "{a} <br/>{b}: {c}人次 ({d}%)",
position: [20, 20],
}, },
legend: { legend: {
icon: "circle", 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