private static DisplayResults.DisplayPage.DisplayTable.DisplayGraph.Series ReadGraphSerie(XElement xeSerie, ErrorCollector errorCollector)
        {
            DisplayResults.DisplayPage.DisplayTable.DisplayGraph.Series serie = new DisplayResults.DisplayPage.DisplayTable.DisplayGraph.Series();
            foreach (XElement xe in xeSerie.Elements())
            {
                if (xe.Value == null)
                {
                    continue;
                }
                switch (GetXEleName(xe))
                {
                case "Visible": serie.visible = errorCollector.XEleGetBool(xe, xeSerie); break;

                case "Name": serie.name = xe.Value; break;

                case "Size": serie.size = errorCollector.XEleGetInt(xe, xeSerie); break;

                case "Colour": serie.colour = xe.Value; break;

                case "Type": serie.type = xe.Value; break;

                case "MarkerStyle": serie.markerStyle = xe.Value; break;

                default: errorCollector.AddXmlUnkownEleError(xe, xeSerie); break;
                }
            }
            return(serie);
        }
Ejemplo n.º 2
0
        private static eChartType GetChartType(DisplayResults.DisplayPage.DisplayTable.DisplayGraph.Series s)
        {
            switch (s.type.ToLower())
            {
            case "stackedcolumn": return(eChartType.ColumnStacked);

            case "columnclustered": return(eChartType.ColumnClustered);

            case "barstacked": return(eChartType.BarStacked);

            case "barclustered": return(eChartType.BarClustered);

            case "point": return(eChartType.XYScatter);

            case "line": return(eChartType.Line);
            }
            return(eChartType.Line);
        }
Ejemplo n.º 3
0
 private static void SetSerieDetails(DisplayResults.DisplayPage.DisplayTable.DisplayGraph.Series s, ExcelChartSerie serie)
 {
     serie.Header = s.name;
     if (!string.IsNullOrEmpty(s.colour))
     {
         Color sc = s.colour[0] == '#' ? Color.FromArgb(int.Parse("FF" + s.colour.Substring(1), System.Globalization.NumberStyles.HexNumber)) : Color.FromName(s.colour);
         serie.Fill.Color = sc;
         if (GetChartType(s) == eChartType.Line)
         {
             serie.Border.Fill.Color = sc;
         }
         if (serie is ExcelScatterChartSerie)
         {
             ExcelScatterChartSerie se = (serie as ExcelScatterChartSerie);
             se.Marker      = GetMarkerStyle(s);
             se.MarkerSize  = s.size;
             se.MarkerColor = sc;
         }
     }
 }