Browse Source

调整K线图样式

master
[liang] 3 years ago
parent
commit
2a492b6be3
  1. 52
      pages/markets/kLine.vue

52
pages/markets/kLine.vue

@ -98,7 +98,7 @@ export default {
}, },
onLoad() { onLoad() {
this.kdata = this.splitData(ktest.JSON); this.kdata = this.splitData(ktest.JSON);
console.log(this.kdata, 1111) // console.log(this.kdata, 1111)
}, },
onShow() { }, onShow() { },
methods: { methods: {
@ -144,6 +144,7 @@ export default {
let kline let kline
export default { export default {
mounted() { mounted() {
console.log('1111',this.kdata);
if (typeof window.echarts === 'function') { if (typeof window.echarts === 'function') {
//this.initEcharts() //this.initEcharts()
} else { } else {
@ -184,8 +185,8 @@ export default {
return result; return result;
}, },
upData(myChart){ upData(myChart){
const upColor = '#00da3c'; const upColor = '#00C873';
const downColor = '#ec0000'; const downColor = '#FF3750';
var chartDom = document.getElementById('kline'); var chartDom = document.getElementById('kline');
var myChart = echarts.init(chartDom); var myChart = echarts.init(chartDom);
var option; var option;
@ -259,15 +260,16 @@ export default {
} }
] ]
}, },
grid: [ grid: [
{ {
left: '10%', left: '10%',
right: '8%', right: '0%',
height: '50%' height: '50%',
backgroundColor:'transparent',
}, },
{ {
left: '10%', left: '10%',
right: '8%', right: '0%',
top: '63%', top: '63%',
height: '16%' height: '16%'
} }
@ -277,7 +279,8 @@ export default {
type: 'category', type: 'category',
data: this.kdata.categoryData, data: this.kdata.categoryData,
boundaryGap: false, boundaryGap: false,
axisLine: { onZero: false }, axisLine: {show: false, onZero: false },
axisTick: { show: false },
splitLine: { show: false }, splitLine: { show: false },
min: 'dataMin', min: 'dataMin',
max: 'dataMax', max: 'dataMax',
@ -301,9 +304,20 @@ export default {
yAxis: [ yAxis: [
{ {
scale: true, scale: true,
axisLine: { show: false },
axisTick: { show: false },
splitArea: { splitArea: {
show: true show: false,
} // areaStyle: {
// color: 'transparency',
// },
},
splitLine: { show: true,
lineStyle: {
// 使
color: ['#211F32']
}
}
}, },
{ {
scale: true, scale: true,
@ -355,6 +369,17 @@ export default {
} }
} }
}, },
{
name: 'Volume',
type: 'bar',
xAxisIndex: 1,
yAxisIndex: 1,
data: this.kdata.volumes,
itemStyle: {
color: upColor,
borderColor: undefined,
},
}
] ]
}), }),
@ -438,6 +463,13 @@ export default {
} }
} }
.kline {
margin-top: 20rpx;
padding-left: 32rpx;
padding-right: 28rpx;
background: #000000;
}
.MarketTrades { .MarketTrades {
.headTitle { .headTitle {
padding-left: 32rpx; padding-left: 32rpx;

Loading…
Cancel
Save