实现效果如图,上面X值,下面Y值,并且可滚动
首先我们父组件传过来是这样一个对象:
temData中我们需要这两个值,因为根据胶囊按钮选择了
源码:
<template>
<div id="temChart" ref="chartRef" :style="{ height: '244px',width:'1203px', display: chartShow }"></div>
</template>
<script>
import {
Chart } from '@antv/g2'
import F2 from '@antv/f2'
export default {
name: 'TemCharts',
data() {
return {
chartShow: 'none',
allRight: 0,
achart:null
}
},
props: {
chartsData: {
type: Object,
},
},
computed: {
},
mounted() {
this.initChart()