Open son0fhobs opened 11 years ago
You need to give the div you're rendering into a height.
Documentation could always be improved, of course. But check out individual examples here: http://humblesoftware.com/flotr2/index#!basic There is some documentation here: http://humblesoftware.com/flotr2/documentation with a standalone example here: http://humblesoftware.com/flotr2/example
-c
On Sat, Dec 8, 2012 at 6:50 PM, David notifications@github.com wrote:
I'm completely befudled. Maybe I'm just completely ignorant, and the one person who can't figure it out. My apologies if some of my frustration comes out in the below questions and thoughts.
Maybe it would be helpful if the demos were separated into different pages? Thus, if I wanted to include a specific chart, I just use the demo and modify as need be.
Given that the demos are compiled together, I had an exceedingly difficult time trying to figure out which files I need for what, and what init functions to use apart form being integrated into the full demo setup. Do I really need to include the excessive amount of js files in the demo? Flotr2 > examples > js > examples > 24 js files
Or everything in spec? Flotr2 > spec > flotr, graph, color, chart files and /js/ >flot2 stable?
Or can I stick with just the flotr.js file in the root folder?
For my use, how do I create just a pie chart? If I use the basic pie js file, that doesn't seem to work on it's own with the flotr2.js file. Which files do I need to include, and what init function can I use?
After including flotr2.min.js in the root folder, I included this slightly modified init function with no luck:
function time_chart(){
container = document.getElementById('pie-chart'); var d1 = [[0, 4]]; var d2 = [[0, 3]]; var d3 = [[0, 1.03]]; var d4 = [[0, 3.5]]; var graph; graph = Flotr.draw(container, [ { data : d1, label : 'Comedy' }, { data : d2, label : 'Action' }, { data : d3, label : 'Romance', pie : { explode : 50 } }, { data : d4, label : 'Drama' } ], { HtmlText : false, grid : { verticalLines : false, horizontalLines : false }, xaxis : { showLabels : false }, yaxis : { showLabels : false }, pie : { show : true, explode : 6 }, mouse : { track : true }, legend : { position : 'se', backgroundColor : '#D2E8FF' } });
}
I got this error: uncaught exception: Invalid dimensions for plot, width = 134, height = 0, resolution = 1
It didn't give me a file or line number to work with, so I'm a bit lost. The container was just a plain
Thanks for your patience and baring with me.
— Reply to this email directly or view it on GitHubhttps://github.com/HumbleSoftware/Flotr2/issues/182.
I too don't know where to start. I tried to build my own basic example, but had undefined functions. probably missing a file. and can I drive a bar chart with JSON? Must be able to, right? but I can't find documentation anywhere.
I love that you put this on github and allow other to share, fork and improve, but I too am confused and frustrated. What files would you need for a basic horizontal bar chart?
Maybe the fiddle will help: http://jsfiddle.net/cesutherland/ZFBj5/
That includes everything necessary to create a bar chart.
-c
On Tue, Dec 18, 2012 at 5:11 PM, Michael Ware notifications@github.comwrote:
I too don't know where to start. I tried to build my own basic example, but had undefined functions. probably missing a file. and can I drive a bar chart with JSON? Must be able to, right? but I can't find documentation anywhere.
I love that you put this on github and allow other to share, fork and improve, but I too am confused and frustrated. What files would you need for a basic horizontal bar chart?
— Reply to this email directly or view it on GitHubhttps://github.com/HumbleSoftware/Flotr2/issues/182#issuecomment-11507768.
Great. Thx Carl. Got my local example working, but as an ajax newbie, how do I pull in data via JSON? Can I use the documentation for FLOT as a general guide? https://github.com/flot/flot/blob/master/API.md#data-format
I am trying to draw a pie chart with flotr without the percentages because i have many data series and some of them are 0 sometimes but don't know how to remove the percentages. Anyone know how?
It's taken me WAY to long to figure out how to make a simple stand alone pie chart example... Here is the source code for anybody that may be interested.
I copied Flotr2 files in to a directory: /js/Flotr2
<html>
<head>
<style type="text/css">
body {
margin: 0px;
padding: 0px;
}
#container {
width : 600px;
height: 384px;
margin: 8px auto;
}
</style>
</head>
<body>
<div id="container"></div>
<!--[if IE]>
<script type="text/javascript" src="/js/Flotr2/lib/FlashCanvas/bin/flashcanvas.js"></script>
<![endif]-->
<script type="text/javascript" src="/js/Flotr2/flotr2.min.js"></script>
<script type="text/javascript">
(function basic_pie (container) {
var
d1 = [[0, 4]],
d2 = [[0, 3]],
d3 = [[0, 1.03]],
d4 = [[0, 3.5]],
graph;
graph = Flotr.draw(container, [
{ data : d1, label : 'Comedy' },
{ data : d2, label : 'Action' },
{ data : d3, label : 'Romance',
pie : {
explode : 50
}
},
{ data : d4, label : 'Drama' }
], {
HtmlText : false,
grid : {
verticalLines : false,
horizontalLines : false
},
xaxis : { showLabels : false },
yaxis : { showLabels : false },
pie : {
show : true,
explode : 6
},
mouse : { track : true },
legend : {
position : 'se',
backgroundColor : '#D2E8FF'
}
});
})(document.getElementById("container"));
</script>
</body>
</html>
In general, you ma view the standalone example here: http://humblesoftware.com/flotr2/example
And the various chart types with options here: http://humblesoftware.com/flotr2/#!basic-pie
On Mon, Feb 4, 2013 at 6:38 PM, djlerman notifications@github.com wrote:
It's taken me WAY to long to figure out how to make a simple stand alone pie chart example... Here is the source code for anybody that may be interested.
I copied Flotr2 files in to a directory: /js/Flotr2
```— Reply to this email directly or view it on GitHubhttps://github.com/HumbleSoftware/Flotr2/issues/182#issuecomment-13106551.
The examples and documentation helped me out quite a bit and I did not find it especially hard to get started, just saying ;)
I am confuse. How to use flotr2 charts. I am trying to integrate it in my iOS app and getting blank page after including it. Here is my code:
```And I have already included the flotr2.min.js file in my project. Note: I am following this url for example. http://www.humblesoftware.com/flotr2/index#!basic
Thanks,
I'm completely befudled. Maybe I'm just completely ignorant, and the one person who can't figure it out. My apologies if some of my frustration comes out in the below questions and thoughts.
Maybe it would be helpful if the demos were separated into different pages? Thus, if I wanted to include a specific chart, I just use the demo and modify as need be.
Given that the demos are compiled together, I had an exceedingly difficult time trying to figure out which files I need for what, and what init functions to use apart form being integrated into the full demo setup. Do I really need to include the excessive amount of js files in the demo? Flotr2 > examples > js > examples > 24 js files
Or everything in spec? Flotr2 > spec > flotr, graph, color, chart files and /js/ >flot2 stable?
Or can I stick with just the flotr.js file in the root folder?
For my use, how do I create just a pie chart? If I use the basic pie js file, that doesn't seem to work on it's own with the flotr2.js file. Which files do I need to include, and what init function can I use?
After including flotr2.min.js in the root folder, I included this slightly modified init function with no luck:
I got this error:
uncaught exception: Invalid dimensions for plot, width = 134, height = 0, resolution = 1
It didn't give me a file or line number to work with, so I'm a bit lost. The container was just a plain
Thanks for your patience and baring with me.