Exemple #1
0
 private void ShowSize(DirectoryData root)
 {
     FileCategories fc = (FileCategories)tscbCategories.SelectedItem;
     Dictionary<string, long> size = root.TotalSize(fc);
     dotnetCHARTING.WinForms.SeriesCollection sc = new dotnetCHARTING.WinForms.SeriesCollection();
     foreach (KeyValuePair<string, long> ext in size) {
         dotnetCHARTING.WinForms.Series s = new dotnetCHARTING.WinForms.Series(ext.Key);
         dotnetCHARTING.WinForms.Element el = new dotnetCHARTING.WinForms.Element();
         el.YValue = ext.Value;
         s.Elements.Add(el);
         sc.Add(s);
     }
     sc.Sort(dotnetCHARTING.WinForms.ElementValue.YValue, "Desc");
     chart1.SeriesCollection.Clear();
     chart1.SeriesCollection.Add(sc);
 }
Exemple #2
0
        private void ShowCount(DirectoryData root)
        {
            FileCategories fc = (FileCategories)tscbCategories.SelectedItem;
            Dictionary<string, int> count = root.TotalCount(fc);

            dotnetCHARTING.WinForms.SeriesCollection sc = new dotnetCHARTING.WinForms.SeriesCollection();
            foreach (KeyValuePair<string, int> ext in count) {
                dotnetCHARTING.WinForms.Series s = new dotnetCHARTING.WinForms.Series(ext.Key);
                dotnetCHARTING.WinForms.Element el = new dotnetCHARTING.WinForms.Element();
                el.Color = Color.White;
                Console.WriteLine("{0}: {1}", s.Name, el.Color);
                el.YValue = ext.Value;
                s.Elements.Add(el);
                sc.Add(s);

                //dotnetCHARTING.WinForms.SmartPalette sp = s.GetSmartPalette(dotnetCHARTING.WinForms.Palette.One);
                //sp.SaveState("PaletteOne.xml");
            }

            sc.Sort(dotnetCHARTING.WinForms.ElementValue.YValue, "Desc");
            chart1.SeriesCollection.Clear();
            chart1.SeriesCollection.Add(sc);
            dotnetCHARTING.WinForms.SmartPalette sp = new dotnetCHARTING.WinForms.SmartPalette();
            //dotnetCHARTING.WinForms.Palette.Autumn;
            Color c = new Color();
            c = Color.FromArgb(156, 154, 255);
        }