flot

jquery flot bar chart bar width

旧街凉风 提交于 2019-12-23 12:28:28
问题 I'm using jquery flot library to plot a bar chart. The bars in my chart are consistantly too thin, about 2px in width. But when I set lineWidth: 15 the bars become the width I want, but the first and the last bars spill over the graph border. I found a simple test flot bar chart with a limited number of points, which looks fine when implemented locally. My conclusion is that maybe I have way too much data, and so the bars are thin in contrast to the amount of points. But I'm hoping there is a

Flot bar chart: bars overlapping on time axis issue

痞子三分冷 提交于 2019-12-23 10:13:16
问题 I am trying to plot expense data against time axis, and I see the data bars are overlapping if they are showing data for the same date. I was expecting the graph to show the bars asjascent to each other but that is not the case. See a sample of code at this link... $.plot($("#placeholder"), newJson, { bars: { show: 1, barWidth: 24 * 60 * 60 * 1000 * 10 }, xaxis: { mode:"time" } }); 回答1: Unfortunately, that isn't possible in flot without using some sort of plugin. I suggest you either use the

How to duplicate Y Axis on JQuery Flot

巧了我就是萌 提交于 2019-12-23 08:51:41
问题 I'm being able to use JQuery Flot, and it's a very nice tool. However, I could not find a GOOD solution for my problem. I want to duplicate Y axis, so I can display 1 on the left and 1 on the right, so the users, when comparing data from the rightmost side of the chart, won't have to scroll through the leftmost side of the chart. I'm assuming they will be accessing it through a smartphone. JQuery Flot allows multiple axis, but for each axis, I would need a different set of data, as in this

Flot pie chart change position of legends

喜夏-厌秋 提交于 2019-12-23 07:42:47
问题 Can we change the position of legends from default left side to right or bottom? How can we implement hover on mouse pointer that is the content should be shown on the mouse pointer and not in other DIV 回答1: The legend option takes a "position" attribute to specify it's location: legend: { position: "ne" or "nw" or "se" or "sw" } What do you mean by "on the mouse pointer". Would you like the "content" to follow the pointer? 回答2: Here's the documentation of the library you're using: https:/

Jquery flot and week numbers

ε祈祈猫儿з 提交于 2019-12-23 05:12:26
问题 I made a page to plot average snowdepth by week number. Now that we entered 2010, week 1 my graph stretches the interval on the x-axis (yearweek). What I want is the weeknumber on the x-axis (51,52,1,2 etc), and a fixed intervalwidth. Anyone know how to do that? example <script id="source" language="javascript" type="text/javascript"> $(function () { var d1 = [ [201001,118],[200952,112],[200951,102],[200950,97],[200949,93], [200948,41],[200947,10],[200947,0]]; var d2 = [ [201001,33],[200952

javascript php mysql flot

本小妞迷上赌 提交于 2019-12-23 00:22:31
问题 I encountered a new problem regarding my x-axis. My intention was to output a x-axis which indicates the time, while the y axis indicates the power. I decided to use time[i] and using graph.push([time[i], power[i]) . However,my graph remains empty. I did an alert to output function and this was the result I got: ({1:"14:36", 2:"14:39", 3:"14:42", 4:"14:45", 5:"14:48", 6:"14:51", 7:"14:54", 8:"14:57"}) It's in hour: mins . What should I change to obtain a time X-axis? $(function () { var graph

Flot 0.8.2 Line Chart - Color Bug

五迷三道 提交于 2019-12-22 10:44:20
问题 I was working with Flot line charts and setting their colors. I found an odd bug. After the first 3 colors, the plot uses the last color for all of the other lines. This is not the correct behavior. What makes this even more interesting is that the legend displays the correct colors. Is this a known bug? var dataSet = [ {label: "d1", data: demand}, {label: "d2", data: demand2}, {label: "d3", data: demand3}, {label: "d4", data: demand4}, {label: "d5", data: demand5}, {label: "d6", data:

Draw multiple charts with Flot, html, PHP and MySql query

六月ゝ 毕业季﹏ 提交于 2019-12-22 10:07:34
问题 I’m trying to draw multiple charts with Flot, html, PHP and MySql query but I’m stuck because I can’t find a way in order to draw multiple flots in the same html page. In the database (test_db3) image for simplicity the following fields: table1(user_name, mail_sent, time) table2(user_name2, mail_received,time2) those two tables cannot be modify, I can’t add the user_name2 to the table1 and so on. in table1 are stored the values of the sent mail based on the time of sent in table2 are stored

How to give solid colors to bar charts in flot

廉价感情. 提交于 2019-12-22 04:29:19
问题 I need to give solid colors to bar charts... I have followed this link Bar chart Example But i want to give solid colors and also i need to change colors myself... how to do it... 回答1: First off, read the API.txt, it answers all your questions. Two things you need to do then. When you specify that you want bars, set fill: 1 , which tells flot to make the colors 100% opaque. To specify a colour per series, just add a color:'red' to each data object. So you end up with a data object like this:

Plot a new series on an already-rendered jquery flot graph

懵懂的女人 提交于 2019-12-21 17:15:54
问题 I have a float graph that is already rendering one data series, i.e. var plot = $.plot($('#placeholder'), [data1], options); At a later point, I will receive some new data that I want to also plot on this same graph, as a separate data series. Is there a way I can just add this new data series to the existing graph, and not have to construct the whole graph again? That is, I want to avoid having to make another call like this: var plot = $.plot($('#placeholder'), [data1, data2], options); and