echarts icon indicating copy to clipboard operation
echarts copied to clipboard

在weex上使用echarts遇到的问题

Open qsy4 opened this issue 9 years ago • 1 comments

我使用的语言是weex: 引用图表在web上能够正常使用,但是使用weex打包生成的文件在ios端上运行却无法显示: 初始化使用的节点: image image 而使用另外一个vue的获取节点方式却报了另外一个错误 image image

下面这个部分是我的代码:

<template>
<div id="myecharts" ref="myEcharts" class="my_echarts"></div>
</template>

<script>
import echarts from 'echarts'
export default {
  data() {
    return {
      chart: null
    }
  },
  props: {
    chartData: {
      type: Array,
      default () {
        return {
        }
      }
    },
    // 绑定div上的唯一id选择选择器
    id: String
  },
  created() {
  },
  mounted() {
    this.$nextTick(() => {
      this.drawChart('myecharts');
    })
  },
  methods: {
    drawChart(id) {
      this.chart = echarts.init(this.$refs.myEcharts.$el);
      // this.chart = echarts.init(document.getElementById(id));
      var option = {
        tooltip: {
          show: true
        },
        legend: {
          data: ['销量']
        },
        xAxis: [{
          type: 'category',
          data: ["衬衫", "羊毛衫", "雪纺衫", "裤子", "高跟鞋", "袜子", "男装"]
        }],
        yAxis: [{
          type: 'value'
        }],
        series: [{
          "name": "销量",
          "type": "bar",
          "data": [5, 20, 40, 10, 10, 20, 100]
        }]
      };
      this.chart.setOption(option)
    }
  }
}
</script>

Expected behaviour [期望结果]

希望能够提供一个方法或建议,让我能够在weex的app上正常渲染tiao图表组件

ECharts option [ECharts配置项]

option = {

}

Other comments [其他信息]

qsy4 avatar Nov 08 '17 11:11 qsy4

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Apr 02 '20 12:04 stale[bot]