折线对比图

qianming 4 years ago
parent 335645c370
commit 893f623fbe

@ -61,6 +61,7 @@ export default {
xAxis: [
{//
splitNumber: 2,
show: true,
type: 'value',
inverse: true,
axisLine: {//线
@ -92,6 +93,7 @@ export default {
},
{//
gridIndex: 2,
show: true,
type: 'value',
axisLine: {
show: false,
@ -302,6 +304,7 @@ export default {
const xAxisLeft = {
splitNumber: optionsSetup.splitNumberLeft,
type: 'value',
show : optionsSetup.hideXLeft,
inverse: true,
axisLine: {//X线
show: optionsSetup.xLineLeft,
@ -314,7 +317,7 @@ export default {
},
position: 'bottom',
axisLabel: { // x
show: optionsSetup.hideXLeft,
show: true,
textStyle: {
color: optionsSetup.XcolorLeft,
fontSize: optionsSetup.fontSizeXLeft
@ -337,6 +340,7 @@ export default {
const xAxisRight = {
gridIndex: 2,
splitNumber: optionsSetup.splitNumberRight,
show : optionsSetup.hideXRight,
type: 'value',
axisLine: {//X线
show: optionsSetup.xLineRight,
@ -349,7 +353,7 @@ export default {
},
position: 'bottom',
axisLabel: { // x
show: optionsSetup.hideXRight,
show: true,
textStyle: {
color: optionsSetup.XcolorRight,
fontSize: optionsSetup.fontSizeXRight
@ -444,16 +448,6 @@ export default {
this.options.tooltip = tooltip;
},
//
getOptionsBottom(){
const optionsSetup = this.optionsSetup;
let bottom = optionsSetup.marginBottom;
if (optionsSetup.hideXLeft) {
bottom = optionsSetup.marginBottom + 15
}else if (optionsSetup.hideXRight){
bottom = optionsSetup.marginBottom + 15
}
return bottom
},
setOptionsGrid() {
const optionsSetup = this.optionsSetup;
const grid = [
@ -469,7 +463,7 @@ export default {
show: false,
left: "51%",
top: optionsSetup.marginTop,
bottom: this.getOptionsBottom(),
bottom: optionsSetup.marginBottom + 15,
width: '0%'
},
{//

@ -16,13 +16,27 @@ export default {
data() {
return {
options: {
axisPointer: {
link: {
xAxisIndex: "all",
},
},
title: {
//text: '',
x: 'center',
textStyle: {
color: '#ffffff',
},
},
tooltip: {
show: true,
trigger: "axis",
axisPointer: {
type: "line",
lineStyle: {
type: "dashed",
},
},
},
//
grid: [
{//
@ -52,60 +66,92 @@ export default {
{//
gridIndex: 0,
type: 'category',
boundaryGap: false,
axisLine: { //线
onZero: false,
boundaryGap: true, //
axisLine: { //x线
show: true,
lineStyle: {
color: '#ffffff',
}
},
splitNumber: 2,
inverse: true,
axisTick: {
show: false,
axisTick: { //
show: true,
},
//position: 'bottom',
axisLabel: { // x
axisLabel: { // X
show: true,
textStyle: {
color: '#ffffff',
fontSize: 12
fontSize: 14
}
},
data: []
data: [],
},
{//
gridIndex: 1,
type: 'category',
position: 'top',
boundaryGap: false,
axisLine: {
show: false,
boundaryGap: true, //
axisLine: { // x线
show: true,
lineStyle: {
color: '#ffffff',
}
},
axisTick: {
axisTick: { //
show: true,
},
axisLabel: {
show: false,
},
//position: 'bottom',
data: [],
},
],
yAxis: [
{
gridIndex: 0,
show: true,
scale: true, // 0,false0
axisLabel: {
show: true,
textStyle: {
color: '#ffffff',
fontSize: 12,
fontSize: 14,
},
},
axisLine: { // 线
show: true,
lineStyle: {
color: '#ffffff',
},
},
],
yAxis: [
{
gridIndex: 0,
scale: true,
splitLine: {
show: false,
lineStyle: {
color: '#ffffff',
},
},
},
{
gridIndex: 1,
scale: true,
inverse: true,
scale: false, // 0
inverse: true, //
axisLabel: {
show: true,
textStyle: {
color: '#ffffff',
fontSize: 14,
},
},
axisLine: { // 线
show: true,
lineStyle: {
color: '#ffffff',
},
},
splitLine: {
show: false,
lineStyle: {
color: '#ffffff',
},
},
},
],
@ -115,32 +161,21 @@ export default {
type: 'line',
xAxisIndex: 0,
yAxisIndex: 0,
smooth: true,
barGap: 20,
barWidth: 15,
/*label: {
normal: {
show: true,
color: 'red',
position: 'insideLeft',
textStyle: {
color: '#ffffff',
}
},
emphasis: {
show: false,
},
},
smooth: true, // 线线
itemStyle: {
normal: {
color: '#36c5e7',
barBorderRadius: [8, 0, 0, 8],
},
emphasis: {
show: false,
lineStyle: {
color: '#36c5e7',
width: 2,
},
label: {
position: 'top',
distance: 10,
show: true,
color: '#36c5e7',
fontSize: 14,
},
},*/
data: [],
},
{
@ -148,28 +183,21 @@ export default {
type: 'line',
xAxisIndex: 1,
yAxisIndex: 1,
smooth: true,
barGap: 20,
barWidth: 15,
/*label: {
normal: {
show: true,
color: 'red',
position: 'insideRight',
textStyle: {
color: '#ffffff',
}
},
},
smooth: true, // 线线
itemStyle: {
normal: {
color: '#e68b55',
barBorderRadius: [0, 8, 8, 0],
},
emphasis: {
show: false,
lineStyle: {
color: '#e68b55',
width: 2,
},
label: {
position: 'bottom',
distance: 10,
show: true,
color: '#e68b55',
fontSize: 16,
},
},*/
data: [],
},
]
@ -225,7 +253,7 @@ export default {
this.setOptionsColor();*/
this.setOptionsData();
},
/* // 标题修改
/* // 标题修改
setOptionsTitle() {
const optionsCollapse = this.optionsSetup;
const title = {};
@ -522,6 +550,7 @@ export default {
this.options.series[1]['name'] = arrayList[1].name
this.options.series[1]['data'] = arrayList[1].data
this.options.xAxis[0]['data'] = xAxisList
this.options.xAxis[1]['data'] = xAxisList
},
//
dynamicDataFn(val, refreshTime, optionsSetup) {
@ -543,7 +572,7 @@ export default {
},
renderingFn(optionsSetup, val) {
this.options.yAxis[1]['data'] = val.xAxis
if (val.series[0].type == "bar"){
if (val.series[0].type == "bar") {
this.options.series[0]['name'] = val.series[0].name
this.options.series[0]['data'] = val.series[0].data
this.options.series[1]['name'] = val.series[1].name

@ -180,7 +180,7 @@ export default {
axisLabel: {
show: true,
textStyle: {
color: optionsCollapse.colorY, // x
color: optionsCollapse.colorY, // y
fontSize: optionsCollapse.fontSizeY
}
},

Loading…
Cancel
Save