flot

jQuery flot pie resize

泪湿孤枕 提交于 2019-12-25 19:04:33
问题 I have got the resize thing working but when i use the pie chart at first everyting is oke but when i resize the container i get a big sqaure chart instead of the round pie. How is this possible to fix? The JS code: $("table.chart-pie").each(function() { var colors = []; $("table.chart-pie thead th:not(:first)").each(function() { colors.push($(this).css("color")); }); $(this).graphTable({ series: 'columns', position: 'replace', width : '100%', height: '250px', colors: colors }, { series: {

Can't Get Data Into Flot With AJAX

空扰寡人 提交于 2019-12-25 16:45:46
问题 I am using the code below to graph data into flot, and when I print out dataOne, it returns properly formatted values for flot, however when I set it as the data for flot to graph, flot forms a graph but then has no data points? <!DOCTYPE HTML> <html> <head> <title>AJAX FLOT</title> <script language="javascript" type="text/javascript" src="../../jquery.js"></script> <script language="javascript" type="text/javascript" src="../../jquery.flot.js"></script> <script language="javascript" type=

flot dynamic bar width

时光总嘲笑我的痴心妄想 提交于 2019-12-25 07:04:06
问题 This is the code i used to use for bars bars: { show: true, barWidth: 12 * 24 * 60 * 60 * 300, that width works with me when the min and max value of x axis is 2014-2-2.gettime() and 2014-9-9 respectively (i am trying to give you the idea not the exact syntax). but the bar seems to wide when the data is from june to july is there a way to make flot itself make the width and make it not too large and not too small ? 回答1: To my knowledge, flot won't auto-scale the bars. The default barWidth: 1,

Flot - Detect left-click and right-click

你说的曾经没有我的故事 提交于 2019-12-25 05:22:21
问题 I'm drawing a line graph using Flot. It's updated in real-time and has multiple series. I want to be able to detect left and right mouse clicks on individual series in the graph. Currently, I can detect a left mouse click, but right-click just brings up my browser's right-click menu. Here's what I've got so far: function myClick(event, pos, obj) { if (!obj) { return; } alert('clicked!'); } var placeholder = $("#placeholder"); // setup plot var options = { ... grid: {clickable: true, hoverable

flot why the line goes back to the top left?

老子叫甜甜 提交于 2019-12-25 03:17:42
问题 This is my code: var holder = $('#line-chart'); if (holder.length) { $.plot(holder, [ { data: data[0].data, lines: { show: true }, label:"Service Level" }, { data: data[1].data, bars: { show: true }, yaxis: 2, label:"# Of Calls" } // set second series to use second axis ], { yaxes: [{ min: 0, // options for first axis tickFormatter: function (val, axis) { return val + '%'; } }, { alignTicksWithAxis: 1, // options for second axis, put it on right position: "right" }], xaxis: { min: minVal

Flot - bar chart with individual colors and labels

大憨熊 提交于 2019-12-24 20:28:20
问题 I use flot to display simple bar charts. I have single dataset like [ [0,5], [1,6], [2,3], [4,1] ] and I am using this simple code: myChart = $.plot($('#graphFlot'), [{ data: mdata, bars: { show: true, fill: 0.9 } }] ); Now I would like to display various colors and labels for each bar. Example bar chart here is how it should look like. I've browsed through many examples and documentation and still do not know how to set this. Is this possible? 回答1: Put each bar in its own series and give

Flot Pie Chart with PHP

江枫思渺然 提交于 2019-12-24 19:05:01
问题 I tried to add load a Pie Chart dynamically using Flot Chart and PHP/MySQL. This is my javascript code <script id="source" language="javascript" type="text/javascript"> function fetchData() { $.ajax({ url: "test.php", method: "GET", dataType: "json", success: function(series) { var data = [ series ]; $.plot($("#graph1"), data, { pie: { show: true, showLabel: true }, legend: { show: false } }); } }); setTimeout(fetchData, 1000); } $(function () { $("#btn").click(function(){ fetchData(); }); })

flot: How to count the number of y-axes

你离开我真会死。 提交于 2019-12-24 16:54:30
问题 In my project I declare some y-axes (temperature, humidity, etc) for line-charts. but I can show\hide some of the series. I want to highlight the y-axes of tooltip item only if there are some y-axes on the screen I thought I could use var isMultyYaxes = ( $(".flot-y-axis").length > 1 ); if (isMultyYaxes) { $(".y" + item.series.yaxis.n + "Axis").addClass("myActiveAxis"); } but it seems there are duplicate y-axes in $(".flot-y-axis"). Should I use - var isMultyYaxes = ( $(".flot-y-axis").length

Flot Strange Line Chart

℡╲_俬逩灬. 提交于 2019-12-24 09:43:50
问题 I have a chart with ordering by date. My problem is the chart lines joining false from start to end. My options: var options = { grid: { color: "#dedede", borderWidth: 1, borderColor: "transparent", clickable: true, hoverable: true }, series: { grow: {active:false}, lines: { show: true, fill: false, lineWidth: 2, steps: false }, points: { show:true, radius: 5, lineWidth: 3, fill: true, fillColor: "#000" } }, legend: { position: "nw", backgroundColor: null, backgroundOpacity: 0, noColumns: 2 }

flot: make ticks line up for all Y axis

怎甘沉沦 提交于 2019-12-24 05:06:15
问题 I have a flot graph that in addition to the first Y axis, uses secondary Y axis with a different number scale. My problem is that the secondary scale labels does not line up with the grid lines made by the first flot axis. Flot seems to be running some internal algorithm to decide on how many tick labels to display for an axis. It does so separately for each axis, creating the issue I am having. The first run of the algorithm for the primary Y axis creates grid marks for the entire graph.