使用Echarts的时候,使用AJAX异步记载数据的时候,出现了 series chart type has not been defined 错误
来源:互联网 发布:手机看cad软件 编辑:程序博客网 时间:2024/04/30 18:15
刚开始使用Echarts的时候,使用AJAX异步记载数据的时候,出现了 series chart type has not been defined 错误
官方实例:
var myChart = echarts.init(document.getElementById('main'));// 显示标题,图例和空的坐标轴myChart.setOption({ title: { text: '异步数据加载示例' }, tooltip: {}, legend: { data:['销量'] }, xAxis: { data: [] }, yAxis: {}, series: [{ name: '销量', type: 'bar', data: [] }]});// 异步加载数据$.get('data.json').done(function (data) { // 填入数据 myChart.setOption({ xAxis: { data: data.categories }, series: [{ // 根据名字对应到相应的系列 name: '销量', data: data.data }] });});
这个错误,是类型没有找到,主要是应为异步加载数据的时候,没有确定的类型,所有,只需要在异步加载数据的时候,再添加一遍类型就OK了
series: [{ // 根据名字对应到相应的系列 type: 'bar', name: '销量', data: data.data}]
阅读全文
0 0
- 使用Echarts的时候,使用AJAX异步记载数据的时候,出现了 series chart type has not been defined 错误
- 使用Vue的时候出现 $index is not defined
- 今天使用Django测试第一个小例子的时候,遇到了NameError: name 'include' is not defined错误
- 使用DataKeys的时候,出现 ArgumentOutOfRangeException错误
- 使用response Redirect时候出现的错误
- 果编译时候出现错误:QMAKESPEC has not been set, so configuration cannot be deduced.
- 今天使用Fragment的时候,出现了这个错误 IllegalStateException: Can not perform this action after onSaveInstanceState
- 在xpage开发的时候出现xsp is not defined的错误
- 自定义View里面的自定义属性的时候报错:Attribute "color" has already been defined
- 在读取数据的时候竟然出现 了 can not re-read column的错误,jdbc的错误
- 在使用一个控件的时候出现Layout cycle detected. Layout could not complete 错误。
- 使用cmake的时候,出现 CMake Error CMAKE_CXX_COMPILER not set错误
- Library not found for -lGTMSessionFetcher 使用Google VR SDK时候出现的错误
- framework中使用了 CateGory 的时候,调用app出现 "selector not recognized"解决方法
- ios framework中使用了 Category 的时候,调用app出现 "selector not recognized"解决方法
- echarts中的option.legend.data has not been defined.
- echarts中的option.legend.data has not been defined.
- Facet开发中对“Project facet has not been defined”错误的解决
- POJ-2046---Gap (bfs+hash)
- C++编程规范(不断更新)
- 北京台历印刷厂家
- 使用sqoop1.99.6将mysql数据导入到hdfs
- 批量替换mysql数据库字段里的字符串
- 使用Echarts的时候,使用AJAX异步记载数据的时候,出现了 series chart type has not been defined 错误
- Ubuntu 14.04 LTS 修改服务器 ssh 端口号
- 缓冲字符copy
- @Transactional(rollbackFor = Exception.class)作用
- c++ 通过socket(网络套接字)传输图片(客户端)
- Material Design整理(五)——NavigationView
- bitmap options.outWidth为-1
- js实现获取页面数据转为Json数据并使用
- HDU1072宽搜