Exemplo n.º 1
0
        internal static string FromLineStyle(eLineStyle value)
        {
            string text = value.ToString();

            switch (value)
            {
            case eLineStyle.Dash:
            case eLineStyle.Dot:
            case eLineStyle.DashDot:
            case eLineStyle.Solid:
                return(text.Substring(0, 1).ToLower(CultureInfo.InvariantCulture) + text.Substring(1, text.Length - 1));    //First to Lower case.

            case eLineStyle.LongDash:
            case eLineStyle.LongDashDot:
            case eLineStyle.LongDashDotDot:
                return("lg" + text.Substring(4, text.Length - 4));

            case eLineStyle.SystemDash:
            case eLineStyle.SystemDashDot:
            case eLineStyle.SystemDashDotDot:
            case eLineStyle.SystemDot:
                return("sys" + text.Substring(6, text.Length - 6));

            default:
                throw (new Exception("Invalid Linestyle"));
            }
        }
Exemplo n.º 2
0
        private string TranslateLineStyleText(eLineStyle value)
        {
            string text = value.ToString();

            switch (value)
            {
            case eLineStyle.Dash:
            case eLineStyle.Dot:
            case eLineStyle.DashDot:
            case eLineStyle.Solid:
                return(text.Substring(0, 1).ToLower() + text.Substring(1, text.Length - 1)); //First to Lower case.

            case eLineStyle.LongDash:
            case eLineStyle.LongDashDot:
            case eLineStyle.LongDashDotDot:
                return("lg" + text.Substring(4, text.Length - 4));

            case eLineStyle.SystemDash:
            case eLineStyle.SystemDashDot:
            case eLineStyle.SystemDashDotDot:
            case eLineStyle.SystemDot:
                return("sys" + text.Substring(6, text.Length - 6));

            default:
                throw(new Exception("Invalid Linestyle"));
            }
        }
Exemplo n.º 3
0
        public static void SetSeriesLineColor(this ExcelChart chart, int serieIdx, string color,
                                              double lineWidth = 2.25, eLineStyle lineStyle = eLineStyle.Solid)
        {
            ExcelLineChartSerie serie = (ExcelLineChartSerie)chart.Series[serieIdx];

            serie.LineColor        = ColorTranslator.FromHtml(color);
            serie.LineWidth        = lineWidth;
            serie.Border.LineStyle = lineStyle;
        }
Exemplo n.º 4
0
 private string TranslateLineStyleText(eLineStyle value)
 {
     string text=value.ToString();
     switch (value)
     {
         case eLineStyle.Dash:
         case eLineStyle.Dot:
         case eLineStyle.DashDot:
         case eLineStyle.Solid:
             return text.Substring(0,1).ToLower() + text.Substring(1,text.Length-1); //First to Lower case.
         case eLineStyle.LongDash:
         case eLineStyle.LongDashDot:
         case eLineStyle.LongDashDotDot:
             return "lg" + text.Substring(4, text.Length - 4);
         case eLineStyle.SystemDash:
         case eLineStyle.SystemDashDot:
         case eLineStyle.SystemDashDotDot:
         case eLineStyle.SystemDot:
             return "sys" + text.Substring(6, text.Length - 6);
         default:
             throw(new Exception("Invalid Linestyle"));
     }
 }
Exemplo n.º 5
0
 public LineStyleDescriptor(eLineStyle style, string desc)
 {
     LineStyle  = style;
     Descriptor = desc;
 }