Browse Source

[修改]株洲统计分析弹窗大小修改

zhuzhou
陈敬瑜 3 years ago
parent
commit
e6b3652c36
  1. 2
      src/app/statistic-analysis/addUnit/add-unit-one/add-unit-one.component.ts
  2. 39
      src/app/statistic-analysis/addUnit/add-unit-three-bar-details/add-unit-three-bar-details.component.ts
  3. 37
      src/app/statistic-analysis/addUnit/add-unit-two-type-details/add-unit-two-type-details.component.ts
  4. 6
      src/app/statistic-analysis/echarts-data.service.ts

2
src/app/statistic-analysis/addUnit/add-unit-one/add-unit-one.component.ts

@ -205,7 +205,7 @@ export class AddUnitOneComponent implements OnInit {
countall+=this.tishiData[i].count
}
this.res= '<div class="tishi" style=" backgroundColor:rgba(255,255,255,1);width:100%;height:100%;"><div style="padding:10px 0 5px 0"><span style="color:#FFFFFF;font-size:27px;text-align: center;display:block;">'+datas.name+'</span></div>'
this.res+='</br><div style="width:300px;height:100%;padding:0 20px 15px 20px"><table style="width:300px;font-size:16px; color:#FFFFFF;border-collapse:collapse;"cellspacing="0"; >';
this.res+='</br><div style="width:350px;height:100%;padding:0 20px 15px 20px"><table style="width:300px;font-size:16px; color:#FFFFFF;border-collapse:collapse;"cellspacing="0"; >';
this.res+='<thead style="font-size:18px;"><tr>';
this.res+='<td style="text-align:center;width:30%;">名称</td>';
this.res+='<td style="text-align:center;width:30%;">数量</td>'

39
src/app/statistic-analysis/addUnit/add-unit-three-bar-details/add-unit-three-bar-details.component.ts

@ -114,6 +114,36 @@ export class AddUnitThreeBarDetailsComponent implements OnInit {
//return tishiPao
}
axisLabel = {
interval: 0,
//rotate:-30,
textStyle:{
fontSize :18,
color:'#000000'
},
formatter:function(value)
{
var ret = "";//拼接加\n返回的类目项
var maxLength = 2;//每项显示文字个数
var valLength = value.length;//X轴类目项的文字个数
var rowN = Math.ceil(valLength / maxLength); //类目项需要换行的行数
if (rowN > 1)//如果类目项的文字大于3,
{
for (var i = 0; i < rowN; i++) {
var temp = "";//每次截取的字符串
var start = i * maxLength;//开始截取的位置
var end = start + maxLength;//结束截取的位置
//这里也可以加一个是否是最后一行的判断,但是不加也没有影响,那就不加吧
temp = value.substring(start, end) + "\n";
ret += temp; //凭借最终的字符串
}
return ret;
}
else {
return value;
}
}
}//echarts两个字换行
detailPlanEchart
option
detailEcharts(){
@ -134,14 +164,7 @@ export class AddUnitThreeBarDetailsComponent implements OnInit {
id:this.organizationId,
type: 'category',
data:this.zhiNameData,
axisLabel:{
//this.axisLabel,
textStyle:{
fontSize :18,
color:'#000000'
}
}
axisLabel:this.axisLabel
},
yAxis: {
type: 'value',

37
src/app/statistic-analysis/addUnit/add-unit-two-type-details/add-unit-two-type-details.component.ts

@ -106,6 +106,36 @@ export class AddUnitTwoTypeDetailsComponent implements OnInit {
//return tishiPao
}
axisLabel = {
interval: 0,
//rotate:-30,
textStyle:{
fontSize :18,
color:'#000000'
},
formatter:function(value)
{
var ret = "";//拼接加\n返回的类目项
var maxLength = 2;//每项显示文字个数
var valLength = value.length;//X轴类目项的文字个数
var rowN = Math.ceil(valLength / maxLength); //类目项需要换行的行数
if (rowN > 1)//如果类目项的文字大于3,
{
for (var i = 0; i < rowN; i++) {
var temp = "";//每次截取的字符串
var start = i * maxLength;//开始截取的位置
var end = start + maxLength;//结束截取的位置
//这里也可以加一个是否是最后一行的判断,但是不加也没有影响,那就不加吧
temp = value.substring(start, end) + "\n";
ret += temp; //凭借最终的字符串
}
return ret;
}
else {
return value;
}
}
}//echarts两个字换行
detailPlanEchart//echarts实例
detailEcharts(){
@ -127,14 +157,15 @@ export class AddUnitTwoTypeDetailsComponent implements OnInit {
id:this.thisorId,
type: 'category',
data: this.zhongNameData,
axisLabel:{
//this.axisLabel,
axisLabel: this.axisLabel
/* axisLabel:{
this.axisLabel,
textStyle:{
fontSize :18,
color:'#000000'
}
}
} */
},
yAxis: {
type: 'value',

6
src/app/statistic-analysis/echarts-data.service.ts

@ -423,7 +423,7 @@ export class EchartsDataService {
countall+=this.tishiData[i].count
}
this.res= '<div class="tishi" style=" backgroundColor:rgba(255,255,255,1);width:100%;height:100%;"><div style="padding:10px 0 5px 0"><span style="color:#FFFFFF;font-size:27px;text-align: center;display:block;">'+datas.name+'</span></div>'
this.res+='</br><div style="width:300px;height:100%;padding:0 20px 15px 20px"><table style="width:300px;font-size:16px; color:#FFFFFF;border-collapse:collapse;"cellspacing="0"; >';
this.res+='</br><div style="width:400px;height:100%;padding:0 20px 15px 20px"><table style="width:300px;font-size:16px; color:#FFFFFF;border-collapse:collapse;"cellspacing="0"; >';
this.res+='<thead style="font-size:18px;"><tr>';
this.res+='<td style="text-align:center;width:30%;">名称</td>';
this.res+='<td style="text-align:center;width:30%;">数量</td>'
@ -462,7 +462,7 @@ export class EchartsDataService {
countall+=this.tishiData[i].count
}
this.res= '<div class="tishi" style=" backgroundColor:rgba(255,255,255,1);width:100%;height:100%;"><div style="padding:10px 0 5px 0"><span style="color:#FFFFFF;font-size:27px;text-align: center;display:block;">'+datas.name+'</span></div>'
this.res+='</br><div style="width:300px;height:100%;padding:0 20px 15px 20px"><table style="width:300px;font-size:16px; color:#FFFFFF;border-collapse:collapse;"cellspacing="0"; >';
this.res+='</br><div style="width:400px;height:100%;padding:0 20px 15px 20px"><table style="width:300px;font-size:16px; color:#FFFFFF;border-collapse:collapse;"cellspacing="0"; >';
this.res+='<thead style="font-size:18px;"><tr>';
this.res+='<td style="text-align:center;width:30%;">名称</td>';
this.res+='<td style="text-align:center;width:30%;">数量</td>'
@ -516,7 +516,7 @@ export class EchartsDataService {
}
//console.log(this.tishiData)
this.res= '<div class="tishi" style=" backgroundColor:rgba(255,255,255,1);width:100%;height:100%;"><div style="padding:10px 0 5px 0"><span style="color:#FFFFFF;font-size:27px;text-align: center;display:block;">'+datas.name+'</span></div>'
this.res+='</br><div style="width:300px;height:100%;padding:0 20px 15px 20px"><table style="width:300px;font-size:16px; color:#FFFFFF;border-collapse:collapse;"cellspacing="0"; >';
this.res+='</br><div style="width:400px;height:100%;padding:0 20px 15px 20px"><table style="width:300px;font-size:16px; color:#FFFFFF;border-collapse:collapse;"cellspacing="0"; >';
this.res+='<thead style="font-size:18px;"><tr>';
this.res+='<td style="text-align:center;width:30%;">名称</td>';
this.res+='<td style="text-align:center;width:30%;">数量</td>'

Loading…
Cancel
Save