flot

Create dynamic JSON from foreach

僤鯓⒐⒋嵵緔 提交于 2019-12-05 12:33:06
问题 I'm using jquery flot charts to represent my data. Here's the example JSFiddle I made that shows how the JSONS's required for the chart should look. The data source is from a MySql stored procedure that has the below output example: I need to represent in the chart, the count values stacked for different innumber 's on y-axis, the name values on x-axis, and in another chart, the values for outnumber . (in stacked bars). -The data series should match, so the specific labels should appear

Flot charts x-axis time issues… AARGHHH

北战南征 提交于 2019-12-05 11:31:19
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, "hour"]} This displays 8 through 8 values (not correct according to data file), but no graph data:

Using Flot with Bootstrap: IE8 incompatibility?

一个人想着一个人 提交于 2019-12-05 10:33:34
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 purposes of this example) - if it's not there then the Bootstrap styles go screwy. What can I do? <

Space between touch points on IE10

谁说我不能喝 提交于 2019-12-05 08:32:44
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 With IE's pointer events, a separate event is fired for each touch point. Unlike iOS touch events (as implemented by other browsers too),

jQuery/Flot: How do you get the coordinates of a datapoint?

邮差的信 提交于 2019-12-05 07:32:48
I'm currently looking at the example at http://people.iola.dk/olau/flot/examples/interacting.html but I can't figure out, how to get the coordinates of a datapoint. I won't be clicking on the Plot so I can't make use of the event plotclick. Now my question: is there another way to get the x and y coordinates of a datapoint, without clicking? I will be using the jQuery slider to highlight different points on a graph and would like to have a tooltip next to the datapoints. Thanks in advance :) Bit late on this but I ran this function after plotting the graph as a way of putting labels underneath

Flot graph resizing error, invalid height

心已入冬 提交于 2019-12-05 00:51:54
问题 I'm trying to add flot graph to my page, and i'm having some problems with adding resizing to the graph. For the resize plugin to work width and height og placeholder div need to be set to 100%. But when i do that and want to load the graph in new window i try to call the plot method on doc ready but the height og my div is 0 althoug the containg div har height = 600px(so the placeholder div should have the same?). <div id ="ResizableContainer" class="ui-widget-content" style="width:900px

Saving flot chart to image or pdf

﹥>﹥吖頭↗ 提交于 2019-12-05 00:51:36
问题 I'm trying to save a flot chart to an image and eventually to a pdf, but can't quite figure out how. Online I see that I can do canvas.toDataURL("image/png") But the trouble is how do I get the canvas in the first place, the examples say to use document.getElementById("canvas"); but for my code I'm using a div with id="placeholder" (per all the flot examples) and there's nothing labeled with a canvas tag in my html, and this doesn't seem to work. My javascript for flot looks like $.plot($("

Put only integers in x and y axis of bar and line graphs - Flot

做~自己de王妃 提交于 2019-12-04 15:34:05
问题 In Flot.js, bar graphs and line graphs have numbers as the coordinates in the x and y axis by default. How can you make the coordinates such that the numbers are only integers or at least only the integers are visible? 回答1: Check out the minTickSize option from the documentation: Alternatively, you can specify that you just don't want ticks at a size less than a specific tick size with "minTickSize". So in your graph options, you would specify it like this: $.plot($('#placeholder'),data,{ /

Tooltip for flot bar chart

。_饼干妹妹 提交于 2019-12-04 14:19:20
问题 i am using flot API to build bar charts. I am successful in plotting bar charts.But i am not getting tooltip for those charts.I have tried alot but i failed to achieve this. My code is: $(function () { var a1 = [ [0, 100], [1, 200], [2,300], [3,400], [4,500] ]; var a2 = [ [0, 90], [1, 150], [2,250], [3,380], [4,450] ]; //var ticks=[[0,"Overall"],[1,"SEA"],[2,"INDIA"],[3,"NEA"],[4,"PZ"]]; var data = [ { label: "Pre Transformation", data: a1 }, { label: "Post Transformation", data: a2 } ]; $

Invalid dimensions for plot, width = 0, height = 400 inside of hidden tab

安稳与你 提交于 2019-12-04 08:06:39
问题 I have this error when I insert charts in hidden tabs like second, third, etc. here is the error: Invalid dimensions for plot, width = 0, height = 400 in js/jquery.flot.min.js:6. I used bootstrap 2 and jquery: <script type="text/javascript" src="js/jquery-1.7.2.min.js"></script> Here are the libraries: <script src="js/jquery.flot.min.js"></script> <script src="js/jquery.flot.pie.min.js"></script> <script src="js/jquery.flot.stack.js"></script> <script src="js/jquery.flot.resize.min.js"><