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);
    
            }
  • 相关阅读:
    nginx转发域名小记
    简化kubernetes应用部署工具之Helm应用部署
    docker-compose的使用
    使用二进制包安装k8s
    搭建k8s(一)
    linux环境下安装使用selenium Chrome
    常用User-Agent大全
    缓存之Memcache
    git-commit Angular规范
    Kubernetes介绍及基本概念
  • 原文地址:https://www.cnblogs.com/gisbeginner/p/12053144.html
Copyright © 2011-2022 走看看