custom column script for colored bar based on folder size

Discuss and share scripts and script files...
Post Reply
cynflux
Posts: 4
Joined: 21 Dec 2017 05:19

custom column script for colored bar based on folder size

Post by cynflux »

Hello,
Is there an update script for the custom column script that creates a colored bar based on folder size?
I am trying an existing script, but the only thing that shows up is >draw.bar 0, DD444, FFAAAA.
Thank you in advance.

Code: Select all

// draws colored bars according to the file size
$size = "<cc_size>";
switch (true){
 case $size == 0:          return ''; // draw nothing
 case $size < 1024:        return '>draw.bar ' . 100 * $size \ 1024 . ', 66CC66, BBEEBB';        //smaller 1 KB
 case $size < 1048576:     return '>draw.bar ' . 100 * $size \ 1048576 . ', FFBB00, FFEE88';     //smaller 1 MB
 case $size < 1073741824:  return '>draw.bar ' . 100 * $size \ 1073741824 . ', DD4444, FFAAAA';  //smaller 1 GB
 default:                  return '>draw.bar ' . 100 * $size \ 1099511627776 . ', DD44AA, FFAADD';  //1 GB or more
}

highend
Posts: 14923
Joined: 06 Feb 2011 00:33
Location: Win Server 2022 @100%

Re: custom column script for colored bar based on folder size

Post by highend »

So you did not set the "Format:" drop-down to "Icon" in the custom column definition window...
One of my scripts helped you out? Please donate via Paypal

cynflux
Posts: 4
Joined: 21 Dec 2017 05:19

Re: custom column script for colored bar based on folder size

Post by cynflux »

Thanks for the reply.
I did not set the Format.
Once I did, the colored bar showed up.
It is close to what I was wanting.
However, I was looking for the functionality similar to what Folder Size has.
FolderSzie-Pie.png
I was also curious to know if there is a way to change the cube icon to a bar in the Space column.

Thanks in advance.
You do not have the required permissions to view the files attached to this post.

Post Reply