| xqd
@@ -106,15 +106,15 @@ Page({
|
|
|
*/
|
|
|
onLoad: function (options) {
|
|
|
app.resetDataFilter()
|
|
|
- api.getByName(this, 'projects/getAll', 'projects', {type: 'drop_menu'});
|
|
|
+ api.getByName(this, 'projects/getAll', 'projects', { type: 'drop_menu' });
|
|
|
},
|
|
|
|
|
|
- changeChartIndex: function(e) {
|
|
|
+ changeChartIndex: function (e) {
|
|
|
var type = e.currentTarget.dataset.type
|
|
|
var chartIndex = this.data.chartIndex
|
|
|
chartIndex = type == '+' ? (chartIndex + 1) : (chartIndex - 1)
|
|
|
- if(chartIndex < 0 || chartIndex > 2) return false;
|
|
|
- this.setData({chartIndex})
|
|
|
+ if (chartIndex < 0 || chartIndex > 2) return false;
|
|
|
+ this.setData({ chartIndex })
|
|
|
this.getChartData()
|
|
|
},
|
|
|
|
| xqd
@@ -187,11 +187,11 @@ Page({
|
|
|
updateChart: function () {
|
|
|
var data = this.data.data
|
|
|
var chartIndex = this.data.chartIndex
|
|
|
- if(chartIndex == 0) {
|
|
|
+ if (chartIndex == 0) {
|
|
|
option.xAxis = [{
|
|
|
type: 'value'
|
|
|
}]
|
|
|
-
|
|
|
+
|
|
|
option.legend = {
|
|
|
data: data.legends,
|
|
|
bottom: 40
|
| xqd
@@ -207,10 +207,21 @@ Page({
|
|
|
}
|
|
|
option.yAxis = [{
|
|
|
type: 'category',
|
|
|
- data: data.names
|
|
|
+ data: data.names,
|
|
|
+ axisLabel: {
|
|
|
+ color: "#000",
|
|
|
+ interval: 0,
|
|
|
+ formatter: function (value) {
|
|
|
+ if (value.length > 4) {
|
|
|
+ return value.substring(0, 4) + "...";
|
|
|
+ } else {
|
|
|
+ return value;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
}];
|
|
|
var values = data.values
|
|
|
-
|
|
|
+
|
|
|
option.series = [{
|
|
|
label: {
|
|
|
show: true
|
| xqd
@@ -230,7 +241,7 @@ Page({
|
|
|
option.xAxis = [{
|
|
|
type: 'value'
|
|
|
}]
|
|
|
-
|
|
|
+
|
|
|
option.legend = {
|
|
|
data: data.legends,
|
|
|
bottom: 40
|
| xqd
@@ -246,10 +257,21 @@ Page({
|
|
|
}
|
|
|
option.yAxis = [{
|
|
|
type: 'category',
|
|
|
- data: data.names
|
|
|
+ data: data.names,
|
|
|
+ axisLabel: {
|
|
|
+ color: "#000",
|
|
|
+ interval: 0,
|
|
|
+ formatter: function (value) {
|
|
|
+ if (value.length > 4) {
|
|
|
+ return value.substring(0, 4) + "...";
|
|
|
+ } else {
|
|
|
+ return value;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
}];
|
|
|
var values = data.values
|
|
|
-
|
|
|
+
|
|
|
option.series = [{
|
|
|
label: {
|
|
|
show: true
|
| xqd
@@ -270,7 +292,7 @@ Page({
|
|
|
option.xAxis = [{
|
|
|
type: 'value'
|
|
|
}]
|
|
|
-
|
|
|
+
|
|
|
option.legend = {
|
|
|
data: data.legends,
|
|
|
bottom: 40
|
| xqd
@@ -283,10 +305,21 @@ Page({
|
|
|
}
|
|
|
option.yAxis = [{
|
|
|
type: 'category',
|
|
|
- data: data.names
|
|
|
+ data: data.names,
|
|
|
+ axisLabel: {
|
|
|
+ color: "#000",
|
|
|
+ interval: 0,
|
|
|
+ formatter: function (value) {
|
|
|
+ if (value.length > 4) {
|
|
|
+ return value.substring(0, 4) + "...";
|
|
|
+ } else {
|
|
|
+ return value;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
}];
|
|
|
var values = data.values
|
|
|
-
|
|
|
+
|
|
|
option.series = [{
|
|
|
label: {
|
|
|
show: true
|