Giter Site home page Giter Site logo

Pie Charts about flot HOT 127 CLOSED

flot avatar flot commented on June 19, 2024
Pie Charts

from flot.

Comments (127)

dnschnur avatar dnschnur commented on June 19, 2024

From [email protected] on February 07, 2008 21:22:07
I have added pie chart + multiple bars chart support functions. Please take a look
at demo.html, and also svn diff in diff.txt file.

from flot.

dnschnur avatar dnschnur commented on June 19, 2024

From [email protected] on February 07, 2008 21:31:36
Looks fantastic! Have you tried it with a shadow effect?

from flot.

dnschnur avatar dnschnur commented on June 19, 2024

From [email protected] on February 07, 2008 21:35:28
It is the next step of my experiment.

from flot.

dnschnur avatar dnschnur commented on June 19, 2024

From [email protected] on February 27, 2008 21:02:03
Shadow, shadow and shadow everywhere

from flot.

dnschnur avatar dnschnur commented on June 19, 2024

From [email protected] on February 28, 2008 05:18:36
Lookin good. Only I don't think the shadow should show between the pie pieces. Is
there a way to change the direction?

from flot.

dnschnur avatar dnschnur commented on June 19, 2024

From [email protected] on March 11, 2008 15:53:09
how about a diff against flot 0.4

from flot.

dnschnur avatar dnschnur commented on June 19, 2024

From [email protected] on March 11, 2008 20:17:02
Here is the diff. FYI, the code also has functionality to show data click point but
I don't have time to make a demo page.

from flot.

dnschnur avatar dnschnur commented on June 19, 2024

From [email protected] on March 26, 2008 03:26:53
It's really cool. If you can provide the uncompressed version of modified flot.js
i'll be very thankful to you.

from flot.

dnschnur avatar dnschnur commented on June 19, 2024

From [email protected] on April 01, 2008 18:26:26
What do you patch diff04.txt against? I tried patching the patched v0.3 version and
the current v0.4 version and both did not fully patch, can you provide a pre patched
unpacked version or instructions on what to patch and in what order?

from flot.

dnschnur avatar dnschnur commented on June 19, 2024

From [email protected] on April 03, 2008 13:50:18
Here is the unpack version of modified jquery.flot.js

from flot.

dnschnur avatar dnschnur commented on June 19, 2024

From [email protected] on July 16, 2008 11:27:16
It seems that the pie graph cannot work with one series of data? Am I missing something?

from flot.

dnschnur avatar dnschnur commented on June 19, 2024

From [email protected] on July 16, 2008 11:28:05
It seems that the pie graph cannot work with one series of data? Am I missing something?

from flot.

dnschnur avatar dnschnur commented on June 19, 2024

From [email protected] on July 23, 2008 11:01:56
var dataSet = [{label:"title1", data:[[0, 100]]},
{label:"title2", data:[[1, 200]]},
{label:"title3", data:[[2, 300]]}];
var options = {
pies: { show: true, autoScale: true, fillOpacity: 1 }
};
$.plot($("#pieChart"), dataSet, options );

from flot.

dnschnur avatar dnschnur commented on June 19, 2024

From koneru.chowdary on August 25, 2008 10:04:52
How can we get the location i mean the label when mouseover on particular arc ?

anyone have idea?

from flot.

dnschnur avatar dnschnur commented on June 19, 2024

From [email protected] on September 16, 2008 19:53:46
how can i change the color of any specific series

from flot.

dnschnur avatar dnschnur commented on June 19, 2024

From [email protected] on November 21, 2008 10:13:56
Does the latest flot version 0.5 support pie charts?

from flot.

dnschnur avatar dnschnur commented on June 19, 2024

From [email protected] on December 08, 2008 22:27:10
same question - does .5 support pie charts? anybody want to answer this one?

from flot.

dnschnur avatar dnschnur commented on June 19, 2024

From [email protected] on December 09, 2008 14:38:47
No, I haven't had time to work on flot since the latest patch I made in Feb.

from flot.

dnschnur avatar dnschnur commented on June 19, 2024

From [email protected] on December 09, 2008 14:53:42
to change colors for any specific series, you can define option as follows:

var options = {colors: ["#9440ed","#4da74d", "#edc240","#afd8f8","#cb4b4b"]}

the order of colors corresponded of data order defined in data set variable.

from flot.

dnschnur avatar dnschnur commented on June 19, 2024

From [email protected] on December 15, 2008 17:18:32
Would be really helpful if the code could be either supplied in a .js file that could
be used next to jquery.flot.js (version 0.5) or included in this file, so webapps can
use the pie chart together with the flot chart more easily. Is this do-able?

from flot.

dnschnur avatar dnschnur commented on June 19, 2024

From [email protected] on January 05, 2009 06:27:56
It is a highly desirable feature....

from flot.

dnschnur avatar dnschnur commented on June 19, 2024

From [email protected] on January 08, 2009 10:45:42
I'm available to integrate the diff04.txt into the newer 0.5 jquery.flot.js.
Please write me to coordinate for this issue, cause I wish to know if is possible to
integrate directly in the development version.

from flot.

dnschnur avatar dnschnur commented on June 19, 2024

From [email protected] on January 08, 2009 10:52:38
Hi Farbrizio, unfortunately I don't have any email address from you but I need pie
charts within the next week for flot so I will do at least port it to 0.5. If you
need help just contact me directly at [email protected]. Resources like hg
repository with patch queue containing initial merge with 0.5 available at my site.

from flot.

dnschnur avatar dnschnur commented on June 19, 2024

From [email protected] on January 08, 2009 15:51:28
I have modified the r120 applying the patch. All seems to work perfectly.

Here the patch, jquery (r120) patched and a demo.

I have cutted the DrawBar improvement cause it doesnt work under the demo, so I
prefer to make pie chart working (and I dont need the Bar improvement).

Please advise me if this changes will be merged in the SVN, so I will continue to use
latest version insted of mine.

I suggest also to change the release number (0.6?), due to the fact that 0.5 has no
pie support.

from flot.

dnschnur avatar dnschnur commented on June 19, 2024

From [email protected] on January 12, 2009 17:10:30
Fabrizio, thanks for your patch porting. I continued your work because your patch is
not fully aligned to flot's coding style (bracket placement, tab/space usage).
Furthermore it still contains some pieces from the bar chart patch. I also built an
HTML example page suitable (hopefully) for inclusion in flot's example directory
which just shows the pie chart usage.

I'm not yet finished with the cleanup but I wanted to avoid duplicate work so I
pushed my patches in a hg repository where you can always access the latest version:
http://oss.schwarz.eu/cgi-bin/hgwebdir.cgi/flot_charts/

My patches diffed against float 0.5 because I need this working on a stable version
but I think it is quite easy re-doing them against SVN trunk)

Issues still open:

  • pie chart patch still contains unrelated things (random color)
  • data interface for pie charts is not that nice: Currently it is the same as for
    normal time series. But pie charts should imho just get a single value. There is
    another pie chart implementation
    (http://groups.google.com/group/flot-graphs/browse_thread/thread/9b1e73e4025b376c)
    which gets this right. Probably I will try to port this interface.

from flot.

dnschnur avatar dnschnur commented on June 19, 2024

From [email protected] on January 30, 2009 21:20:41
Hi Felix, I can't seem to apply your patches to the released 0.5, is there something
special I should be doing :( ... even when I strip out the 'diff -r xxx' lines and
apply the patches individually in the order specified in 'series' I get invalid hunk
complaints :(

I'd really like to get the pie-charts working from your patch, with the gradient
support provided in the trunk. (p.s. I'm loving the new charts in Agilo)

from flot.

dnschnur avatar dnschnur commented on June 19, 2024

From [email protected] on January 30, 2009 21:55:33
After looking at my patches, I noticed that - opposed to my previous post - I diffed
them against trunk (r122).

Btw: I did some serious cleanup on my patches so the only outstanding issue is the
data interface for piecharts.

from flot.

dnschnur avatar dnschnur commented on June 19, 2024

From [email protected] on February 18, 2009 14:49:45
Hi,
here I have worked on the patch diff for r132

There are some hacks for multibar, due to some bug i have found (like labels not
exactly under the bars), and for these reasons multibar is not perfect. I use
currently the pie-chart for my project and I have no side-effect (like the multi-bar
instead).

-Fabrizio.

from flot.

dnschnur avatar dnschnur commented on June 19, 2024

From [email protected] on February 21, 2009 05:36:06
Can the pie chart support json data? :). I will test it.
Also, I suggest that we can make a change to the json data input to select the column
that will be plotted.

from flot.

dnschnur avatar dnschnur commented on June 19, 2024

From [email protected] on February 23, 2009 09:08:51
Here the updated version (r136) of the patch

from flot.

dnschnur avatar dnschnur commented on June 19, 2024

From [email protected] on February 24, 2009 21:19:01
The X labels on multibar charts are not offset correctly. Quite frustrating.

from flot.

dnschnur avatar dnschnur commented on June 19, 2024

From btburnett3 on February 25, 2009 21:13:44
I've created a new patch based upon r136 and the code in Comment 34 by
fabrizio.ciacchi that adds some new features that I needed.

Pies now support hovering if "hoverable" is set to true in the grid options, though
it doesn't work in IE because excanvas doesn't support the isPointInPath function
(just never gives a hover event or effect). options.pies supports two new options,
"highlightColor" and "highlightOpacity" which control the look of the hover effect.
The datapoint passed in the item to the hover event handler will have the first value
as the percentage, and the second value as the actual summarized value.

The series data can now be either a raw number or a normal data array that is
summarized. The percentage that is calculated is also stored on the series object as
"percent" during rendering for later reference.

options.pies now supports an optional "labelFormatter" function that formats the
label that is displayed for each series. The first parameter is the calculated
percentage, the second parameter is the series object. If no function is supplied,
the label is formatted the same as before (just a percent sign).

from flot.

dnschnur avatar dnschnur commented on June 19, 2024

From [email protected] on February 25, 2009 21:22:03
Hi guys,

I really like that so many people try to improve and extend this but let's have a
simple pie chart thing in Flot before making even more changes. If you really want to
extend the current base, I suggest you open an account on bitbucket or github with a
patch queue so the new additions can be marked clearly. The current attachment flood
is a mess.

I did not have the time to review Fabrizio's changes but in my repository
(http://oss.schwarz.eu/cgi-bin/hgwebdir.cgi/flot_charts/) you find nicely separated
patches by feature. Let's work in a structured way otherwise this will never be done.

from flot.

dnschnur avatar dnschnur commented on June 19, 2024

From btburnett3 on February 26, 2009 14:00:40
Based on felix's comment above, I checked out github and found another branch of flot
that seems to have more functionality at http://github.com/thenduks/flot/tree/master.
There was some discussion there about adding pie charts, and the conclusion was that
due to size flot should probably be broken out into multiple modules for different
chart types. I've forked the project at
http://github.com/btburnett3/flot/tree/master while I work on it. I'll hopefully
have something in a few days.

from flot.

dnschnur avatar dnschnur commented on June 19, 2024

From [email protected] on March 02, 2009 14:11:46
Hi all,
I have updated the patch to r139. There are some bug i have no time to fix:

  • the X labels on multibars are not aligned (yes, I know that is very frustrating);
  • for piechart i disable the points valutation in for-cicle (I try to pass from data
    to datapoints);

I have made a bit of refactoring, so all the "new" functions are at the end of the
file, and the other patched part contains "added" part, not sostitution, so I think
could be simpler to mantain the future patch.

I'm thinking about mantaining this patch and I wish to fix the multibar chart, that
is "orrible" coded. I dont understand however, why pie-chart are not merged into
flot, I use this patched version of flot for a webanalytics project and pie-chart
seems not to be affected by bugs.

I wish to find a way to mantain a patched version, perhaps I need to think to a way
of using different chart with a sort of plugin system, so we can have the core flot
regulary updated by this svn, and the patched version only as an adding file to use.
I talk about this, cause there are a lot of functionality developed by good
programmer (have you seen flot on github?), but is stupid not to mantain link to
original project. Another good reason is also that, for example, btburnett3 is
adpating flot for YUI framework, not Jquery, so could be beautiful to make flot
js-platform-independent.

from flot.

dnschnur avatar dnschnur commented on June 19, 2024

From olau%[email protected] on March 02, 2009 15:36:19
The first step in getting this merged is a critical review. The code must be in good
condition, and it needs to be on par with the rest of Flot when it comes to API
quality/usage.

from flot.

dnschnur avatar dnschnur commented on June 19, 2024

From [email protected] on March 02, 2009 15:49:11
In this weeks I try to bring pie chart to this level and I will give you a patch.
For multibar I think it need a complete redesign.

from flot.

dnschnur avatar dnschnur commented on June 19, 2024

From JACortinas on March 02, 2009 17:12:20
We should really work on coming up with a good plug-in system for flot. It would be
nice to just be able to add a js file like 'flot.chart.pie.js after 'flot.core.js'
and be able to call $('#placeholder').plot('pie', data, options).

from flot.

dnschnur avatar dnschnur commented on June 19, 2024

From [email protected] on March 05, 2009 17:55:30
I will use jfreechart and keep on my interest on javascript charting.

Yeah, I agree with a complete redesign to learn some from jfreechart and from
dojox.charting. I think if it is depedent on jquery is a good idea.

from flot.

dnschnur avatar dnschnur commented on June 19, 2024

From [email protected] on March 09, 2009 11:29:58
I have updated the patch to r144. I wish this week I can send the patch for pie chart
only.

from flot.

dnschnur avatar dnschnur commented on June 19, 2024

From [email protected] on March 10, 2009 17:32:57
Updated to r146. The r144 has a bug that make flot not working under IE.

from flot.

dnschnur avatar dnschnur commented on June 19, 2024

From [email protected] on March 13, 2009 10:54:54
Updated to r147. Attached also a minified version.

from flot.

dnschnur avatar dnschnur commented on June 19, 2024

From [email protected] on March 19, 2009 11:02:35
Hi Fabrizio, it seems that the patch 147 is ... the source of JQuery.
flot is a great lib btw. congrats.

from flot.

dnschnur avatar dnschnur commented on June 19, 2024

From [email protected] on March 26, 2009 16:47:35
Congratulations for this great job.

I used it the simply way :
var data_pie_0 = [
{ label: 'Niveau A', data: [[0,2]]},
{ label: 'Niveau B', data: [[1,2]]},
{ label: 'Niveau C', data: [[2,1]]},
{ label: 'Niveau D', data: [[3,0]]}
];
$.plot($('#pie_graph_0'), data_pie_0, {
pies: {show: true, labelWidth: 30, fontSize: 10, autoScale: true, fillOpacity: 1}
});

You noticed the ZERO data value ---> The last slice recover all the over (under IE)
if the zero value is the last data entry, and will be slightly present under the
others if it is the first data enry.

I corrected this in the drawMyPieSeries functions:
...
startAngle=endAngle;
if (series[j].data == 0)
endAngle+=0.0001_(2_Math.PI);
else
endAngle+=pct_(2_Math.PI);
...

Hope this help.

from flot.

dnschnur avatar dnschnur commented on June 19, 2024

From [email protected] on March 27, 2009 18:46:17
Hi, I'm developing flot wrapper of Ext JS
http://code.google.com/p/extflot/

Now, I'm working to migrate pie chart support.
I use pathed r148.
But it does not work well.

  • The series[i].data is overwrited internally, but my wrapper recycles series that
    is got by getData(), and calls plot() many times...
    So I propose that the calcurated values from data are hold in another member.

{{{
function preparePieData(series)
{
for(i = 0; i < series.length; i++)
{
var ratio = 0;
for(j = 0; j < series[i].data.length; j++)
ratio += parseInt(series[i].data[j][1]);

            series[i].ratio = ratio;
        }
    }

}}}

I think the pie chart support is very good job.
So I hope that it is released as official.

I'm sorry my poor English.
Thanks,

from flot.

dnschnur avatar dnschnur commented on June 19, 2024

From [email protected] on March 27, 2009 18:57:25
Hi Fabrizio,

As you may see that I initiated multi bar and pie chart support code, I would like to
jump back to the board again because I have a project which involves with graph
presentation. Do you want to work together on the "to do" list to improve the code?
If so please shoot me email at [email protected]. Thanks.

from flot.

dnschnur avatar dnschnur commented on June 19, 2024

From [email protected] on April 22, 2009 20:28:40
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

from flot.

dnschnur avatar dnschnur commented on June 19, 2024

From [email protected] on April 27, 2009 17:49:28
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!

from flot.

dnschnur avatar dnschnur commented on June 19, 2024

From [email protected] on April 28, 2009 06:52:07
Hi all,
Does any patch will work for pie with tool tip? (in IE)

from flot.

dnschnur avatar dnschnur commented on June 19, 2024

From [email protected] on April 28, 2009 07:57:20
please help!!! excanvs does not support isPointOnPath,so what will be the solution

from flot.

dnschnur avatar dnschnur commented on June 19, 2024

From [email protected] on April 29, 2009 19:29:53
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

from flot.

dnschnur avatar dnschnur commented on June 19, 2024

From [email protected] on May 04, 2009 08:27:23
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

from flot.

dnschnur avatar dnschnur commented on June 19, 2024

From [email protected] on May 05, 2009 10:44:51
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 + '%
' + label + '
(' +
value + ')
';

}
  • 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



    "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

from flot.

dnschnur avatar dnschnur commented on June 19, 2024

From [email protected] on May 15, 2009 22:28:06
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).

from flot.

dnschnur avatar dnschnur commented on June 19, 2024

From [email protected] on May 21, 2009 18:32:07
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.

from flot.

dnschnur avatar dnschnur commented on June 19, 2024

From [email protected] on June 18, 2009 23:23:57
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.

from flot.

dnschnur avatar dnschnur commented on June 19, 2024

From [email protected] on June 19, 2009 11:50:23
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 ?

from flot.

dnschnur avatar dnschnur commented on June 19, 2024

From [email protected] on June 20, 2009 05:14: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

from flot.

dnschnur avatar dnschnur commented on June 19, 2024

From [email protected] on June 20, 2009 16:33:09
Sure, go right ahead. I mostly needed pie charts for a project and figured I'd give
back what I had.

from flot.

dnschnur avatar dnschnur commented on June 19, 2024

From [email protected] on June 20, 2009 19:02:44
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!

from flot.

dnschnur avatar dnschnur commented on June 19, 2024

From [email protected] on June 21, 2009 06:43:09
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.

from flot.

dnschnur avatar dnschnur commented on June 19, 2024

From [email protected] on June 22, 2009 23:14:09
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)

from flot.

dnschnur avatar dnschnur commented on June 19, 2024

From [email protected] on June 23, 2009 20:28:17
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!

from flot.

dnschnur avatar dnschnur commented on June 19, 2024

From [email protected] on June 24, 2009 14:13:04
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!

from flot.

dnschnur avatar dnschnur commented on June 19, 2024

From [email protected] on June 24, 2009 15:32:31
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):

from flot.

dnschnur avatar dnschnur commented on June 19, 2024

From [email protected] on June 25, 2009 20:27:47
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

from flot.

dnschnur avatar dnschnur commented on June 19, 2024

From [email protected] on June 26, 2009 04:20:25
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.:)

from flot.

dnschnur avatar dnschnur commented on June 19, 2024

From [email protected] on June 26, 2009 15:32:32
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.

from flot.

dnschnur avatar dnschnur commented on June 19, 2024

From [email protected] on July 01, 2009 20:00:47
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.

from flot.

dnschnur avatar dnschnur commented on June 19, 2024

From btburnett3 on July 02, 2009 21:12:50
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.

from flot.

dnschnur avatar dnschnur commented on June 19, 2024

From [email protected] on July 02, 2009 21:27:46
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.

from flot.

dnschnur avatar dnschnur commented on June 19, 2024

From btburnett3 on July 02, 2009 21:34:35
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.

from flot.

dnschnur avatar dnschnur commented on June 19, 2024

From [email protected] on July 02, 2009 22:04: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.

from flot.

dnschnur avatar dnschnur commented on June 19, 2024

From [email protected] on July 03, 2009 08:26:25
Hi,

Is it possible to print the graphs to a PDF file?

Anybody?

from flot.

dnschnur avatar dnschnur commented on June 19, 2024

From olau%[email protected] on July 03, 2009 10:24:31
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.

from flot.

dnschnur avatar dnschnur commented on June 19, 2024

From btburnett3 on July 09, 2009 19:24:02
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

from flot.

dnschnur avatar dnschnur commented on June 19, 2024

From [email protected] on July 15, 2009 15:38:22
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! :)

from flot.

dnschnur avatar dnschnur commented on June 19, 2024

From [email protected] on July 31, 2009 15:43:09
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.

from flot.

dnschnur avatar dnschnur commented on June 19, 2024

From [email protected] on August 14, 2009 11:08:30
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.

from flot.

dnschnur avatar dnschnur commented on June 19, 2024

From [email protected] on August 22, 2009 16:32:37
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 [email protected] Thanks!

from flot.

dnschnur avatar dnschnur commented on June 19, 2024

From [email protected] on September 10, 2009 15:48:41
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

from flot.

dnschnur avatar dnschnur commented on June 19, 2024

From xavi.ivars on September 22, 2009 16:38:15
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...

from flot.

dnschnur avatar dnschnur commented on June 19, 2024

From [email protected] on September 22, 2009 17:06:37
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.

from flot.

dnschnur avatar dnschnur commented on June 19, 2024

From xavi.ivars on September 22, 2009 17:20:44
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?

from flot.

dnschnur avatar dnschnur commented on June 19, 2024

From [email protected] on September 22, 2009 17:36:21
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.

from flot.

dnschnur avatar dnschnur commented on June 19, 2024

From [email protected] on September 30, 2009 21:31:50
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.

from flot.

dnschnur avatar dnschnur commented on June 19, 2024

From olau%[email protected] on October 21, 2009 17:42:45
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.

from flot.

dnschnur avatar dnschnur commented on June 19, 2024

From xavi.ivars on October 22, 2009 08:31:48
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.

from flot.

dnschnur avatar dnschnur commented on June 19, 2024

From xavi.ivars on October 22, 2009 08:45:49
Sorry, I forgot to attach the files

from flot.

dnschnur avatar dnschnur commented on June 19, 2024

From [email protected] on October 23, 2009 22:58:06
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.

from flot.

dnschnur avatar dnschnur commented on June 19, 2024

From [email protected] on October 29, 2009 20:07:25
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.

from flot.

dnschnur avatar dnschnur commented on June 19, 2024

From [email protected] on November 02, 2009 16:00:27
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 :)

from flot.

dnschnur avatar dnschnur commented on June 19, 2024

From [email protected] on November 07, 2009 11:59:38
Hi, Brian, waiting for you.

from flot.

dnschnur avatar dnschnur commented on June 19, 2024

From [email protected] on November 18, 2009 15:36:10
Any update on the pie chart issue with hovers/clicks? The problem seems to be with
isPointInPath(x,y) always returning false.

from flot.

dnschnur avatar dnschnur commented on June 19, 2024

From [email protected] on November 18, 2009 15:50:00
I'm currently working on it, and am very close to having a fully working version. I apologize for the delay, I haven't had much time to work on this recently because among
other things, I spent a little over two weeks serving on jury duty. I'll have something
to upload as soon as I verify that it works properly across the board.

from flot.

dnschnur avatar dnschnur commented on June 19, 2024

From [email protected] on November 20, 2009 23:40:46
I have completed my first version of the pie plugin and committed it to the
repository! Sorry that it took so long, I had a significant setback this week by a
bug that required me to rewrite certain portions from the ground up, but everything
seems to be working now!

We should be able to close out this issue, and can start a new one for any bugs that
people find or patches they wish to submit.

It would also be advantageous to add parseColor to the list of public functions from
within flot itself, so that plugins have access to that rather useful little feature.

from flot.

dnschnur avatar dnschnur commented on June 19, 2024

From [email protected] on November 21, 2009 11:32:26
Thanks, Brian!

I run the example and find many many   . Could we get a better design for it?

from flot.

dnschnur avatar dnschnur commented on June 19, 2024

From [email protected] on November 21, 2009 12:28:46
sorry, it is my mistake. :(.

from flot.

dnschnur avatar dnschnur commented on June 19, 2024

From [email protected] on November 27, 2009 16:25:28
Excellent work Brian,

The only issue I have noticed is a break with the flot events. plothover only appears
to be firing when the mouse is over the pie as opposed to when it is over the plot
area. This means that you can't do any processing for when the mouse moves off the
pie slices.

I've included a trivial patch if you agree with my reasoning above.

-Peter

from flot.

dnschnur avatar dnschnur commented on June 19, 2024

From [email protected] on December 16, 2009 19:09:26
I'm trying to print out the pie chart in IE. The first slice in the first chart is
always hidden. I've tried this in IE 6, 7, and 8.

I also tried the examples that are available in source control and found the same
problem. I tried hiding different charts, and the first slice of the first chart is
always hidden. For instance, I commented out the code for the first two charts
(default and graph1) and then graph2's first slice is hidden.

I've included two screenshots to illustrate what I mean. The first is from the
application I am working on. The second is using the examples from source control.

from flot.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.