|
|
@@ -120,7 +120,7 @@ function barConfig(model) {
|
|
|
fontSize: getFontSize() * .7
|
|
|
},
|
|
|
axisLabel: {
|
|
|
- rotate: getScreenSize().screenWidth * layout.w / xf.length / 100 < 60 ? 45 : 0,
|
|
|
+ rotate: getScreenSize().width * layout.w / xf.length / 100 < 60 ? 45 : 0,
|
|
|
interval: 0,
|
|
|
textStyle: {
|
|
|
fontSize: getFontSize() * .7
|
|
|
@@ -129,6 +129,7 @@ function barConfig(model) {
|
|
|
}],
|
|
|
yAxis: [{
|
|
|
name: ytitle,
|
|
|
+ nameRotate: .1,
|
|
|
type: ytype == 'numeric' ? 'value' : ytype,
|
|
|
nameTextStyle: {
|
|
|
fontSize: getFontSize() * .7
|
|
|
@@ -184,7 +185,7 @@ function lineConfig(model) {
|
|
|
fontSize: fontSize || getFontSize() * .7
|
|
|
},
|
|
|
axisLabel: {
|
|
|
- rotate: getScreenSize().screenWidth * layout.w / xf.length / 100 < 60 ? 45 : 0,
|
|
|
+ rotate: getScreenSize().width * layout.w / xf.length / 100 < 60 ? 45 : 0,
|
|
|
interval: 0,
|
|
|
textStyle: {
|
|
|
fontSize: fontSize || getFontSize() * .7
|
|
|
@@ -193,6 +194,7 @@ function lineConfig(model) {
|
|
|
}],
|
|
|
yAxis: [{
|
|
|
name: ytitle,
|
|
|
+ nameRotate: .1,
|
|
|
type: ytype == 'numeric' ? 'value' : ytype,
|
|
|
nameTextStyle: {
|
|
|
fontSize: fontSize || getFontSize() * .7
|
|
|
@@ -250,8 +252,8 @@ function getChartsTitle(fontSize, layout, title, subtitle) {
|
|
|
},
|
|
|
left: '50%',
|
|
|
right: '50%',
|
|
|
- itemGap: 0,
|
|
|
- padding: 0
|
|
|
+ itemGap: 5,
|
|
|
+ padding: 10
|
|
|
}
|
|
|
return title;
|
|
|
}
|
|
|
@@ -303,7 +305,7 @@ function getLineSeries(fontSize, series) {
|
|
|
}
|
|
|
|
|
|
function getPieSeries(fontSize, layout, series) {
|
|
|
-
|
|
|
+ let data = series instanceof Array ? series : [series];
|
|
|
const model = {
|
|
|
type: 'pie',
|
|
|
radius: `${layout.w * .7}%`,
|
|
|
@@ -319,7 +321,7 @@ function getPieSeries(fontSize, layout, series) {
|
|
|
}
|
|
|
let s = Object.assign({},model);
|
|
|
s.name = '';
|
|
|
- s.data = series instanceof Array ? series : [series];
|
|
|
+ s.data = data;
|
|
|
return [s];
|
|
|
}
|
|
|
|
|
|
@@ -376,18 +378,20 @@ function parseStr(str) {
|
|
|
|
|
|
function getScreenSize() {
|
|
|
let root = document.getElementById('root');
|
|
|
- let screenHeight = root.offsetHeight;
|
|
|
- let screenWidth = root.offsetWidth;
|
|
|
- return {screenHeight, screenWidth};
|
|
|
+ let height = root.offsetHeight;
|
|
|
+ let width = root.offsetWidth;
|
|
|
+ return {height, width};
|
|
|
}
|
|
|
|
|
|
function getFontSize() {
|
|
|
- let {screenHeight, screenWidth} = getScreenSize();
|
|
|
- if(screenWidth > 800) {
|
|
|
+ let {height, width} = getScreenSize();
|
|
|
+ if(width > 1000) {
|
|
|
+ return 24;
|
|
|
+ }else if(width > 800) {
|
|
|
return 22;
|
|
|
- }else if(screenWidth > 500) {
|
|
|
+ }else if(width > 500) {
|
|
|
return 20;
|
|
|
- }else if(screenWidth > 300) {
|
|
|
+ }else if(width > 300) {
|
|
|
return 18;
|
|
|
}else {
|
|
|
return 16
|