2条回答 默认 最新
- jingluan666 2020-09-22 14:37关注
这个不是你提的吗,当时不是说这个按钮是重置缩放, https://ask.csdn.net/questions/1095592
用下面例子看下,有没有问题
<!DOCTYPE HTML> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <title>Highcharts Example</title> <script type="text/javascript" src="http://cdn.hcharts.cn/jquery/jquery-1.8.2.min.js"></script> <script src="https://code.highcharts.com/highcharts.js"></script> <style type="text/css"> </style> <script type="text/javascript"> $(function () { var zoomImg; Highcharts.Chart.prototype.showResetZoom = function () { var chart = this; if (!zoomImg) { zoomImg = chart.renderer.image("https://icons.iconarchive.com/icons/ampeross/qetto-2/32/search-icon.png", chart.chartWidth - 100, 10, 32, 32) //src, x, y, width, height .on('click', function () { chart.zoomOut(); $(this).remove(); zoomImg = null; }) .attr({ zIndex: 100 }) .add() } } $('#container').highcharts({ chart: { zoomType: 'x', selectionMarkerFill: 'rgba(0,0,0, 0.2)', resetZoomButton: { // 按钮定位 position: { align: 'right', // by default verticalAlign: 'top', // by default x: 0, y: -30 }, text: 'aaaa', // 按钮样式 theme: { fill: 'white', text: "<img src='https://www.gravatar.com/avatar/35d73b489c80b662f62baccd4f8c4da4?s=32&d=identicon&r=PG&f=1' style='height:50px;width:50px'></img>", style: { color: 'red' }, stroke: 'silver', r: 0, states: { hover: { fill: '#41739D', style: { color: 'green' } }, } } } }, xAxis: { categories: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'] }, series: [{ data: [29.9, 71.5, 106.4, 129.2, 144.0, 176.0, 135.6, 148.5, 216.4, 194.1, 95.6, 54.4] }] }); }); </script> </head> <body> <div id="container" style="min-width: 310px; height: 400px; margin: 0px auto;margin-left:200px;"></div> </body> </html>
解决 无用评论 打赏 举报
悬赏问题
- ¥15 求帮我调试一下freefem代码
- ¥15 R语言Rstudio突然无法启动
- ¥15 关于#matlab#的问题:提取2个图像的变量作为另外一个图像像元的移动量,计算新的位置创建新的图像并提取第二个图像的变量到新的图像
- ¥15 改算法,照着压缩包里边,参考其他代码封装的格式 写到main函数里
- ¥15 用windows做服务的同志有吗
- ¥60 求一个简单的网页(标签-安全|关键词-上传)
- ¥35 lstm时间序列共享单车预测,loss值优化,参数优化算法
- ¥15 Python中的request,如何使用ssr节点,通过代理requests网页。本人在泰国,需要用大陆ip才能玩网页游戏,合法合规。
- ¥100 为什么这个恒流源电路不能恒流?
- ¥15 有偿求跨组件数据流路径图