jquery - Jqplot 线图,具有悬停在线效果

标签 jquery jqplot

我有 jqplot 线图,其中 y 轴作为金额,x 轴作为日期。 我需要详细说明将鼠标悬停在图表线上时显示的金额。 如果有人知道请重播。 谢谢....

最佳答案

您尝试过荧光笔插件吗?

http://www.jqplot.com/deploy/dist/examples/cursor-highlighter.html

<script type="text/javascript" src="../jquery.min.js"></script>
<script type="text/javascript" src="../jquery.jqplot.min.js"></script>
<script type="text/javascript" src="../plugins/jqplot.highlighter.min.js"></script>
<script type="text/javascript" src="../plugins/jqplot.cursor.min.js"></script>
<script type="text/javascript" src="../plugins/jqplot.dateAxisRenderer.min.js"></script>
<link rel="stylesheet" type="text/css" hrf="../jquery.jqplot.min.css" />

$(document).ready(function(){
var line1=[['23-May-08', 578.55], ['20-Jun-08', 566.5], ['25-Jul-08', 480.88], ['22-Aug-08', 509.84],
  ['26-Sep-08', 454.13], ['24-Oct-08', 379.75], ['21-Nov-08', 303], ['26-Dec-08', 308.56],
  ['23-Jan-09', 299.14], ['20-Feb-09', 346.51], ['20-Mar-09', 325.99], ['24-Apr-09', 386.15]];
 var plot1 = $.jqplot('chart1', [line1], {
  title:'Data Point Highlighting',
  axes:{
    xaxis:{
      renderer:$.jqplot.DateAxisRenderer,
      tickOptions:{
        formatString:'%b&nbsp;%#d'
      } 
    },
    yaxis:{
      tickOptions:{
        formatString:'$%.2f'
        }
    }
  },
  highlighter: {
    show: true,
    sizeAdjust: 7.5
  },
  cursor: {
    show: false
  }
 });
});

关于jquery - Jqplot 线图,具有悬停在线效果,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14318453/

相关文章:

jquery - 创建 jQuery 的副本

javascript - Jquery 的代码问题

jquery - 将 jqPlot pointLabels 格式化为货币

javascript - 有没有一种方法可以在我的 jqplot 图中为我的刻度线着色

javascript - 条形太短,不再可见

javascript - 我的按钮不起作用

javascript - 验证两个输入

javascript - 使用模板以表格格式显示数据

javascript - jqplot meter gauge 问题 : c. jqplot 未定义?

javascript - 如何给JQplot饼图添加爆炸效果?