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);
    
            }
  • 相关阅读:
    properties的编码问题
    在Spring中读取properties文件
    Intellij IDEA常用配置记录
    基于Shiro的登录功能 设计思路
    在SpringMVC中操作Session、Request、Response对象
    使用MockMVC与Junit进行单体测试
    django: form fileupload
    django: form
    django: db
    django: db
  • 原文地址:https://www.cnblogs.com/gisbeginner/p/12053144.html
Copyright © 2011-2022 走看看