flot

jQuery Flot: 24 hour axis

a 夏天 提交于 2019-12-08 02:23:38
问题 I'm using jQuery Flot plugin and I would like to have 24 hour x-axis. But how to accomplish that? I included necessary time plugin (jquery.flot.time.js) and tried something like this: xaxis: { mode: "time", timeformat: "%H", tickSize: [1, "day"], twelveHourClock: true } but nothing is showing up. What am I doing wrong? 回答1: You are looking for something like this: xaxis: { mode: "time", timeformat: "%I:%M %p", // HH:MM am/pm tickSize: [1, "hour"], // tick every hour twelveHourClock: true, min

Flot event for range updates in response to panning/zooming

感情迁移 提交于 2019-12-07 23:25:19
问题 For Flot, is there an event that fires after the user has completed panning or zooming using the mouse scroll wheel(after the range.xaxis.to/from and range.yaxis.to/from have settled)? I am trying to use the line below to update the selection on an overview plot after the user has panned or zoomed in the main plot, but am finding that either the update to the overview plot happens after panning or zooming(not both). $("#plot").bind("mouseup scroll",updateOverviewSelection); Thanks in advance.

Flot charts: markings z-index?

本小妞迷上赌 提交于 2019-12-07 19:21:52
问题 Is there any way to access and manually set the z-index (for lack of better word) of the markings lines in a flot chart? Right now I am creating some markings on a line chart to use as thresholds (basic horizontal lines set to a specific value) and it's working great except when the markings happen to be lined up perfectly with the chart's grid lines. When that happens the grid line overlaps the marking line so it's hard to see the marking line. What I would like to do is manually set the

How to check if JSON array is equal to

让人想犯罪 __ 提交于 2019-12-07 14:32:27
问题 I am creating pie charts with JSON and Flot. The JS function to create the pie chart receives a JSON array from Django in this format: [1, 3, 2, 5, 4] If there is no data, the JSON array is: [0, 0, 0, 0, 0] I'm trying to adjust the function so that if there is no data, then the pie will not be plotted and some text will appear instead (e.g. "Nothing to show yet"). So far I have tried: function loadWeekChart(theData) { var blankData = [0, 0, 0, 0, 0]; if ($.data(theData) == $.data(blankData)){

Flot reset zoom

六眼飞鱼酱① 提交于 2019-12-07 07:49:36
问题 I'm using Flot Charts with mouse scroll to zoom in and out. I created a button to call zoomOut() and it works well, but I can't find any solution to how I can zoom out all the way so that it Looks just like when it was first loaded. I don't want to reload that who container because it using ajax to pull data from mysql on refresh. I Googled but couldn't find anything. 回答1: You can save your initial ranges of axes and redraw your plot like in example for navigating. But your code will be look

Using Flot with Bootstrap: IE8 incompatibility?

孤街醉人 提交于 2019-12-07 06:57:51
问题 I am trying to use Flot in a Bootstrap project. I am finding that in IE8, the Flot graph is invisible, and I've narrowed the problem down to the HTML5 shim used by Bootstrap. Here is the page in full: it's the basic Flot example plus the HTML5 shim, and the graph is invisible in IE8 (it's fine in Chrome). If I remove the HTML5 shim line, the graph is fine in IE8. However, I need the HTML5 shim for Bootstrap styles to work (when I add Bootstrap back in - I've removed references to it for the

Flot charts x-axis time issues… AARGHHH

风格不统一 提交于 2019-12-07 06:30:21
问题 I am having a difficult time getting my data to display inside of a Flot chart with the x-axis serving as the timeline. Here is an abbreviated copy of my JSON file: { "label": "ServiceReport", "data": [[1328983200, 53], [1328986800, 53], [1328990400, 60]] } I've followed the tutorials on the Flot API page, as well as this one on stackoverflow without any luck. When modifying the x-axis, this gets the graph to display just fine, but the x-axis is blank. xaxis: { mode: "time", minTickSize: [1,

Space between touch points on IE10

不羁岁月 提交于 2019-12-07 05:25:46
问题 I'm working on the plugin flot.touch.js which add touch interactivity (pan and zoom) on the chart for webkit browsers. I want to make it work on IE10 too but I don't know how to retrieve the space between my touch points (I need this for calculate the scale). On webkit browsers, we can do this by using these variables : evt.originalEvent.touches[0].pageX evt.originalEvent.touches[0].pagey evt.originalEvent.touches[1].pageX evt.originalEvent.touches[1].pageY 回答1: With IE's pointer events, a

Jquery Flot “plothover” event not working

丶灬走出姿态 提交于 2019-12-06 17:30:32
问题 I have an issue I can't seem to track down. I am using Flot to graph some data, super easy. I want to add the hover effect you see here: Flot Example Unfortunately, under no circumstance can I get the 'plothover' event to fire. This is a brief snippet from the code: $.plot($chartArea, eventData, eventOptions); $chartArea.bind("plothover", function (event, pos, item) { console.log('hovering!'); }); Is there something you need to set in the options object to enable this behavior? Thanks! 回答1:

Customize tooltip in FLOT graph

点点圈 提交于 2019-12-06 16:41:17
I am using FLOT to display graphs. To display tootip i am using https://github.com/krzysu/flot.tooltip . Now I want to customize content of tooltip so I am using callback to set content of tooltip. Code snippet: tooltip: true, tooltipOpts: { content: function(label, xval, yval, flotItem){ var xAxis = plot.getXAxes(); return xval; }, defaultTheme: false } But its giving me error caught TypeError: Object function (label, xval, yval, flotItem){ var xAxis = plot.getXAxes(); return xval; } has no method 'replace' Could any one help me ? Thanks in advance. I'm not using the flot tooltip. There is