JS绘图Flot应用-关于图形绘制中的两个异常
今天再次动手用Flot,但是今天用的时候出现一些问题首次报错的是
网页错误详细信息用户代理: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; QQDownload 721; InfoPath.2)时间戳: Fri, 8 Jun 2012 04:59:50 UTC消息: 'window.G_vmlCanvasManager' 为空或不是对象行: 698字符: 17代码: 0URI: http://localhost:8080/chart/jquery.flot.js
'window.G_vmlCanvasManager' 是什么东西我不知道,不过经过查询知道,报错是因为没有导入
<!--><script language="javascript" type="text/javascript" src="../excanvas.min.js"></script><!-->
之前说过,不同浏览器绘图使用的方式是不一样的,插件也只是根据不同浏览器使用不同绘图方式而已,就像Hibernate一样。
然后又报错
Could not draw pie with labels contained inside canvas
感觉写对了为什么不对呢,其实这是个让人纠结的问题,我看了Demo才知道,绘图的DIV需要引入一个样式,如果没有引入该样式,因为DVI大小不确定就没办法进行绘图!
所以你要增加一个样式
<style type="text/css">* {font-family: sans-serif;}body{padding: 0 1em 1em 1em;}div.graph{width: 400px;height: 300px;float: left;border: 1px dashed gainsboro;}</style>
然后DIV的
<div id="graph1" class="graph"></div>
由于近期大量小网站在未经同意情况下使用文章,现将我的博客地址公布如下,请您到ITEYE网站看原创,谢谢!
http://cuisuqiang.iteye.com/ !
页:
[1]