Jump to content

Pie chart - is there a better way?


torekp

Recommended Posts

I slightly modified the NI example Pie chart.vi in piechart.llb to get the following. What I changed:

oriented labels (important for thin wedges);

changed default colors;

automatically recycles thru colors after the first (by default) 8;

defaults to using text labels, rather than labeling pie wedges by their size percentage.

post-4616-1160680647.png?width=400

post-4616-1160680666.png?width=400

I'd like to use the pie chart to display disk usage in a directory hierarchy, for example to answer a question like "where are most of my *.log files, and do I need to delete some?"

Am I missing a much better idea? Any ideas appreciated on how to make it more user-friendly. LV8.0, attached.

Download File:post-4616-1160681060.vi

Download File:post-4616-1160681073.vi

Link to comment
Am I missing a much better idea? Any ideas appreciated on how to make it more user-friendly. LV8.0, attached.

I like love the program Spacemonger, which (IMHO) much better shows where data goes with something called treemaps:

spacemonger-tiny.gif

Version 1.4 is freeware, 2.0 is shareware, but has some interesting options. It can create a Pie-chart based on data type. This gives me the option to group LV files (lvclass/llb/vi/lvproj/..) into one wedge.

[plug]

This program has proven me of great use. when my HD was filled with measurements

[/plug]

What do you wanna do with this piece of code?

Ton

PS Sorry I point you at a non-LV program :oops:

Link to comment
I slightly modified the NI example Pie chart.vi in piechart.llb to get the following. What I changed:

oriented labels (important for thin wedges);

changed default colors;

automatically recycles thru colors after the first (by default) 8;

defaults to using text labels, rather than labeling pie wedges by their size percentage.

post-4616-1160680647.png?width=400

post-4616-1160680666.png?width=400

I'd like to use the pie chart to display disk usage in a directory hierarchy, for example to answer a question like "where are most of my *.log files, and do I need to delete some?"

Am I missing a much better idea? Any ideas appreciated on how to make it more user-friendly. LV8.0, attached.

Here was my go at that same challenge from about 3 yeras ago.

Download File:post-29-1160683057.zip

This code was featured (?) in the very first "The Good, the Bad, and the Ugly". It was one of the ugly/bad examples.

It did not use event structures! it polled the picture control!

I had not learned how to sorting with a cluster, so I wrote my own Bubble sort".

You click on a wedge to drill down.

You click on the "Up one level" string to go up one level.

Warning!

Large, full disks will take a long time!

You can all feel free to laugh and joke if you want. I think this code was the result of a long week-end alone with a case of :beer: and I was trying to figure out what my son had done with all of my disk space.

I'd love to an improved version, so share back if possible.

"What the H#@$ it works!"

I still use this code every time I fill my hard drive.

Ben

Link to comment
I like love the program Spacemonger, which (IMHO) much better shows where data goes with something called treemaps:

spacemonger-tiny.gif

Version 1.4 is freeware, 2.0 is shareware, but has some interesting options. It can create a Pie-chart based on data type. This gives me the option to group LV files (lvclass/llb/vi/lvproj/..) into one wedge.

[plug]

This program has proven me of great use. when my HD was filled with measurements

[/plug]

What do you wanna do with this piece of code?

Ton

PS Sorry I point you at a non-LV program :oops:

Since everybody is getting out of topic, let me add my voice to the chorum to say that I prefer spacemonger to the sequoia one (I dont like the 3d effect). I am actually evaluating spacemonger version 2.1.

PJM

Link to comment

Thanks everybody for your help. Ben, your VI is very much along the lines of what I want to do. I'll look into it and borrow all the good ideas and maybe I can give back something you can use.

spacemonger [...] 2.0 is shareware, but has some interesting options. It can create a Pie-chart based on data type. This gives me the option to group LV files (lvclass/llb/vi/lvproj/..) into one wedge.

[...]

What do you wanna do with this piece of code?

Ton

PS Sorry I point you at a non-LV program

Hey, Labview can fire up other programs, so it's all good. And if the non-LV program can save its results to a file which you can then make sense of with Labview, it could all fit in very nicely. But the 1.4 freeware version, which I tried, didn't have any save-results feature. :(

The idea of grouping LV files into one pie wedge (among various file types) is sort of similar to what I want to do. But as a first go, I'm thinking about showing only files of the selected types. Other file types in the same directories would just be ignored. I'm thinking about the situation where the user is processing saved data, and has the option of including or excluding various files in various directories. He wants to know things like, when were the files in this directory modified, and how much is there in this directory, and how does that compare to the size of the other data already selected.

What the heck, let me share the other side of this project too - bear in mind that this is a work in progress, and hasn't progressed very far. But I appreciate any ideas, and if you like anything you see, please make feature requests! I might say, "duh, why didn't I think of that" - and with any luck (skill? :unsure: ) the ultimate version I post might be worthy of the code repository. With that in mind, here's a zip file for the directory stuff.

Download File:post-4616-1160744988.zip

Link to comment
the ultimate version I post might be worthy of the code repository.
As long as the code is clean, conforms to the documentation guidlines indicated, and performs something usefull, there's no reason why it can't be submitted right now. It does not have to be the "ultimate". After submission, we can suggest features or improvements and harass you with bug reports :) .

By the way, in my opinion, a pie chart is very limited for visualization. I think, some support for "squareifying" the view is essential.

Also, try to start your coding project with a state machine. It will become unmanageable pretty quickly without one.

Link to comment

Paul,

If the pie app cached the results from a run, the cache could be used to speed up rechecks.

I also wanted to add a delete function so that I did not have to leave the app to delete files.

A re-write using a state machine (as suggested by Michael is a good idea).

I love to see this example introduced to to the CR. From "bad/Ugly" to CR, quite a shift.

Have fun,

Ben

Link to comment

Would the state machine be the top level structure, and the event case to handle user activity be the contents of one of the states? And then the other states execute the various tasks assigned by the user?

Squarification would use front panel space efficiently, but I don't think I can manage to make it as neat & tidy as some of the programs you guys have pointed out. I'm more likely to just start with a 3 x 2 rectangle, and fill in the long side with rectangles until it becomes the short side, then fill in the new long side, ... etc until the "Other" category is reached.

Finally, Ben's program makes the pie chart itself the "interactive element", whereas I was thinking of using a tree control, and just having the chart for display. I guess the ideal is for both chart and tree control to be user-clickable items that allow navigation, and to update the one whenever the other is clicked, but ... maybe later ...

Link to comment
  • 2 weeks later...
Finally, Ben's program makes the pie chart itself the "interactive element", whereas I was thinking of using a tree control, and just having the chart for display.

Here's the latest, it seems fairly workable now. It's not very clean code in some spots, so a little more work before trying a code repository version. I have yet to implement Ben's excellent idea of an "Other" category to encompass small-sized directories in one pie slice. Still working with pie chart, haven't figured out squarification yet.

Download File:post-4616-1161781231.zip

Link to comment
  • 2 weeks later...

See post #20 in the share your favorite user lib VIs thread for my latest zip file of this project. There are just too many messy subVIs, and parts held together with duct tape and rubber bands, for me to clean this up to Code Repository standards. But it works, and I've killed a lot of bugs (can't guarantee there aren't more!)

Comments, complaints, bug fix requests welcome.

Link to comment
  • 2 months later...
  • 2 weeks later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.