| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108 |
- <template>
- <!-- 气象历史数据 折线统计图 -->
- <view >
- <ui-charts ref="wLineCharts" type="line" :loadingType="0" :ontouch="true" :opts="opts" :chartData="chartData">
- </ui-charts>
- </view>
- </template>
- <script>
- /**
- * 气象历史数据 折线统计图
- * @example <w-line-charts :chartData="chartData"></w-line-charts>
- * @description 统计图官方说明文档 https://www.ucharts.cn
- */
- export default {
- name: 'w-line-charts',
- data() {
- return {
- loading: true,
- opts: {
- color: ["#317afd"],
- padding: [10, 10, 0, 15],
- enableScroll: true,
- legend: {
- position: 'top',
- float: 'left'
- },
- dataLabel: false,
- // dataPointShape: false,
- // dataPointShapeType: 'hollow',
- xAxis: {
- disableGrid: true,
- fontColor: '#999',
- fontSize: 10,
- axisLineColor: '#F4F7F9',
- scrollShow: true,
- itemCount: 5
- },
- yAxis: {
- gridColor: '#F4F7F9',
- gridType: "solid",
- dashLength: 2,
- data: [{
- axisLineColor: '#F4F7F9',
- fontColor: '#999',
- fontSize: 10,
- }]
- },
- extra: {
- line: {
- type: "curve",
- width: 3
- },
- tooltip: {
- showArrow: true,
- gridType: 'dash',
- labelBgColor: '#66ccff',
- gridColor: '#317afd'
- },
- markLine: {
- type: 'dash',
- dashLength: 5,
- data: [{
- lineColor: '#1A6EFE'
- }]
- }
- }
- },
- }
- },
- props: {
- chartData: {
- type: [Array, Object],
- default () {
- return []
- }
- },
- width: {
- type: [Number],
- default: 0
- },
- height: {
- type: [Number],
- default: 0
- },
- },
- watch: {
- chartData: {
- deep: true, // 深度监听
- handler(val) {}
- }
- },
- async mounted() {
- if (!this.width) {
- return;
- }
- // console.log(11);
- // await null;
- // this.$refs['wLineCharts'].cWidth = this.width;
- // this.$refs['wLineCharts'].cHeight = this.height;
- },
- methods: {}
- };
- </script>
- <style lang="scss">
- </style>
|