ICode9

精准搜索请尝试: 精确搜索
首页 > 编程语言> 文章详细

javascript – jquery.flot.dashes.js是否支持plothover和plotclick?

2019-08-30 17:42:25  阅读:248  来源: 互联网

标签:javascript jquery flot hover


我有一个可行的工具提示系统设置与我的常规图形选项(不使用破折号)通过使用plothover事件,但当我切换到我的“黑白”模式(使用破折号)时,情节是不可能的.有没有办法在使用破折号时保持图形可以浏览和可点击?还是一种在没有破折号的情况下制作体面的黑白图案的方法?

示例系列:{data:data,dashes:{show:true,dashLength:2},color:“black”,label:“Series 1”}

我目前的图形选项:

options = {
      yaxis: {max: maxValue, min: minValue},
      grid: {hoverable: true, clickable: true},
      legend: {show: false},
      xaxis: {tickFormatter: null}
  };

我将plothover事件用于这样的工具提示:

$(this).bind(“plotclick”,function(event,pos,item){
   //这里的工具提示代码
}

解决方法:

请参阅jQuery.flot.dashes插件中的this issue填充.

Regarding the hover issue, there’s a function called “findNearbyItem”
in jquery.flot.js that performs the search only if the plot is showing
lines, points or bars. If you only have “dashes” showing, then it
won’t perform the search.

Two choices:
– Modify the jquery.flot.js file in the following line: if (s.lines.show || s.points.show) to something like
if (s.lines.show || s.points.show || s.dashes.show)
– Show points with 0 radius in the series you show dashes: (from the example in comment #41)
{ label: "sin(x)", data: d1, dashes: { show: true, steps:true }, points: {show: true, radius:0 }}

我同意海报,第二个解决方案是一个更好的主意.我也试过了in this fiddle and is works well.

标签:javascript,jquery,flot,hover
来源: https://codeday.me/bug/20190830/1769816.html

本站声明: 1. iCode9 技术分享网(下文简称本站)提供的所有内容,仅供技术学习、探讨和分享;
2. 关于本站的所有留言、评论、转载及引用,纯属内容发起人的个人观点,与本站观点和立场无关;
3. 关于本站的所有言论和文字,纯属内容发起人的个人观点,与本站观点和立场无关;
4. 本站文章均是网友提供,不完全保证技术分享内容的完整性、准确性、时效性、风险性和版权归属;如您发现该文章侵犯了您的权益,可联系我们第一时间进行删除;
5. 本站为非盈利性的个人网站,所有内容不会用来进行牟利,也不会利用任何形式的广告来间接获益,纯粹是为了广大技术爱好者提供技术内容和技术思想的分享性交流网站。

专注分享技术,共同学习,共同进步。侵权联系[81616952@qq.com]

Copyright (C)ICode9.com, All Rights Reserved.

ICode9版权所有