0

我已经和 JQPlot 一起工作了一周左右,现在我正用头撞墙,试图让突出显示工作。我正在加载以下 CSS 和 .js 文件...

jquery.jqplot.min.css
jQueryCombined.css
...其他一些不相关的...

jquery-1.4.2.min.js
jquery-ui-1.8rc3.custom.min.js
jquery.tree.js
fancybox/jquery.fancybox-1.3.1.js
functions.js jquery.calendar
-widget.js
jquery.validate.min.js
validation-additional-methods.js
jquery.form.js
thickbox.js
jquery.jqplot.min.js
插件/jqplot.canvasTextRenderer.min.js
插件/jqplot.canvasAxisLabelRenderer.min.js
插件/jqplot.dateAxisRenderer.min.js
插件/jqplot.canvasAxisTickRenderer.min.js
插件/jqplot.highlighter.min.js
插件/jqplot.cursor .min.js
jquery.pstrength-min.1.2.js
jquery.qtip-1.0.0-rc3.min.js
fileuploader.js

这里是生成图表的 JS:

function plotGraph628() {  var line1 = [[1, 1.366556], [2, 1.317904], [3, 1.406245], [4, 1.590483], [5, 1.716111], [6, 1.815133], [7, 1.92456]];  var line2 = [[1, 1.36964213], [2, 1.35712154], [3, 1.36646157], [4, 1.35650663], [5, 1.54406956], [6, 1.78211369], [7, 1.86560989], [8, 1.94269674], [9, 1.81608062], [10, 2.03318191], [11, 1.58755349], [12, 1.42688531]];  var line3 = [[1, 1.4628504486138], [2, 1.602621125026], [3, 1.7262261361072], [4, 1.942346002723], [5, 2.060941295693], [6, 2.4290269175071], [7, 2.3278644684844], [8, 2.2806395719139], [9, 2.1383304036506], [10, 2.2496371015956], [11, 1.8309307748663], [12, 1.7967678025669]];  var lineM = [[1, -0.065826584463948], [2, -0.17765716461611], [3, -0.18536455300624], [4, -0.18115361641526], [5, -0.1673168936998], [6, -0.25273244733621], [7, -0.1732508373853]];<br /> 
$.jqplot('flot628', [ line1, line2, line3, lineM], {<br />
title: '',<br />
legend:{show:true},<br />
highlighter: {sizeAdjust: 10, tooltipAxes: 'y', showTooltip: true},<br />
cursor: {show: false},<br />
series: [<br />
{ label: 'FY-10', showLine: true, showMarker: true, markerOptions: {style: 'circle'}},<br />
{ label: 'FY-09', showLine: true, showMarker: true, markerOptions: {style: 'diamond'}},<br />
{ label: 'Plan-10', showLine: true, showMarker: true, markerOptions: {style: 'square'}},<br />
{ label: 'Revenue: Total Monthly', yaxis: 'y2axis', showLine: true, showMarker: true, markerOptions: {style: 'filledDiamond'}}],<br />
axes: <br />
  {xaxis: {<br />
    ticks: [[1, "Jan"], [2, "Feb"], [3, "Mar"], [4, "Apr"], [5, "May"], [6, "Jun"], [7, "Jul"], [8, "Aug"], [9, "Sep"], [10, "Oct"], [11, "Nov"], [12, "Dec"]],<br />
    renderer:$.jqplot.CategoryAxisRenderer,<br />
rendererOptions:{tickRenderer:$.jqplot.CanvasAxisTickRenderer},<br />
                                                tickOptions:{<br />
                                    formatString:"%s", <br />
                                    fontSize:"10pt", <br />
                                    fontFamily:"Georgia", <br />
                                    angle:-30<br />
                                    },<br />
                                                labelOptions: {<br />
                                          enableFontSupport: true,<br />
                                          fontFamily: "Georgia",<br />
                                          fontSize: "12pt"<br />
                                        }},<br />
                                 yaxis: {labelRenderer: $.jqplot.CanvasAxisLabelRenderer,<br />
                                                label: "Millions",<br />
                                                tickOptions:{formatString:"%.2f"},<br />
                                                labelOptions: {<br />
                                            enableFontSupport: true,<br />
                                            fontFamily: "Georgia",<br />
                                            fontSize: "12pt"<br />
                                          }},<br />
                                 y2axis: {labelRenderer: $.jqplot.CanvasAxisLabelRenderer,<br />
                                                label: "%",<br />
                                                labelOptions: {<br />
                                            enableFontSupport: true,<br />
                                            fontFamily: "Georgia",<br />
                                            fontSize: "12pt"<br />
                                          }}<br />
                            }}<br />
                )};<br />
<br />
<br />

除了荧光笔之外的所有东西都绝对完美。谁能告诉我在启动并运行此功能时我做错了什么?

4

3 回答 3

5

我知道这是一个旧线程,但对于任何看到它的人来说,他应该有

highlighter:{
show: true}

代替

highligher :{
showTooltip: true}
于 2012-06-28T10:33:48.523 回答
5

我看到的唯一可能是一个明显的问题是您没有启用插件。在您的 $.jqplot 行之前,您需要:

$.jqplot.config.enablePlugins = true;

有关荧光笔的更多详细信息,请参阅文档页面的最顶部

于 2010-11-06T04:15:57.640 回答
1

对我来说,如果我定义 series 或 seriesColors 选项,荧光笔不起作用。实际上有效,但仅适用于随机(可能是第一个)系列。

于 2011-05-05T14:59:21.500 回答