How to use the echarts.init function in echarts

To help you get started, we’ve selected a few echarts examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github zlx362211854 / ICU-charts / src / Component / Bar.js View on Github external
initBarchart = data => {
    const _this = this;
    const cityArr = data.map(i => i.Q1);
    const dom = document.getElementById('icu-bar-charts');
    const myChart = echarts.init(dom);
    const option = {
      title: {
        text: '加班情况统计条形图',
        subtext: '数据来自https://cloudqa.iego.cn/sr/icu996'
      },
      tooltip: {
        trigger: 'axis',
        axisPointer: {
          type: 'shadow'
        },
        formatter: val => {
          const Q4 = val[0]; // 加班情况
          const Q5 = val[1]; // 加班工资
          const Q6 = val[2]; // 加班调休
          return `公司名称:${Q4.name}<br>加班情况:${
            mapReverse[Q4.value]
github tuandm / laravue / resources / js / views / dashboard / admin / components / BarChart.vue View on Github external
initChart() {
      this.chart = echarts.init(this.$el, 'macarons');

      this.chart.setOption({
        tooltip: {
          trigger: 'axis',
          axisPointer: { // Axis indicator, axis trigger is valid
            type: 'shadow', // The default is a straight line, which can be selected as: 'line' | 'shadow'
          },
        },
        grid: {
          top: 10,
          left: '2%',
          right: '2%',
          bottom: '3%',
          containLabel: true,
        },
        xAxis: [{
github 1024-lab / smart-admin / smart-admin-web / src / views / home / components / chart-funnel.vue View on Github external
//   labelLine: {
              //     normal: {
              //       show: false
              //     }
              //   },
              data: [
                { value: 400, name: '交易完成' },
                { value: 300, name: '支付订单' },
                { value: 200, name: '生成订单' },
                { value: 100, name: '放入购物车' },
                { value: 100, name: '浏览网站' }
              ]
            }
          ]
        };
        this.dom = echarts.init(this.$refs.dom, 'tdTheme');
        this.dom.setOption(option);
        on(window, 'resize', this.resize);
      });
    }
github Aaron52077 / erp-admin / src / views / home / components / chart.vue View on Github external
initChart() {
      this.chart = echarts.init(this.$el, 'macarons')
      this.setOptions(this.chartData)
    }
  }
github CS-Tao / GTD-Visualization / src / renderer / components / Charts / ePolyline.vue View on Github external
initChart () {
      this.chart = echarts.init(document.getElementById(this.id))
      var that = this
      this.chart.setOption({
        animationDuration: 5000,
        backgroundColor: this.getColor(this.backgroundColor),
        title: {
          text: this.title,
          top: '8%',
          left: '8%',
          textStyle: {
            color: 'Orange'
          }
        },
        legend: {
          data: this.title,
          textStyle: {
            color: this.getColor(this.textColor)
github hunzhiwange / queryphp / frontend / src / views / dashboard / admin / lineChart.vue View on Github external
initChart() {
      this.chart = echarts.init(this.$el, 'macarons')

      this.chart.setOption({
        xAxis: {
          data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'],
          boundaryGap: false
        },
        grid: {
          left: 10,
          right: 10,
          bottom: 20,
          containLabel: true
        },

        tooltip: {
          trigger: 'axis',
          axisPointer: {
github LianjiaTech / fee / client / src / view / User / online-time / online-time.vue View on Github external
async mounted () {
    this.$dt.behavior('/userbehavior/online_time', '用户在线时长', window.location.href)
    let pic = echart.init(this.$refs.pic)
    this.pic = pic
    this.getLineData()
  }
}
github hustoj / hustoj-neo / resources / assets / js / pages / home.vue View on Github external
function addBarChart(id, config) {
                let el_chart = document.getElementById(id);
                self.charts[id] = echarts.init(el_chart);
                self.charts[id].setOption({
                    title: { text: config.title },
                    tooltip: {},
                    xAxis: {
                        data: config.xTitle
                    },
                    yAxis: {},
                    series: [{
                        name: config.seriesName,
                        type: 'bar',
                        data: config.data
                    }]
                });
            }
            self.allCharts.forEach(function (chart) {
github makegirlsmoe / makegirlsmoe_web / src / components / pages / Stat.js View on Github external
},
                    {
                        name:'Location',
                        type:'pie',
                        radius: ['50%', '70%'],

                        data: Utils.flatMap(data, item =&gt; Object.keys(item.location).map(key =&gt; ({
                            value: item.location[key],
                            name: (item.successful ? 'Successful' : 'Failed') + '_' + key
                        })))
                    }
                ]
            });
        });

        var amountChart = echarts.init(this.charts.amount);
        var amountMin = 1;
        var amountMax = 100;
        StatUtils.getAmount().then(data =&gt; {
            data = data.sort((a, b) =&gt; b._id - a._id);
            var tmp = {};
            var j = 0;
            for (var i = amountMax; i &gt;= amountMin; i--) {
                tmp[i] = tmp[i + 1] || 0;
                for (; (!data[j] || data[j]._id &gt;= i) &amp;&amp; j &lt; data.length; j++) {
                    tmp[i] += data[j].count;
                }
            }
            amountChart.setOption({
                grid: {
                    left: 50
                },