Esempio n. 1
0
 public void ShowChar(string ChartType, string XValues, string YValues, int?width)
 {
     if (ChartType != null)
     {
         bool   flag;
         string str3 = ChartType;
         string str  = XValues;
         string str2 = YValues;
         string str4 = "false";
         if (str4 == null)
         {
             flag = false;
         }
         else
         {
             try
             {
                 flag = Convert.ToBoolean(str4);
             }
             catch
             {
                 flag = false;
             }
         }
         if ((str != null) && (str2 != null))
         {
             Color    white;
             string   str5;
             string[] strArray = str2.Split("|".ToCharArray());
             int      num      = 6;
             int      num2     = this.FunMaxNum(strArray);
             if (num2 < 5)
             {
                 num = num2 + 1;
             }
             if (flag)
             {
                 white = Color.White;
             }
             else
             {
                 white = Color.FromArgb(0xff, 0xfd, 0xf4);
             }
             Bitmap bitmap = null;
             if (((str5 = str3) != null) && (str5 == "bar"))
             {
                 CustomChart.BarGraph graph = new CustomChart.BarGraph(white);
                 graph.VerticalLabel     = "";
                 graph.VerticalTickCount = num;
                 graph.ShowLegend        = false;
                 graph.ShowData          = true;
                 graph.Height            = 200;
                 graph.Width             = width.HasValue ? width.Value : 600;
                 graph.CollectDataPoints(str.Split("|".ToCharArray()), str2.Split("|".ToCharArray()));
                 bitmap = graph.Draw();
             }
             bitmap.Save(this.ShowChart_MS, ImageFormat.Png);
         }
     }
 }
Esempio n. 2
0
 public void ShowChar(string ChartType, string XValues, string YValues, int?width)
 {
     if (ChartType != null)
     {
         string text = "false";
         bool   flag;
         if (text == null)
         {
             flag = false;
         }
         else
         {
             try
             {
                 flag = Convert.ToBoolean(text);
             }
             catch
             {
                 flag = false;
             }
         }
         if (XValues != null && YValues != null)
         {
             string[] num = YValues.Split("|".ToCharArray());
             int      verticalTickCount = 6;
             int      num2 = this.FunMaxNum(num);
             if (num2 < 5)
             {
                 verticalTickCount = num2 + 1;
             }
             Color bgColor;
             if (flag)
             {
                 bgColor = Color.White;
             }
             else
             {
                 bgColor = Color.FromArgb(255, 253, 244);
             }
             Bitmap bitmap = null;
             if (ChartType != null && ChartType == "bar")
             {
                 CustomChart.BarGraph barGraph = new CustomChart.BarGraph(bgColor);
                 barGraph.VerticalLabel     = "";
                 barGraph.VerticalTickCount = verticalTickCount;
                 barGraph.ShowLegend        = false;
                 barGraph.ShowData          = true;
                 barGraph.Height            = 200;
                 barGraph.Width             = (width.HasValue ? width.Value : 600);
                 barGraph.CollectDataPoints(XValues.Split("|".ToCharArray()), YValues.Split("|".ToCharArray()));
                 bitmap = barGraph.Draw();
             }
             bitmap.Save(this.ShowChart_MS, ImageFormat.Png);
         }
     }
 }
Esempio n. 3
0
 public void ShowChar(string ChartType, string XValues, string YValues, int? width)
 {
     if (ChartType != null)
     {
         bool flag;
         string str3 = ChartType;
         string str = XValues;
         string str2 = YValues;
         string str4 = "false";
         if (str4 == null)
         {
             flag = false;
         }
         else
         {
             try
             {
                 flag = Convert.ToBoolean(str4);
             }
             catch
             {
                 flag = false;
             }
         }
         if ((str != null) && (str2 != null))
         {
             Color white;
             string str5;
             string[] strArray = str2.Split("|".ToCharArray());
             int num = 6;
             int num2 = FunMaxNum(strArray);
             if (num2 < 5)
             {
                 num = num2 + 1;
             }
             if (flag)
             {
                 white = Color.White;
             }
             else
             {
                 white = Color.FromArgb(0xff, 0xfd, 0xf4);
             }
             Bitmap bitmap = null;
             if (((str5 = str3) != null) && (str5 == "bar"))
             {
                 CustomChart.BarGraph graph = new CustomChart.BarGraph(white);
                 graph.VerticalLabel = "";
                 graph.VerticalTickCount = num;
                 graph.ShowLegend = false;
                 graph.ShowData = true;
                 graph.Height = 200;
                 graph.Width = width.HasValue ? width.Value : 600;
                 graph.CollectDataPoints(str.Split("|".ToCharArray()), str2.Split("|".ToCharArray()));
                 bitmap = graph.Draw();
             }
             bitmap.Save(ShowChart_MS, ImageFormat.Png);
         }
     }
 }