Closed GoogleCodeExporter closed 8 years ago
Since the pie chart support doesn't appear to be in a release version, I felt I
should post an issue here rather than creating a new issue.
In IE8, excanvas_r3, and flot.r147.patched the last data series color on the pie
chart appears gray even though the legend shows a different color for that
series.
I've attached two screen shots. Not sure if this is a issue with flot or
excanvas.
Any input would be appreciated.
Thanks,
Kyle
Original comment by Kyle.McK...@gmail.com
on 22 Apr 2009 at 8:28
Attachments:
Seems like no one talked about how to use the patched js file or apply patch to
the
current release. Could someone give some instruction?
I tried to attached the patched flot js file together or use patched alone, and
it
did not work.
Thanks lot!
Original comment by hxion...@gmail.com
on 27 Apr 2009 at 5:49
Hi all,
Does any patch will work for pie with tool tip? (in IE)
Original comment by narsiatw...@gmail.com
on 28 Apr 2009 at 6:52
please help!!! excanvs does not support isPointOnPath,so what will be the
solution
Original comment by narsiatw...@gmail.com
on 28 Apr 2009 at 7:57
Hi all,
I made a stripped version of the patch of comment #46 and comment #48.
# Thank you guys
- It contains only diff for pie charts.
- Aligned to flot's coding style (bracket placement, tab/space usage).
- Added options.pies.startAngle.
The sample html is also stripped down.
Now, please review this patch and include it in flot release version if it's ok.
Thanks,
Hiroaki
Original comment by hnaka...@gmail.com
on 29 Apr 2009 at 7:29
Attachments:
Hi
I merged some patches of comment #46, #48, #49, #55 into flot r153.
- Rename options.makeRandomColor to options.shuffleColors
- Skip findNearByItem in pie chart
- Modify pie options and rendering of percent labels.
pies: {
show: false,
radius: null, // or number by px
labelRadius: null, // or number by px
startAngle: 0,
fill: true,
fillColor: null,
fillOpacity: 0.85,
fontStyle: "font-size: normal; font-weight: bold; color:#545454",
adjustPosition: true
},
I tested it on demo and the following sample.
http://extflot.googlecode.com/svn/trunk/pie.html
Thanks
Original comment by kiyot...@gmail.com
on 4 May 2009 at 8:27
Attachments:
Hi all
Today, I modified the pie chart support again.
pies: {
show: false,
radius: null, // or number by px
labelRadius: null, // or number by px
startAngle: 0,
fill: true,
fillColor: null,
// null or fn or 'value', 'percent', 'label', 'full'
// fn: (label, value, percent, textValue, pie, serie, options) -> html
labelFormatter: null,
labelStyle: 'font-size: normal; font-weight: bold; color:#545454;',
bias: [0.3, -1.4, 0.1], // [init, step, threshold]
}
"radius" is the radius of pie.
If you specify it by number, it passed as the pie radius.
If you specify it by null or nothing, the flot determines it by plot area.
If legend is shown, radius become smaller.
"labelRadius" is the radius or label area.
If you specify it by number, it passed as the label radius.
If you specify it by null or nothing, the flot determines it by pie radius.
"labelFormatter" is formatter of each series label.
If you specify it by function, like the followings:
labelFormatter: function(label, value, percent, textValue, pie, serie, options) {
return textValue + '%<br><span style="font-size: 75%">' + label + '<br>(' +
value + ')</span>';
}
* label: the label of the serie
* value: the raw value of the serie
* percent: the raw percent value
* textValue: the percent to show. you should add '%' after it.
* pie: the pie informations to show. it contains the following members.
radius labelRadius sumSeries anchorX anchorY labelX labelY startAngle endAngle
sliceMiddle
* serie: the serie to show in this pie
* options: flot options which is parsed
"labelStyle" is the style of label div. You can specify it in .pieLabel class
<br><br>
"bias" is the option to ajust position of small pie.
You specify it as Array.
* 0: initial value of bias
* 1: the bias for the next bias
* 2: threshold to apply bias. if the percent is smaller than it, the pecent will
be biased.
* If you specify null, bias is disabled.
Please see the following example and the attached demo.
http://extflot.googlecode.com/svn/trunk/pie.html
Thanks
Original comment by kiyot...@gmail.com
on 5 May 2009 at 10:44
Attachments:
Nothing beyond r132 (from Feb 18, 2009) seems to work in IE. I have tested all
of the
versions since then, and they all fail to draw anything and give the javascript
error:
'parentNode' is null or not an object
This seems to hold true for both IE6 and IE7 (and nothing seems to work in IE8,
see
issue #160).
Original comment by the.d...@gmail.com
on 15 May 2009 at 10:28
Since the code here didn't seem to work in IE at all, I started with a
different pie
patch from the Google Group, in this thread:
http://groups.google.com/group/flot-graphs/browse_thread/thread/9b1e73e4025b376c
/b56101eb1375d1da?pli=1
(So this is an entirely different version than that in the previous comments)
Then I merged those changes into the latest copy of flot from the SVN (since
the IE8
issues are fixed in there), and then had to make some tweaks to make it work.
Then,
since I was at it and had figured out how it worked at that point, I extended
it and
added some new features including:
* The pie is now centered
* Improvements to the positioned labels/backgrounds
* Pie will be shrunk if the labels would be outside the canvas
* The visual size of the pie can be adjusted
* Slices smaller than a specified percentage can be combined
See the HTML file included in the attached archive for more detail and
examples. I
included everything needed in the archive including the base version of flot
that I
started from and the corresponding patch file.
Original comment by the.d...@gmail.com
on 21 May 2009 at 6:32
Attachments:
Since flot now has a plugin system, I rewrote my earlier pie patch as a plugin
and
made a few minor adjustments to it. Should be much easier to use now.
I've included two zip archives, one containing the normal version of the
plugin, and
one containing a minified version of the plugin (and the most recent -- at the
time
of this writing -- version of flot).
The included html file is the same as that contained in each of the zip
archives, but
with all of the minified javascript included, so it should be fully contained
and
allow you to preview the plugin without having to download the archives.
Original comment by the.d...@gmail.com
on 18 Jun 2009 at 11:23
Attachments:
I must say, this looks very good! (Both the pluginability and the pie plugin
itself)
Is there going to be created a place where Flot Plugins are collected and
downloadable, or will plugins like these
go into the SVN repository ?
Original comment by boem...@gmail.com
on 19 Jun 2009 at 11:50
Thank you for your great job!
I'll detach my pie chart support from my maintenance.
I plan to ask it to users of my pie chart support.
And I'd also like to ask you.
Can I take in your pie chart support into my Ext.ux.Flot?
http://code.google.com/p/extflot/
http://extjs.com/forum/showthread.php?t=63364
Thanks
Original comment by kiyot...@gmail.com
on 20 Jun 2009 at 5:14
Sure, go right ahead. I mostly needed pie charts for a project and figured I'd
give
back what I had.
Original comment by the.d...@gmail.com
on 20 Jun 2009 at 4:33
Great stuff! I downloaded the latest and the only issue I have is that I can't
create
a separate legend container (see attached screenshot).
Now when I try to use the default legend :(
This code that currently works with an older release and creates the provided
screenshot pie chart.
$.plot($("#bond-chart"), data, {
legend: {
show: true,
labelFormatter: function(label, series) {
return label + ' (' + series.percent.toFixed(2) + '%)';
},
noColumns: 3,
container: $('#bond-legend')
},
// series: {
pie: {
show: true,
showLabel: false,
labelOffsetFactor: 1,
radiusLimitFactor: 4 / 5,
labelFormatter: function(label, series) {
return label;
}
}
//}
});
However when I switch to series: { }, legend { } no legend shows I also tried
series:
{ pie: { }, legend: { } } that also didn't produce the required results.
Any help is appreciated and thanks for all the hard work!
Original comment by shutupan...@gmail.com
on 20 Jun 2009 at 7:02
Attachments:
Unfortunately, that's a side effect of being a plugin. In order to get flot to
not
show the grid (i.e. the axis, ticks, and grid lines) I had to end up sending
back an
empty dataset, which also means no legend. I'm hoping that this can be fixed at
a
later date but with the current plugin system I haven't been able to find a way
to
make it work.
What I would need (and which would be fantastic) would be to either add a grid
option
to hide the grid, or to make the insertLegend function public.
Original comment by the.d...@gmail.com
on 21 Jun 2009 at 6:43
I created a new version of the pie plugin today; this version re-enables the
flot
legend, but it does require slight modification of the jquery.flot.js file
(detailed
in the attached examples.html file)
Original comment by the.d...@gmail.com
on 22 Jun 2009 at 11:14
Attachments:
Thanks to Ole Laursen, some suggestions I had made regarding plugins have been
added
to the SVN so I was able to make the pie plugin a little more intuitive and
enable
the legend by default again.
Cheers!
Original comment by the.d...@gmail.com
on 23 Jun 2009 at 8:28
Attachments:
This plugin is awesome!
Nevertheless, I guess there is a minor issue with it: it does not support zero
(0)
values. For instance, a (20, 30, 50, 0) pie. Is this a known limitation?
Thanks!
Original comment by rmarm...@gmail.com
on 24 Jun 2009 at 2:13
Nope, that's a new bug, nice catch. I guess I (stupidly) never considered that
any of
the data values would be set to zero.
Here is a patched file (v0.3.1):
Original comment by the.d...@gmail.com
on 24 Jun 2009 at 3:32
Attachments:
Fixed a minor bug that was causing the pie to be shifted too far left or right
when
the legend is showing in some cases.
v0.3.2
Original comment by the.d...@gmail.com
on 25 Jun 2009 at 8:27
Attachments:
The value 0 has been omitted in the 0.3.2 ? I hope it can be listed in legend
even
it's 0 and can see nothing in the pie.
I also fund the value 0 issue in 0.3, I check data before add it to avoid this
issue.
Thanks for the flot.pie plugin, it save me from the complex extflot.:)
Original comment by gnom...@gmail.com
on 26 Jun 2009 at 4:20
Since the legend is generated by flot itself, that particular issue is really
outside
the scope of the pie plugin. If the value is zero, it won't show on the pie, or
in
the legend (because it assumes there is no data). The issue that was fixed is
that it
will no longer generate javascript errors that cause nothing to be drawn.
Original comment by the.d...@gmail.com
on 26 Jun 2009 at 3:32
New version (0.4):
I was able to figure out that the reason the series weren't being shown when the
value was zero was a combination of the way the data is passed in to the
plugin, and
some weirdness that Flot does in the case that the series is zero, which I was
able
to handle.
Other changes in this version:
* data can now be passed in using the normal Flot method (an array of data
points,
rather than a single value), and the plugin will simply use the first y-value it
finds. The old method still works too. (This should make it easier to
transition from
other graph types to a pie)
* the pie can now be tilted at an angle using a new "tilt" option.
Additionally, a
drop shadow will be added in most cases.
Original comment by the.d...@gmail.com
on 1 Jul 2009 at 8:00
Attachments:
In some of the previous revisions of this issue, I made some modifications that
allowed hovering and highlights on non-IE browsers (excanvas doesn't support
isPointInPath, so it won't work in IE).
For everyone's review, I'm posting a modification to version 0.4 that adds
support
for this to the new plugin version of pie. It adds a little bloat with some
duplicated code from flot core, particularly the duplication of the color
functionality. Hopefully the core will be updated to make this easier and
smaller in
the future. It would be particularly easy to make the color functionality
accessible
from outside core.
Anyway, hopefully if everyone likes this you'll merge it into the version being
revised in this thread. Thanks.
Original comment by btburnett3
on 2 Jul 2009 at 9:12
Attachments:
That's funny because I was just talking to a co-worker about how mousehovers
might work
with the pies. I'll take a look at the code when I have a little more time.
Just curious why you would need to duplicate the Flot color functionality,
because it
seems like all you would need to do is make a lighter (or darker) version of
the existing color for the particular series (which is trivial to obtain), in
which case
you would only need a very small subset of the code that performs that action.
Original comment by the.d...@gmail.com
on 2 Jul 2009 at 9:27
I'm using the parseColor function and Color class to parse the color string,
apply an
opacity to it, and turn it back into a string to assign to fillColor on the
overlay
context. There might be a better way to do this using less code, this is just
how I
was doing it before with the previous hover code in the non-plugin version.
Original comment by btburnett3
on 2 Jul 2009 at 9:34
My issue was more or less that I didn't know how to detect if the mouse was
over a
particular slice or not (and I hadn't really looked into it), but it seems that
you
have figured that out. I'm thinking that it might be easier to just use a
duplicate arc
with say a 25% opacity white background directly over top the original in the
overlay.
I'll have a look at what you have and maybe play around with that.
Original comment by the.d...@gmail.com
on 2 Jul 2009 at 10:04
Hi,
Is it possible to print the graphs to a PDF file?
Anybody?
Original comment by webmas...@seemecv.com
on 3 Jul 2009 at 8:26
Hi,
I think it's cool you're working on this. About the color stuff: if it's needed
and
you figure out what it takes to pull out, just send a patch (e.g. in a new
issue) and
I'll get it merged.
I think it makes sense to put the pie plugin code in the Flot repository if you
want
to maintain it. If you're interested, I'll figure out how to add you as a
developer
so you can write changes directly to SVN.
Printing: I think the best bet is the browser print command. At least Firefox on
Linux has a "output to PDF" option.
Original comment by olau%iol...@gtempaccount.com
on 3 Jul 2009 at 10:24
Hi,
I found a minor issue in the pie when using excanvas with IE. If the graph
only has
1 series for 100%, excanvas isn't drawing the graph. I've put a quick patch in
by
drawing for slightly less than 100% on IE. Currently I'm using $.browser.msie
to
test for this, but I'm assuming that there's a better way to test if excanvas is
being used if anyone has any suggestions.
I've attached the patch here, based on my previous revision that added hover
support.
Also, I think it would be a great idea to get the pie support as an extension
into
the SVN repository. Working with it here in an issue is cumbersome.
Brant
Original comment by btburnett3
on 9 Jul 2009 at 7:24
Attachments:
This is SO ridiculous! I love working with jquery and javascript. I'm happy to
contribute and release projects but this thing is very frustrating. I need a
recent /
relatively stable version with pie + hover + horizontal bars. Between the all
inclusive branches and plugin branches all appended in this thread it's
difficult to
know what's what. I have many additions that I expect people would appreciate
such as
an optional border layout for pie labels and a world map, but I don;t even know
which
version to use as a base, I currently made my changes to the all inclusive
branches.
Does anyone have a suggestion for me? I'm about to abandon my work on this
plugin
alltogether and start searching for something that is better maintained, even
if it's
a little further back, I might even have to use Flash! ACK! :)
Original comment by anthony....@gmail.com
on 15 Jul 2009 at 3:38
I included my pie updates to those of btburnett3 and posted them here:
http://suddendevelopment.com/?p=59
all of the updates are optional. They are: Border layouts for labels. Inner
Radius
for Donut hole. Created a workaround to allow hover in IE.
Original comment by anthony....@gmail.com
on 31 Jul 2009 at 3:43
Sorry I am a newcomer to Flot Pie charts.
I got a wonderful fine working presentation:
http://suddendevelopment.com/?p=59
However it conflicts with jquery-ui-1.7.2.custom.min.js
which I actually also need.
Could anybody teach me the best library download set for:
- excanvas
- jquery
- jquery-ui
- jquery.flot
- jquery.flot.pie
- jquery.rightClick
Now if I try jquery.flot.pie, I get a mess of libraries.
How can I make them work friendly?
Sincerely,
Yury.
Original comment by kaza...@variosecure.net
on 14 Aug 2009 at 11:08
Has anyone done any work on making the pie slices themselves clickable, and not
just
the labels?
If anyone has done something like this, or has ideas on where to start on
making this
happen, let me know at ljarmin@umich.edu Thanks!
Original comment by ljar...@umich.edu
on 22 Aug 2009 at 4:32
before pie slice click event is created, I want to know how to add click event
for
the label, with or w/o legend.
Thanks,
Benjamin
Original comment by liupingp...@gmail.com
on 10 Sep 2009 at 3:48
Can I ask why this plugin is not yet into the SVN?
It would be much easier to have the latest version if it was...
Original comment by xavi.ivars
on 22 Sep 2009 at 4:38
I haven't had any time to work on this lately, as I've been frantically working
on
the project that originally prompted my need for the pie graphs, but that it
nearing
completion and I should hopefully have some time to devote to this in the near
future.
I agree, adding the plugin to the repository would be great, let me know if
there is
anything that you need from me in terms of getting that set up.
It looks like doing the mouse hovers isn't going to be too difficult, and I'd
like to
also add the ability to use click events on the pie slices as well, but I
haven't
looked into the base code for that portion at all yet, so I don't know how
difficult
that is going to be.
Original comment by the.d...@gmail.com
on 22 Sep 2009 at 5:06
Thanks for having time to answer my question!
I think that "bugs" of the plugin are acceptable, because the plugin works well
(except the known-issues), and it would be great to have it in the SVN as it is
now
(maybe with a "known-issues" text).
That way, this issue could be closed (pie charts DO exist now for flot), and it
would
be much easier for you and for everyone else to continue developing the plugin
(just
sending patches agains svn version when an improvement is done or a bug is
fixed),
and of course it would be much easier to download last version without the need
of
reading all issue's thread to find where are last patches applied (currently,
if I'm
not wrong, they're at comment #82 (
http://code.google.com/p/flot/issues/detail?id=5#c82 )
the.dOrp (sorry, I don't know your name): do you think it's a good idea to send
last
version (in comment #82) to Ole Laursen and ask him to include it in svn?
Original comment by xavi.ivars
on 22 Sep 2009 at 5:20
It was actually Ole Laursen's idea to add the plugin to the repository. I think
its a
great idea, and will do what I can with it.
My name is actually Brian Medendorp (and you can probably see where the
username came
from), but apparently there is no way to change the display name in google
code? I
haven't been able to find anyway to do that.
Original comment by the.d...@gmail.com
on 22 Sep 2009 at 5:36
[deleted comment]
Hi guys, love the work you've done on flot by adding a pie chart. It took me a
while,
but I've added the ability to use gradient fills in the pie chart. When I have
time
I'll work on reflecting that in the legend area (right now it just shows the
begin
gradient color).
I implemented it by using the regular slice color and using the colors
specified in
the gradient option to form a gradient. It looks okay when two colors are used
and
less nice when multiple colors are used.
Anyways, I'm including the changes I made, incase someone wants to use them or
make
it better. Thanks to Brian Medendorp, Anthony Aragues, and everyone who made
this
plugin possible.
Original comment by blitekni...@gmail.com
on 30 Sep 2009 at 9:31
Attachments:
Issue 67 has been merged into this issue.
Original comment by olau%iol...@gtempaccount.com
on 7 Oct 2009 at 6:07
Brian: I'm going to add you as developer right now. I'm not going to try to
guess
which one of the files here I need to add. :) If you just add the plugin code
alongside the other plugins in the root and stick the example in examples/ with
a
link from index.html, then let's take it from there. We can always figure out
whether
another structure is better later.
I'll assign bug reports about the pie plugin code, if any :), to you in the
future.
Once the feedback on this issue is incorporated, we should probably close it.
Original comment by olau%iol...@gtempaccount.com
on 21 Oct 2009 at 5:42
Yesterday, I found a bug in the pie plugin.
It's a conflict if you have prototype on the same page. ([off-topic] it's a
wordpress
plugin that needs prototype, so I'm wondering if disabling it because too many
javascript libraries..)
Prototype adds some functions to extend the native array object, and that's why
for(... in ...) stops working as it worked before.
So what they propose is instead of using
for(var item in myArray) {
// Your code working on item here...
}
use
for (var index = 0; index < myArray.length; ++index) {
var item = myArray[index];
// Your code working on item here...
}
or, still better in very large arrays
for (var index = 0, len = myArray.length; index < len; ++index) {
var item = myArray[index];
// Your code working on item here...
}
I attach the modified file, and a diff with the old version.
Original comment by xavi.ivars
on 22 Oct 2009 at 8:31
Sorry, I forgot to attach the files
Original comment by xavi.ivars
on 22 Oct 2009 at 8:45
Attachments:
Ole: Thanks for adding me as a developer!
I've been working on adding a number of the patches into the base of the pie
plug-in,
but I think I am going to wait until I get all of them incorporated before
committing
the first version (which should be sometime next week).
Right now I've added a number of the bug fixes and the donut hole option, and
still
need to add and test the hover functionality (and I see no reason why I can't
add
clicks at the same time), and possibly the gradient options. I don't see any
reason
to add in the label border options because that can already be accomplished
with a
labelFormatter function and/or CSS.
Original comment by the.d...@gmail.com
on 23 Oct 2009 at 10:58
Unless my versions are all out of whack, pie chart hovers/mouseovers do not
seem to
work properly in current versions of Chrome and Safari. Playing around with
the pie
code, it looks like isPointInPath returns false for most points in Webkit where
Firefox returns true. There's an open bug or two in webkit about this right now
which could be the source of this issue (haven't put on my thinking cap tight
enough
to run through the full math of the code).
https://bugs.webkit.org/show_bug.cgi?id=30402
My solution for the moment was simply to always fall back on the in-code
function
isPointInPoly for all browsers. Probably slower, but works in all of them.
Original comment by sollaires@gmail.com
on 29 Oct 2009 at 8:07
[deleted comment]
There are so many versions of the pie code right now I don't think I'll add
another
file to the mix until it's actually committed. My fix was simply to replace
the line
(in my copy, it's on line 544):
if(ctx.isPointInPath){
with
if(false && ctx.isPointInPath){
This is certainly not the desired functionality in the long run, just a simple
workaround to meet a deadline :)
Original comment by sollaires@gmail.com
on 2 Nov 2009 at 4:00
Hi, Brian, waiting for you.
Original comment by gbainao...@gmail.com
on 7 Nov 2009 at 11:59
Original issue reported on code.google.com by
mmihajlo...@gmail.com
on 6 Dec 2007 at 6:39