xieziyu / ngx-echarts

An angular (ver >= 2.x) directive for ECharts (ver >= 3.x)
https://xieziyu.github.io/ngx-echarts/
MIT License
1.11k stars 197 forks source link

angular 6 using echart rxjs problem #145

Open sihanwang94 opened 6 years ago

sihanwang94 commented 6 years ago

ERROR TypeError: rxjs_Observable__WEBPACK_IMPORTED_MODULE_1__.Observable.of is not a function at ChangeFilter.push../node_modules/ngx-echarts/ngx-echarts.es5.js.ChangeFilter.notEmpty (ngx-echarts.es5.js:28) at NgxEchartsDirective.push../node_modules/ngx-echarts/ngx-echarts.es5.js.NgxEchartsDirective.ngOnChanges (ngx-echarts.es5.js:103) at checkAndUpdateDirectiveInline (core.js:10101) at checkAndUpdateNodeInline (core.js:11371) at checkAndUpdateNode (core.js:11333) at debugCheckAndUpdateNode (core.js:11970) at debugCheckDirectivesFn (core.js:11930) at Object.eval [as updateDirectives] (SolutionChartComponent.html:2) at Object.debugUpdateDirectives [as updateDirectives] (core.js:11922) at checkAndUpdateView (core.js:11315)

html: <div echarts [options]="options" class="echart">

component: ngOnInit() { const xAxisData = []; const data1 = []; const data2 = [];

  for (let i = 0; i < 100; i++) {
    xAxisData.push('category' + i);
    data1.push((Math.sin(i / 5) * (i / 5 - 10) + i / 6) * 5);
    data2.push((Math.cos(i / 5) * (i / 5 - 10) + i / 6) * 5);
  }

  this.options = {
    legend: {
      data: ['bar', 'bar2'],
      align: 'left'
    },
    tooltip: {},
    xAxis: {
      data: xAxisData,
      silent: false,
      splitLine: {
        show: false
      }
    },
    yAxis: {
    },
    series: [{
      name: 'bar',
      type: 'bar',
      data: data1,
      animationDelay: function (idx) {
        return idx * 10;
      }
    }, {
      name: 'bar2',
      type: 'bar',
      data: data2,
      animationDelay: function (idx) {
        return idx * 10 + 100;
      }
    }],
    animationEasing: 'elasticOut',
    animationDelayUpdate: function (idx) {
      return idx * 5;
    }
  };
}
xieziyu commented 6 years ago

@sihanwang94 Did you update ngx-echarts to latest version?

MatiasChao commented 5 years ago

Hello.

I have the last version of ngx-echarts and the same problem.

Any idea? Thanks !

xieziyu commented 5 years ago

@MatiasChao Please double check if your rxjs is 6.0 or higher.

MatiasChao commented 5 years ago

Hello, how are you?

My version is :

package.json

"rxjs": "^6.3.3", "rxjs-compat": "^6.3.3",

Thanks


De: Xie, Ziyu notifications@github.com Enviado: viernes, 4 de enero de 2019 3:42 Para: xieziyu/ngx-echarts Cc: Matuss; Mention Asunto: Re: [xieziyu/ngx-echarts] angular 6 using echart rxjs problem (#145)

@MatiasChaohttps://github.com/MatiasChao Please double check if your rxjs is 6.0 or higher.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://github.com/xieziyu/ngx-echarts/issues/145#issuecomment-451364445, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AGwUegVm4oewhGPqxUrnxC71zOtKD3G0ks5u_vfngaJpZM4YFlQE.

MatiasChao commented 5 years ago

Any ideas? Thanks

xieziyu commented 5 years ago

@MatiasChao Could you setup a demo github repo to reproduce this issue?