Esempio n. 1
0
        private static IEnumerable <PreviewChart> PreCharts(DocumentInfo doc, string zipOutPath, string folderName)
        {
            var charts = new List <PreviewChart>();

            foreach (var sheet in doc.Workbook.Worksheets)
            {
                foreach (var chart in sheet.Charts)
                {
                    var imgFileName = $"{sheet.Name} {chart.Name}.png";
                    var imgPath     = $"{zipOutPath}/{imgFileName}";
                    chart.ToImage(imgPath);

                    var previewChart = new PreviewChart
                    {
                        WorkbookHash  = doc.GetHashCode(),
                        SheetIndex    = sheet.Index,
                        ChartHash     = chart.GetHashCode(),
                        ChartName     = Path.GetFileNameWithoutExtension(imgPath),
                        ImgFolderName = folderName,
                        ImgFileName   = imgFileName
                    };
                    charts.Add(previewChart);
                }
            }

            return(charts);
        }
Esempio n. 2
0
 private void ChartDialog_Loaded(object sender, RoutedEventArgs e)
 {
     if (Document.Editor.My.Computer.Info.OSVersion >= "6.0")
     {
         if (Document.Editor.My.Settings.Options_EnableGlass)
         {
             AppHelper.ExtendGlassFrame(this, new Thickness(-1, -1, -1, -1));
         }
     }
     Items.Add(new KeyValuePair <string, int>("Item1", 1));
     Items.Add(new KeyValuePair <string, int>("Item2", 2));
     Items.Add(new KeyValuePair <string, int>("Item3", 3));
     LoadColumnData(PreviewChart.Series(0));
     LoadPieData(PreviewChart.Series(1));
     PreviewChart.Series.Remove(PieSeries);
     ItemsListBox.ItemsSource = Items;
 }