visualize free disk space

Ads
 

visualize free disk space

hi i want to visualize free disk spaces of machines as a bar chart.thanks.

View Answers

July 22, 2011 at 3:41 PM

import java.io.*;
import java.text.*;
import org.jfree.chart.*;
import org.jfree.chart.plot.*;
import org.jfree.chart.axis.*;
import org.jfree.data.category.*;
import org.jfree.chart.renderer.category.*;
import org.jfree.chart.labels.StandardCategoryItemLabelGenerator;

public class ChartDemo{

   public static void main(String arg[]){
      File f1=new File("C:\\");
      File f2=new File("D:\\");
      long d1 = f1.getFreeSpace()/1024/1024;
      long d2 = f2.getFreeSpace()/1024/1024;
      DefaultCategoryDataset dataset = new DefaultCategoryDataset();
      dataset.setValue(d1, "Free Space", "C");
      dataset.setValue(d2, "Free Space", "D");
      JFreeChart chart = ChartFactory.createBarChart("Bar Chart","Drives", "Free Space(in MB)", dataset, 
      PlotOrientation.VERTICAL, false,true, false);
      CategoryPlot p = chart.getCategoryPlot(); 
      NumberAxis rangeAxis = (NumberAxis) p.getRangeAxis();
      rangeAxis.setStandardTickUnits(NumberAxis.createIntegerTickUnits());
      BarRenderer renderer = (BarRenderer) p.getRenderer();
      DecimalFormat decimalformat1 = new DecimalFormat("##");
      renderer.setItemLabelGenerator(new StandardCategoryItemLabelGenerator("{2}", decimalformat1));
      renderer.setItemLabelsVisible(true);
      chart.getCategoryPlot().setRenderer(renderer);
      ChartFrame frame=new ChartFrame("Bar Chart",chart);
      frame.setVisible(true);
      frame.setSize(350,450);
    }
 }

Ads









Related Tutorials/Questions & Answers:
visualize free disk space
visualize free disk space  hi i want to visualize free disk spaces of machines as a bar chart.thanks.
ModuleNotFoundError: No module named 'free-disk'
ModuleNotFoundError: No module named 'free-disk'  Hi, My Python... 'free-disk' How to remove the ModuleNotFoundError: No module named 'free... have to install padas library. You can install free-disk python with following
Advertisements
df in linux not showing correct free space after file removal
df in linux not showing correct free space after file removal  Hi, I have deleted a big file in linux but df is not showing correct free space after... free space after file removal, what can be the reason and the solution to get
ModuleNotFoundError: No module named 'bgp_visualize'
ModuleNotFoundError: No module named 'bgp_visualize'  Hi, My... 'bgp_visualize' How to remove the ModuleNotFoundError: No module named 'bgp_visualize' error? Thanks   Hi, In your python
ModuleNotFoundError: No module named 'bgp_visualize'
ModuleNotFoundError: No module named 'bgp_visualize'  Hi, My... 'bgp_visualize' How to remove the ModuleNotFoundError: No module named 'bgp_visualize' error? Thanks   Hi, In your python
ModuleNotFoundError: No module named 'metadsl_visualize'
ModuleNotFoundError: No module named 'metadsl_visualize'  Hi, My... named 'metadsl_visualize' How to remove the ModuleNotFoundError: No module named 'metadsl_visualize' error? Thanks   Hi, In your
ModuleNotFoundError: No module named 'nix_visualize'
ModuleNotFoundError: No module named 'nix_visualize'  Hi, My... 'nix_visualize' How to remove the ModuleNotFoundError: No module named 'nix_visualize' error? Thanks   Hi, In your python
ModuleNotFoundError: No module named 'visualize_logs'
ModuleNotFoundError: No module named 'visualize_logs'  Hi, My... named 'visualize_logs' How to remove the ModuleNotFoundError: No module named 'visualize_logs' error? Thanks   Hi, In your python
ModuleNotFoundError: No module named 'visualize_ML'
ModuleNotFoundError: No module named 'visualize_ML'  Hi, My Python... 'visualize_ML' How to remove the ModuleNotFoundError: No module named 'visualize_ML' error? Thanks   Hi, In your python
ModuleNotFoundError: No module named 'disk'
ModuleNotFoundError: No module named 'disk'  Hi, My Python program is throwing following error: ModuleNotFoundError: No module named 'disk' How to remove the ModuleNotFoundError: No module named 'disk' error
Examples of optical disk
Examples of optical disk  What is the example of Optical disk? Please give me at least one example of it.   Digital versatile disks is a example of optical disk
ModuleNotFoundError: No module named 'cache-to-disk'
ModuleNotFoundError: No module named 'cache-to-disk'  Hi, My... 'cache-to-disk' How to remove the ModuleNotFoundError: No module named 'cache-to-disk' error? Thanks   Hi, In your python
ModuleNotFoundError: No module named 'disk-bench'
ModuleNotFoundError: No module named 'disk-bench'  Hi, My Python... 'disk-bench' How to remove the ModuleNotFoundError: No module named 'disk... have to install padas library. You can install disk-bench python
ModuleNotFoundError: No module named 'disk-alarm'
ModuleNotFoundError: No module named 'disk-alarm'  Hi, My Python... 'disk-alarm' How to remove the ModuleNotFoundError: No module named 'disk... have to install padas library. You can install disk-alarm python
ModuleNotFoundError: No module named 'disk-usage'
ModuleNotFoundError: No module named 'disk-usage'  Hi, My Python... 'disk-usage' How to remove the ModuleNotFoundError: No module named 'disk... have to install padas library. You can install disk-usage python
ModuleNotFoundError: No module named 's3-to-disk'
ModuleNotFoundError: No module named 's3-to-disk'  Hi, My Python... 's3-to-disk' How to remove the ModuleNotFoundError: No module named 's3-to-disk' error? Thanks   Hi, In your python environment you
ModuleNotFoundError: No module named 'disk_dict'
ModuleNotFoundError: No module named 'disk_dict'  Hi, My Python... 'disk_dict' How to remove the ModuleNotFoundError: No module named 'disk... have to install padas library. You can install disk_dict python with following
ModuleNotFoundError: No module named 'disk-bench'
ModuleNotFoundError: No module named 'disk-bench'  Hi, My Python... 'disk-bench' How to remove the ModuleNotFoundError: No module named 'disk... have to install padas library. You can install disk-bench python
ModuleNotFoundError: No module named 'disk_dict'
ModuleNotFoundError: No module named 'disk_dict'  Hi, My Python... 'disk_dict' How to remove the ModuleNotFoundError: No module named 'disk... have to install padas library. You can install disk_dict python with following
ModuleNotFoundError: No module named 'sheet-disk'
ModuleNotFoundError: No module named 'sheet-disk'  Hi, My Python... 'sheet-disk' How to remove the ModuleNotFoundError: No module named 'sheet-disk' error? Thanks   Hi, In your python environment you
Remove Extra Space At End
Remove Extra Space At End  Remove Extra Space At End
Expalin the Web Hosting Bandwidth/Space/Transfer
basis. It is usually 50GB, 100Gb more more. Space: The hard disk space allowed...Expalin the Web Hosting Bandwidth/Space/Transfer  Trying to find the basics of the web hosting. I want to know about the Bandwidth, space
time and space complexity
time and space complexity  sort the data structures according to efficient time and space utilisation
ModuleNotFoundError: No module named 'space'
ModuleNotFoundError: No module named 'space'  Hi, My Python program is throwing following error: ModuleNotFoundError: No module named 'space' How to remove the ModuleNotFoundError: No module named 'space'
Program to Ignore Space and Enter ?!
Program to Ignore Space and Enter ?!  Hi, dear friend i wont to write program to enter many statements, if i use Space and Enter in the Run Time must be delete the space and ignore the Enter ..for example if i entered
java.lang.OutOfMemoryError: Java heap space
" java.lang.OutOfMemoryError: Java heap space How to resolve this issue? Thanks   Hi... your program. Check the thread Java heap space and java.lang.OutOfMemoryError: Java heap space. Thanks
ModuleNotFoundError: No module named 'invisibleroads-macros-disk'
ModuleNotFoundError: No module named 'invisibleroads-macros-disk'  Hi...: No module named 'invisibleroads-macros-disk' How to remove the ModuleNotFoundError: No module named 'invisibleroads-macros-disk' error? Thanks
ModuleNotFoundError: No module named 'py-disk-imager'
ModuleNotFoundError: No module named 'py-disk-imager'  Hi, My... named 'py-disk-imager' How to remove the ModuleNotFoundError: No module named 'py-disk-imager' error? Thanks   Hi, In your python
ModuleNotFoundError: No module named 'python-disk-collections'
ModuleNotFoundError: No module named 'python-disk-collections'  Hi...: No module named 'python-disk-collections' How to remove the ModuleNotFoundError: No module named 'python-disk-collections' error? Thanks   
ModuleNotFoundError: No module named 'wishbone_input_disk'
ModuleNotFoundError: No module named 'wishbone_input_disk'  Hi, My... named 'wishbone_input_disk' How to remove the ModuleNotFoundError: No module named 'wishbone_input_disk' error? Thanks   Hi
ModuleNotFoundError: No module named 'wishbone_output_disk'
ModuleNotFoundError: No module named 'wishbone_output_disk'  Hi...: No module named 'wishbone_output_disk' How to remove the ModuleNotFoundError: No module named 'wishbone_output_disk' error? Thanks   Hi

Ads