flot

How do I display a Json random number in a real-time Flot chart?

与世无争的帅哥 提交于 2020-01-24 10:16:26
问题 I made in my C# page a random number which is stored in a json object: if (method == "rnd") { //Random number this.Page.Response.ContentType = "application/json2"; Random rnd = new Random(); int nr = rnd.Next(1, 100); // creates a number between 1 and 99 String str1 = nr.ToString(); var json2 = new JavaScriptSerializer().Serialize(str1); this.Page.Response.Write(json2); } and then I display it on my ASP page: function test2() { $.ajax({ type: 'GET', url: ('ajax.aspx?meth=') + "rnd",/

General approach to visualize SQL CE data using Flot.js in ASP.NET MVC 4?

安稳与你 提交于 2020-01-17 02:58:32
问题 I'm very new to SQL Server, Flot.js, working with databases in general. I'm working on a project in ASP.NET MVC 4 (using VS 2012) which has a Microsoft SQL Server Compact 4.0 database filled with data, and I would like to visually display this data using flot.js. I haven't been able to find any information on the general steps one would take to manipulate the data. Starting with the DB entries in the SQL CE database, and ending with a JSON file (or a CSV - anything flot.js could use as input)

Where did the drawBackground hook go? Or why is my last point the wrong color

血红的双手。 提交于 2020-01-16 18:20:13
问题 To try and solve this problem, I started looking into writing a plugin for flot to do what I needed. It looked surprisingly straight-forward, but I have run into a minor snag. I First used the draw hook to draw my axis (note: I'm aware this code needs some error checking to make sure the origin isn't off the chart) function draw(plot, ctx) { var offset = plot.getPlotOffset(); var origin = plot.pointOffset({ x: 0, y: 0 }); ctx.moveTo(offset.left, origin.top); ctx.lineTo(plot.width() + offset

flot on android: how to fit the screen size

|▌冷眼眸甩不掉的悲伤 提交于 2020-01-15 11:20:07
问题 I'm trying to use flot to plot something on the webview but hard to get the figure to fit nicely according to the screen size. It seems that only absolute size is accepted, while I change it to relative, the figure disappeared: <div id="placeholder" style="width:80%;height:40%;"></div> An example you can try is here from someone else: Using Flot's Bar Graph in an Android WebView with Highlighting 回答1: problem solved. I have to use the device-width: <div id="graphHolder" STYLE="height:200px

flot multiple line graph animation

核能气质少年 提交于 2020-01-11 10:21:49
问题 I have multiple series on a graph and would like to animate them but it is not working. I am using flot and animator plugin. https://jsfiddle.net/shorif2000/L0vtrgc2/ var datasets = [{"label":"IT","curvedLines":{"apply":true},"animator":{"start":0,"steps":7,"duration":3000,"direction":"right"},"idx":0,"data":[{"0":1433156400000,"1":"095.07"},{"0":1435748400000,"1":"097.80"},{"0":1438426800000,"1":"096.72"},{"0":1441105200000,"1":"097.62"},{"0":1443697200000,"1":"097.68"},{"0":1446379200000,"1

flot multiple line graph animation

倾然丶 夕夏残阳落幕 提交于 2020-01-11 10:21:27
问题 I have multiple series on a graph and would like to animate them but it is not working. I am using flot and animator plugin. https://jsfiddle.net/shorif2000/L0vtrgc2/ var datasets = [{"label":"IT","curvedLines":{"apply":true},"animator":{"start":0,"steps":7,"duration":3000,"direction":"right"},"idx":0,"data":[{"0":1433156400000,"1":"095.07"},{"0":1435748400000,"1":"097.80"},{"0":1438426800000,"1":"096.72"},{"0":1441105200000,"1":"097.62"},{"0":1443697200000,"1":"097.68"},{"0":1446379200000,"1

Flot wont upload JSON

我怕爱的太早我们不能终老 提交于 2020-01-06 23:44:52
问题 I'm new to json and flot. But I ve been asked to create a chart. Could someone explain to me why my code will not work? $.getJSON('chart.json', function(graphData){ alert(graphData); $.plot($('#graph-lines'), graphData, { series: { points: { show: true, radius: 15, }, lines: { show: true, lineWidth: 6 }, shadowSize: 0 }, grid: { color: '#646464', borderColor: 'transparent', borderWidth: 20, hoverable: true, highlightColor: "transparent" }, xaxis: { tickColor: 'transparent', ticks: [[6,'Week

jQuery Flot xaxis Time Format

二次信任 提交于 2020-01-06 08:43:13
问题 I'am using jQuery Plot for my graph. I have a list with some timestamp's and value's from a database. I want to convert my timestamp to H:i:s format. This results are from 10-05-2012 08:57:45 to 10-05-2012 09:03:40. var rx = [[1336633065, 152], [1336633071, 152], [1336633076, 152], [1336633080, 153], [1336633086, 152], [1336633090, 152], [1336633095, 152], [1336633100, 152], [1336633105, 152], [1336633110, 150], [1336633115, 150], [1336633120, 152], [1336633125, 152], [1336633130, 150],

Display Timeline/Linear data in Flot

泄露秘密 提交于 2020-01-06 07:15:36
问题 Does anyone know how to get flot to display a type of 'timeline'? E.g. Y: Person1| ----- ------- Person2| ------- ------- Person3| -- ----- ---- Person4| ------- _____________________ X: Jan Feb March April I'm not sure how to display the labels on the y axis and show the data linear Solution so far :) $(document).ready(function(){ var d1 = [[(new Date("01/01/2009")).getTime(), 5], [(new Date("10/01/2009")).getTime(), 5]]; var placeholder = $("#placeholder"); // plot it var plot = $.plot

Visualize energy efficiency level

喜夏-厌秋 提交于 2020-01-06 06:15:47
问题 I want to create something like this: The black line represents a specific value. I need this visualization within a phonegap-app. I'm using jQuery-mobile and Flotcharts for some other stuff. What would be the simplest way to go? Flotcharts does not seem right for this kind of chart. 回答1: I took a few moments to implement this based in part on @DNS's suggestions above. I did it without using any plugins, just straight flot magic. First, I created a gradient background image like the one above