图标插件相关
来源:互联网 发布:python改变turtle颜色 编辑:程序博客网 时间:2024/06/16 15:03
一、使用了Chart.js画折线图,但它自带的响应式调节宽高调节不方便。关闭响应式调节,后采用获取
父元素宽高的方法,动态改变它的宽高。但在窗口变化后,出现了鼠标移入,渲染断层的现象,找不到
原因。。。。。
2017.9.9看到有人是由于第二次绘制时,鼠标移入事件没有被取消所致,有事件再试一下{加入代码}myLineChart.destroy(); myLineChart =myNewChart.Line(data,options); 在第二次绘制之前,调用destroy会注销之前的mousemove事件,就能消除闪烁,
painLineChart();window.onresize = function(){ painLineChart();};function painLineChart() { var $withd=parseInt($(".linechart").css("width")); //获取父级的宽度 console.log($withd); document.getElementById("reportForms").width=$withd-50; document.getElementById("reportForms").height=220; var ctx=$("#reportForms")[0].getContext("2d"); const MONTHS=["1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月"]; var data=[1200,1000,1300,1100,1300,1400,1500,1600,1400,1300,1500,1600]; var reportLineChart = new Chart(ctx, { type: 'line', label:{ display:false }, data: { labels:MONTHS, datasets:[{ backgroundColor:"#fc129d", data:data, label:"报表统计" }] }, options: { label:{ display:false }, title:{ display:false }, responsive: false, } });}
2.使用morris.js做折线图,要先引入raphael.min.js,改变不了提示框下行字体的颜色。。。。
css-----------
.morris-hover{ position:absolute; z-index:1000; background: #666666; color: #fff; text-align: center; opacity: 0.9;}js--------------
line = Morris.Area({ element: 'reportForms', data: [ { period: '2000', received: 4691 }, { period: '2001', received: 8403 }, { period: '2002', received: 15574 }, { period: '2003', received: 18211 }, { period: '2004', received: 19427 }, { period: '2005', received: 16486 }, { period: '2006', received: 14737 }, { period: '2007', received: 5838 }, { period: '2008', received: 5542 }, { period: '2009', received: 15560 }, { period: '2010', received: 18940 }, { period: '2011', received: 11970 }, { period: '2012', received: 17580 }, { period: '2013', received: 17511 }, { period: '2014', received: 12601 }, { period: '2015', received: 13158 } ], xkey: 'period', ykeys: ['received'], labels: ['received'], hideHover: 'auto', fillOpacity: 0.9, pointSize: 1.5, lineColors: ['#fc129d'], resize: true, lineWidth: '1', xLabels:'year', yLabelFormat:function(y){ return parseInt(y)+'元'; }});function redrawLine () { setTimeout(function(){ line.redraw(); }, 100);}
阅读全文
0 0
- 图标插件相关
- svn插件图标含义及问题相关
- eclipse安装adt插件后工具栏不显示android相关图标
- eclipse安装adt插件后工具栏不显示android相关图标
- jquery图标插件jQchart
- chartjs图标插件
- ListView图标相关
- 托盘图标相关
- 相关插件
- JQ图标插件之JQCharts
- sublime text 字体图标插件
- 图标插件性能对比报告
- KODI插件图标显示排列
- sparkline 图标插件(Bootstrap)
- 各种小图标的插件
- 更换插件图标的细节
- 系统托盘图标相关(转)
- 更改金蝶相关图标
- JPEG2000开源库
- HDU1170 格式题
- 【洛谷 P2587】[ZJOI2008]泡泡堂
- 最优二叉树——哈夫曼树
- P2356 弹珠游戏
- 图标插件相关
- 全面升级Android面试之Broadcast receiver面试题集
- 效率至上 区间最值
- SQL Server2016企业版 附全版本key
- windows matlab cpu 测试faster rcnn
- imageloder 的具体使用
- 牛客 题库 统计二进制数中1或0的个数
- 基于opencv的图像拼接(三): 基于stitch类的实时图像拼接
- 有序数组1 2 3 4 5 6 7 8 9查找3的二分查找序列是