zoukankan      html  css  js  c++  java
  • excel 知识备忘

       public void UpdateShapesColor(string value)
            {
                foreach (Microsoft.Office.Interop.Excel.Shape chart in GeneratedShapesArray)
                {
                    // StyleHelper.SetChartTableColor(chart.Chart, value);    
                    chart.BackgroundStyle = MsoBackgroundStyleIndex.msoBackgroundStylePreset11;
                    Microsoft.Office.Interop.Excel.SeriesCollection sc = chart.Chart.SeriesCollection();
                    int count= sc.Count;
                    for (int i = 1; i <=count; i++)
                    {
                       Series series = chart.Chart.SeriesCollection(i);
                        //siries.Format.Line.ForeColor = 
                        series.Border.Color = (int)XlRgbColor.rgbDarkSeaGreen;
                    }
    
                }
            }

    另一种填充图表线颜色的方法

    private static void SetSeriesColor(Microsoft.Office.Interop.Excel.Point serie, int RGB)
            {
                Microsoft.Office.Interop.Excel.FillFormat ff = serie.Format.Fill;
                ff.Visible = MsoTriState.msoCTrue;
                ff.ForeColor.RGB = RGB;
                ff.Transparency = 0;
                ff.Solid();
            }
    

      

     private static int GetColorIntRGB(string rgb)
            {
                if (rgb == "" || rgb == null)
                    rgb = "255,255,255";
    
                var colorRgb = rgb.Split(',');
                System.Drawing.Color c2 = System.Drawing.Color.FromArgb(int.Parse(colorRgb[0]), int.Parse(colorRgb[1]), int.Parse(colorRgb[2]));
                return System.Drawing.ColorTranslator.ToOle(c2);
    
            }
  • 相关阅读:
    [POJ 1269]Intersecting Lines
    [POJ 3304]Segments
    [HNOI 2011]数学作业
    [UOJ 12]猜数
    [UOJ 282]长度测量鸡
    [HAOI 2007]理想的正方形
    [POJ 2318]TOYS
    [SDOI 2009]HH的项链
    [USACO 12DEC]Running Away From the Barn
    [HDU 2036]改革春风吹满地
  • 原文地址:https://www.cnblogs.com/gisbeginner/p/12053144.html
Copyright © 2011-2022 走看看