Uncaught Error: Invalide sourceFormat: unknown
at assert (util.js:404:15)
at mountMethods (dataProvider.js:120:9)
at new DefaultDataProvider2 (dataProvider.js:82:5)
at SourceManager2._innerGetDataStore (sourceManager.js:402:30)
at SourceManager2._innerGetDataStore (sourceManager.js:398:35)
at SourceManager2.getSharedDataStore (sourceManager.js:379:17)
at createSeriesData (createSeriesData.js:149:49)
at BarSeriesModel2.getInitialData (BarSeries.js:62:12)
at SeriesModel2.init (Series.js:100:21)
at GlobalModel2.<anonymous> (Global.js:381:28)
原因:赋值给dataset的值是在其他组件异步加载的,第一次赋值时异步还没加载完,所以dataset为空。导致series中的encode对应的字段在dataset中找不到,所以报错。
解决办法:
1、将给option赋值的代码给在settimeout中
2.。。。。。
标签:SourceManager2,dataProvider,bug,dataset,sourceManager,js,echarts,赋值 From: https://www.cnblogs.com/the-big-dipper/p/16807531.html