股票--分时图

版权声明:yx全栈学习 https://blog.csdn.net/qq_43671996/article/details/86477361

<template>

<div class="Minute">

<div id="Minute" style="width:100%;height:4.5rem;"></div>

</div>

</template>

<script>

import echarts from 'echarts'

export default {

扫描二维码关注公众号,回复: 5008080 查看本文章

name: 'Minute',

data () {

return {

data: [1, 3, 4, 1],

dates: ['09:00', '', '', '', '', '', '', '', '11:30/13:00', '', '', '', '', '', '', '', '', '', '', '15:00']

}

},

mounted () {

var myChart = echarts.init(document.getElementById('Minute'))

var option = {

tooltip: {

trigger: 'axis',

axisPointer: {

type: 'cross',

label: {

backgroundColor: '#283b56'

}

}

},

xAxis: [

{

type: 'category',

boundaryGap: false,

data: this.dates,

interval: 120,

axisTick: {

length: 0

},

axisLabel: {

interval: 0,

show: true,

showMinLabel: true,

showMaxLabel: true

}

}

],

yAxis: [

{

type: 'value',

scale: true,

interval: 3,

// position: 'top',

// offset: 20,

boundaryGap: false,

axisLabel: {

inside: true,

// margin: 5,

textStyle: {

height: '50',

color: '#999',

fontSize: '10px'

}

},

splitLine: {

show: false

},

axisTick: {

show: false

}

}

],

grid: {

top: '15%',

// bottom: '5%',

left: '5%',

right: '5%'

},

series: [

{

name: '',

type: 'candlestick',

symbol: 'none',

smooth: true,

showSymbol: false,

data: []

},

{

name: '',

type: 'line',

showSymbol: false,

lineStyle: {

normal: {

color: '#62bff9',

border: '0.1'

}

},

areaStyle: {

normal: {

color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{

offset: 0, color: '#09e1e4'

}, {

offset: 1, color: '#b2f3f4'

}], false)

}

},

data: this.data

}

],

animation: false

}

setInterval(function () {

myChart.setOption(option)

}, 1000)

},

methods: {

}

}

</script>

<style>

</style>

猜你喜欢

转载自blog.csdn.net/qq_43671996/article/details/86477361