在PieChart中使用HIghlighter:jQplot(Use of HIghlighter in PieChart : jQplot)
我想将Highlighter功能用于PieChart。 我的代码是
function device_ownership_graph(titleOfGraph, corporateOwned, corporateShared, employeeOwned) { var arrCorporateOwned = [ 'Corporate-Owned', corporateOwned ]; var arrCorporateShared = [ 'Corporate-Shared', corporateShared ]; var arrEmployeeOwned = [ 'Employee-Owned', employeeOwned ]; $.jqplot.config.enablePlugins = true; /*Here we construct graph*/ $.jqplot('device_ownership_graph', [ [ arrCorporateOwned, arrCorporateShared, arrEmployeeOwned ] ], { title : { text : titleOfGraph, // title for the plot, show : true, fontSize : 14, textColor : '#808080', textAlign : 'center' }, seriesColors : [ "#00b0f0", "#ffc000", "#92d050"], seriesDefaults : { // Make this a pie chart. renderer : jQuery.jqplot.PieRenderer, shadow: false, rendererOptions : { // Put data labels on the pie slices. // By default, labels show the percentage of the slice. showDataLabels : true, startAngle: 90, sliceMargin: 1, //highlightMouseOver: true highlightMouseDown: true } }, legend : { renderer : $.jqplot.PieLegendRenderer, show : true, rendererOptions : { numberRows : 1, numberColumns : 3, disableIEFading : false }, location : 'n', placement : 'outsideGrid', marginTop : '0px', marginBottom : '0px' }, grid : { drawGridlines: false, show : true, background : 'transparent', borderWidth : 1, shadow : false }, highlighter: { showTooltip: true, tooltipFade: true } }); $('#device_ownership_graph .jqplot-data-label').css('color', '#000000'); $('#device_ownership_graph').bind('jqplotDataHighlight', function (ev, seriesIndex, pointIndex, data) { alert('series: '+seriesIndex+', point: '+pointIndex+', data: '+data);}); }
问题
当切片上的鼠标移动事件时,我在两个不同的浏览器中收到两个不同的错误。
Chrome: -
Uncaught TypeError: Cannot read property 'formatter' of undefined jqplot.highlighter.min.js:57
Mozila: -
q._xaxis._ticks[0] is undefined
还有一个问题,当我使用
highlightMouseDown: true
它正在工作(显示警告)但是当我使用highlightMouseOver: true
它不起作用。我的代码中我做错了什么? 请帮帮我。
更新:2013年1月22日
我想要在BarGraph中使用荧光笔的行为。 我在给定的代码中使用了
alert()
,但该代码仅用于测试highliter。I want to use Highlighter functionality in to a PieChart. My code is
function device_ownership_graph(titleOfGraph, corporateOwned, corporateShared, employeeOwned) { var arrCorporateOwned = [ 'Corporate-Owned', corporateOwned ]; var arrCorporateShared = [ 'Corporate-Shared', corporateShared ]; var arrEmployeeOwned = [ 'Employee-Owned', employeeOwned ]; $.jqplot.config.enablePlugins = true; /*Here we construct graph*/ $.jqplot('device_ownership_graph', [ [ arrCorporateOwned, arrCorporateShared, arrEmployeeOwned ] ], { title : { text : titleOfGraph, // title for the plot, show : true, fontSize : 14, textColor : '#808080', textAlign : 'center' }, seriesColors : [ "#00b0f0", "#ffc000", "#92d050"], seriesDefaults : { // Make this a pie chart. renderer : jQuery.jqplot.PieRenderer, shadow: false, rendererOptions : { // Put data labels on the pie slices. // By default, labels show the percentage of the slice. showDataLabels : true, startAngle: 90, sliceMargin: 1, //highlightMouseOver: true highlightMouseDown: true } }, legend : { renderer : $.jqplot.PieLegendRenderer, show : true, rendererOptions : { numberRows : 1, numberColumns : 3, disableIEFading : false }, location : 'n', placement : 'outsideGrid', marginTop : '0px', marginBottom : '0px' }, grid : { drawGridlines: false, show : true, background : 'transparent', borderWidth : 1, shadow : false }, highlighter: { showTooltip: true, tooltipFade: true } }); $('#device_ownership_graph .jqplot-data-label').css('color', '#000000'); $('#device_ownership_graph').bind('jqplotDataHighlight', function (ev, seriesIndex, pointIndex, data) { alert('series: '+seriesIndex+', point: '+pointIndex+', data: '+data);}); }
Problem
I am getting two different errors in two different browsers when mouse-move event on slices.
Chrome : -
Uncaught TypeError: Cannot read property 'formatter' of undefined jqplot.highlighter.min.js:57
Mozila :-
q._xaxis._ticks[0] is undefined
And one more issue, when I use
highlightMouseDown: true
its working (showing an alert) but when I usehighlightMouseOver: true
its not working.What am I doing wrong in my code? Please help me.
UPDATE : 22 Jan 2013
I want the behavior of highlighter as it works in BarGraph. I used
alert()
in my given code, but that code is only for testing of highliter.
原文:https://stackoverflow.com/questions/14374544
最满意答案
谢谢你们,问题解决了。 UI是使用Bootstrap.js构建的。 现在能够使用Javascript中的引导代码打开模态窗口
$('#myModal')。modal({keyboard:false})
Thanks guys, The issue got solved. The UI was built using Bootstrap.js. Now able to open modal window using bootstrap code in Javascript
$('#myModal').modal({ keyboard: false })
相关问答
更多-
尝试实现在以下链接中指定的方式 https://jqueryui.com/dialog/#modal-confirmation 他们提供了示例和源代码来说明它是如何实现的。 Try to implement the way it is specified in following link https://jqueryui.com/dialog/#modal-confirmation They have provided example and source code to show how it is i ...
-
单击按钮打开模态窗口时,无法读取属性“顶部”(Cannot Read Property 'top' occurs when click button to open modal window)[2021-12-20]
您收到错误的可能原因是,对于模式按钮, $(hash)元素不存在。 模态按钮是一个属于$(".page-scroll a[href^='#'], #intro a").on('click')事件的$(".page-scroll a[href^='#'], #intro a").on('click') 。 如果没有id等于单击按钮的“href”属性的元素,则无法获得它的“offset.top”。 放入“ console.log(hash) ”来检查你到达那里。 可能的解决方案: if ($(hash).len ... -
我找到了答案: 对于fancybox http://jsfiddle.net/R82gF/ 对于使用history.pushState或history.replaceState模态窗口, http: history.replaceState I found answer: For fancybox http://jsfiddle.net/R82gF/ For modal window work with history.pushState OR history.replaceState, http://ra ...
-
ID应该在页面上是唯一的。 只需添加一些类,并使用document.querySelectorAll来获取一组按钮,你就可以了。 在这里查看我更新的jsfiddle。 var modal = document.getElementById('modal'); var btns = document.querySelectorAll('.pack.detail'); var span = document.getElementsByClassName("close")[0]; [].forEach.cal ...
-
这个问题似乎是由于templateUrl中指定的单独文件尚未在第一次单击时发生下载而导致的,现在我可以通过将以下行添加到index.html文件中来制定解决方案: 该指令为加载templateUrl的文件添加一个引用,以便在第一次按下按钮时,模式窗口将按预期显示。 请注意,ng-include属性中的值必须带有单引号才能按照ng-include指令的文档中的详细说明进行工作。 该细节在命名参数和建议部分中提到: ...
-
通过使用表单在div上设置z-index CSS属性可以解决这些问题。 例如,您可以使用navGrid的add / edit选项的zIndex属性。 请参阅anwer以获取代码示例。 Such problems can be solved by setting z-index CSS property on the div with the form. For example you can use zIndex property of add/edit options of navGrid. See th ...
-
谢谢你们,问题解决了。 UI是使用Bootstrap.js构建的。 现在能够使用Javascript中的引导代码打开模态窗口 $('#myModal')。modal({keyboard:false}) Thanks guys, The issue got solved. The UI was built using Bootstrap.js. Now able to open modal window using bootstrap code in Javascript $('#myModal').moda ...
-
如何打开一个新的模态窗口来关闭当前使用的simplemodal(How to open a new modal window to close the current use of simplemodal)[2022-02-21]
如果您查看页面http://www.ericmmartin.com/projects/simplemodal/ , 寻找回调 有一个onClose回调,当旧的模态关闭时,你可以使用它来关闭和打开新的模态 创建以下示例 两个模态HTML //Modal One DemoBasic Modal Dialog
For this dem ...
使用有效CSS的$(“:button”)等效选择器是$(“button,input [type ='button']”)。 - 来自jquery.com 您使用的是标签吗? 如果是这样,它将不会被:按钮选择器拾取。 试试这个: $("button, input[type='button'], input[type='submit']") .live("click", function (e) { } 只是一个想法,也许你没有使用提交标签。 An equ ...用Jquery打开模态窗口(Open modal window with Jquery)[2022-08-09]
考虑使用click()函数。 否则一切看起来都很好,假设dialog('open')按预期工作。 添加控制台日志以确保单击事件处理程序可以帮助您进行调试。 $('.extend-button').click(function (e) { console.log('clicked'); $("#ex1").dialog('open'); }); Consider using the click() function. Otherwise all appears well, assuming ...相关文章
更多- solr Highlighter (高亮)显示分析
- JFreeChart创建饼图PieChart
- Lucene4:创建FastVectorHighlighter高亮查询
- 在Hadoop的streaming中使用自定义的inputformat和outputformat
- Solr高亮显示highlight的三种实现
- flex高亮显示搜索结果怎么做?
- [032] 微信公众帐号开发教程第8篇-文本消息中使用网页超链接(转)
- Paoding 在 Solr 1.4 中使用
- oracle中使用job
- 关于hibernate中使用mysql函数的问题
最新问答
更多- 使用通配符获取更多servlet请求变量[重复](Get more servlet request variables using wildcards [duplicate])
- 返回相同的集合类型,参数化不同(Returning same collection type, differently parameterised)
- C ++朋友函数模板重载和SFINAE在clang ++,g ++,vc ++中的不同行为(C ++ 14模式)(C++ friend function template overloading and SFINAE different behaviors in clang++, g++, vc++ (C++14 mode))
- 与paure IoT-Hub的Python paho-MQTT连接(Python paho-MQTT connection with azure IoT-Hub)
- 编译器警告“来自不同的Objective-C类型的赋值”(Compiler warning “assignment from distinct objective-c type”)
- C ++编译错误(在此函数中未初始化)[重复](C++ Compile Error (uninitialized in this function) [duplicate])
- unsigned-signed下溢机制(unsigned-signed underflow mechanism)
- 快速行查询的数据结构?(Data structure for fast line queries?)
- 饥荒有手机安卓版的吗
- Jquery可拖动碰撞检测错误(Jquery draggable collision detection bug)
- sql调优是怎样来实现的?
- 无法使占位符输入文本消失(Unable to make the placeholder input text disappear)
- jQuery改变了两个div的CSS属性(JQuery change CSS property of two div's)
- JDK中包含的库版本(Versions of libraries included in the JDK)
- 请问下载的是出现ASP是什么意思
- Firebase MLkit用于数字液晶显示器的文本识别(Firebase MLkit Text recognition for digital lcd displays)
- 我可以在任何平台上运行C和C ++吗?(Can I run C and C++ on any platform?)
- 让小组在C#的特定位置(get panel at specific positions in C#)
- Nagios为通知设置了更高的间隔(Nagios set higher interval for notifications)
- 无法向SMTP主机发送电子邮件(unable to send an email to SMTP host)
- 获取MVC 4使用的DisplayMode后缀(Get the DisplayMode Suffix being used by MVC 4)
- 如何在.NET代码中验证全球邮政编码(How can I validate worldwide postal codes in my .NET code)
- 如何通过引用返回对象?(How is returning an object by reference possible?)
- Clojure:减少大型懒惰收集会占用内存(Clojure: Reducing large lazy collection eats up memory)
- 矩阵如何存储在内存中?(How are matrices stored in memory?)
- 每个请求的Java新会话?(Java New Session For Each Request?)
- 显示作为字符串的SVG(Showing an SVG that I have as a string)
- 从jansson库里创建json请求的自由内存的正确方式是什么?(what is the proper way of free memory in creating json request from jansson libary?)
- jQuery插件无法正常工作 - 它是附加的(jQuery plugin not working - it's appended)
- 使用stat_summary自动调整ylim(Automatically adjusting ylim with stat_summary)