Exemplo n.º 1
0
		private void chart_AfterDraw(object sender, Steema.TeeChart.Drawing.Graphics3D g) 
		{
/*							_controller.chart.Canvas.TextOut(100,100,"hello");
			_controller.chart.Graphics3D.Pen.Color = UIColor.Yellow.CGColor;
			_controller.chart.Graphics3D.Pen.Width=3;
			_controller.chart.Canvas.Line(0,0,100,100);
	*/	}
Exemplo n.º 2
0
        /// <summary>
        /// 
        /// </summary>
        /// <param name="chart1"></param>
        /// <param name="series"></param>
        /// <param name="units"></param>
        public static void SetupAxisLeftRight(TChart chart1, Steema.TeeChart.Styles.Line series, string units)
        {
            string leftAxisUnits = chart1.Axes.Left.Title.Text;
            List<string> leftUnitList;
            if (chart1.Axes.Left.Title.Tag == null || leftAxisUnits =="")
            {
                leftUnitList = new List<string>();
                chart1.Axes.Left.Title.Tag = leftUnitList;
            }
            else
            {
                leftUnitList = chart1.Axes.Left.Title.Tag as List<string>;
            }

            if ( leftUnitList.IndexOf(units) <0  && leftAxisUnits != "")
                { // right axis
                    series.VertAxis = Steema.TeeChart.Styles.VerticalAxis.Right;
                    if (chart1.Axes.Right.Title.Text.IndexOf(units) < 0)
                    {
                        chart1.Axes.Right.Title.Text += units + " ";
                        chart1.Axes.Right.Visible = true;
                    }
                }
                else
                { // left axis
                    if (  leftUnitList.IndexOf(units) <0 )//chart1.Axes.Left.Title.Text.IndexOf(units) < 0)
                    {
                        chart1.Axes.Left.Title.Text += units + " ";
                        leftUnitList.Add(units);
                    }
                }
        }
Exemplo n.º 3
0
		private void line1_BeforeDrawValues(object sender, Steema.TeeChart.Drawing.Graphics3D g) 
		{
			int posAxis = 0;
			if(_controller.chart.Axes.Left.Maximum > 0)
				_controller.chart.Axes.Left.Draw(g.ChartXCenter - 10,g.ChartXCenter - 20,g.ChartXCenter,true);
			posAxis = _controller.chart.Axes.Left.CalcYPosValue(10);
			_controller.chart.Axes.Bottom.Draw(posAxis + 10, posAxis + 40, posAxis, true);
		}
Exemplo n.º 4
0
        /// <summary>
        /// Find an existing axis with the same units, or create one, and assign this series to it.  
        /// Also enter units as the axis text
        /// </summary>
        /// <param name="series"></param>
        /// <param name="units"></param>
        public static void SetupMultiLeftAxis( TChart chart1, Steema.TeeChart.Styles.Line series, string units)
        {
            string leftUnits = chart1.Axes.Left.Title.Text;
            if (  leftUnits == "" ||  leftUnits == units)
            {
                series.VertAxis = Steema.TeeChart.Styles.VerticalAxis.Left;
                if (leftUnits == "")
                    chart1.Axes.Left.Title.Text = units;

                return; // default axis ok.
            }
            //string rightUnits = chart1.Axes.Right.Title.Text;
            //if (rightUnits == "" || rightUnits == units)
            //{
            //    series.VertAxis = Steema.TeeChart.Styles.VerticalAxis.Right;
            //    if (rightUnits == "")
            //        chart1.Axes.Right.Title.Text = units;

            //    return; // default axis ok.
            //}

            int customCount = 0;
            for (int i = 0; i < chart1.Axes.Custom.Count; i++)
            {
                if (chart1.Axes.Custom[i].IsCustom())
                    customCount++;
                if (chart1.Axes.Custom[i].Title.Text.IndexOf(units) >= 0)
                {
                    series.CustomVertAxis = chart1.Axes.Custom[i];
                    return;
                }
            }
            // add new custom axis.

            var axis1 = new Steema.TeeChart.Axis();
            chart1.Axes.Custom.Add(axis1);

            //axis1.OtherSide = false;
            chart1.Panel.MarginLeft += 5D;
            axis1.RelativePosition = -10 * (customCount+1);
            axis1.Grid.Visible = false;
            axis1.Title.Angle = 90;
            //axis1.Title.Caption = "custom";
            series.CustomVertAxis = axis1;
            axis1.Title.Text = units;
        }
        /// <summary>
        /// Method to draw frequency area chart from the datatable
        /// </summary>
        /// <param name="dataTable">DataTable with the source data</param>
        /// <param name="chart">Chart to insert area into</param>
        private void DrawAreaFromDataTable(DataTable dataTable, Steema.TeeChart.TChart chart)
        {
            chart.Series.RemoveAllSeries();
            Steema.TeeChart.Styles.Area areaSeries = new Steema.TeeChart.Styles.Area();
            areaSeries.ColorEach = true;
            areaSeries.Marks.Style = Steema.TeeChart.Styles.MarksStyles.LabelValue;
            if (this.ToolStripMenuToggleMarks.Checked)
            {
                areaSeries.Marks.Visible = true;
            }
            else
            {
                areaSeries.Marks.Visible = false;
            }

            foreach (DataRow dataRow in dataTable.Rows)
            {
                double temp;
                try
                {
                    temp = Convert.ToDouble(dataRow[1]);
                }
                catch
                {
                    temp = 0;
                }
                if (this.ToolStripMenuItemAbsolute.Checked)
                {
                    areaSeries.Add(temp, dataRow[0].ToString());
                }
                else
                {
                    if ((temp != 0) && (this.rowCount != 0))
                    {
                        temp = Math.Round(((temp / (double)this.rowCount) * 100), 2);
                        areaSeries.Add(temp, dataRow[0].ToString());
                    }
                    else
                    {
                        areaSeries.Add(0, dataRow[0].ToString());
                    }
                }
                chart.Series.Add(areaSeries);
            }
        }
 /// <summary>
 /// Method to draw frequency area graph from the datatable
 /// </summary>
 /// <param name="dataTable">DataTable with the source data</param>
 /// <param name="chart">Chart to insert area into</param>
 private void DrawAreaFromDataTable(ArrayList categoriesFrequency, Steema.TeeChart.TChart chart)
 {
     chart.Series.RemoveAllSeries();
     Steema.TeeChart.Styles.Area areaSeries;
     areaSeries = new Steema.TeeChart.Styles.Area();
     areaSeries.ColorEach = true;
     areaSeries.Marks.Style = Steema.TeeChart.Styles.MarksStyles.LabelValue;
     if (this.ToolStripMenuItemToggleMarks.Checked)
     {
         areaSeries.Marks.Visible = true;
     }
     else
     {
         areaSeries.Marks.Visible = false;
     }
     foreach (CategoryFrequency catFrequency in categoriesFrequency)
     {
         double temp;
         try
         {
             temp = Convert.ToDouble(catFrequency.count);
         }
         catch
         {
             temp = 0;
         }
         if (this.ToolStripMenuItemAbsolute.Checked)
         {
             areaSeries.Add(temp, catFrequency.key);
         }
         else
         {
             if ((temp != 0) && (this.rowCount != 0))
             {
                 temp = Math.Round(((temp / (double)this.rowCount) * 100), 2);
                 areaSeries.Add(temp, catFrequency.key);
             }
             else
             {
                 areaSeries.Add(0, catFrequency.key);
             }
         }
         chart.Series.Add(areaSeries);
     }
 }
		private void chart_AfterDraw(object sender, Steema.TeeChart.Drawing.Graphics3D g) 
		{
			Random rnd= new Random();
			for (int i=0;i<2;i++)
			{
				Chart1.Canvas.Font.Size	= rnd.Next(8,30);
				Chart1.Canvas.Font.Color = UIColor.FromRGB(rnd.Next(255),rnd.Next(255),rnd.Next(255)).CGColor;
				Chart1.Canvas.TextOut(rnd.Next(300),rnd.Next(300),"TextOut!!! ");
				Chart1.Graphics3D.Pen.Color = UIColor.FromRGB(rnd.Next(255),rnd.Next(255),rnd.Next(255)).CGColor;
				Chart1.Graphics3D.Pen.Width=rnd.Next(1,5);				
				Chart1.Canvas.Line(rnd.Next(300),rnd.Next(300),rnd.Next(300),rnd.Next(300));
				Chart1.Canvas.Brush.Color = UIColor.Clear.CGColor;
				Chart1.Canvas.Ellipse(new Rectangle(rnd.Next(300),rnd.Next(300),rnd.Next(50,100),rnd.Next(50,100)));
				Chart1.Canvas.Brush.Color = UIColor.FromRGB(rnd.Next(255),rnd.Next(255),rnd.Next(255)).CGColor;
				Chart1.Canvas.Ellipse(new Rectangle(rnd.Next(300),rnd.Next(300),rnd.Next(50,100),rnd.Next(50,100)));
				Chart1.Canvas.Brush.Color = UIColor.FromRGB(rnd.Next(255),rnd.Next(255),rnd.Next(255)).CGColor;
				Chart1.Canvas.Rectangle(new Rectangle(rnd.Next(300),rnd.Next(300),rnd.Next(50,100),rnd.Next(50,100)));
			}
		}
 private void series_clicked(object sender, Steema.TeeChart.Styles.Series s, int valueIndex, UIGestureRecognizer e)
 {
     Console.WriteLine("Series clicked");
 }
 public void _controller_GetAxisLabel(object sender, Steema.TeeChart.GetAxisLabelEventArgs e)
 {
     if (sender==_controller.chart.Axes.Left)
         ((Steema.TeeChart.Axis)sender).Labels.Font.Color=UIColor.Red.CGColor;
 }
Exemplo n.º 10
0
        //
        //**********************************************************************************************
        //
        public Boolean InitializeControl(System.Windows.Forms.PictureBox aPicture,
                    System.Windows.Forms.RichTextBox aLog,
                    System.Windows.Forms.ProgressBar aTimeBar,
                    System.Windows.Forms.ProgressBar aPointBar,
                    System.Windows.Forms.Button aBackgroundButton,
                    System.Windows.Forms.Button aTextButton,
                    System.Windows.Forms.Button aPrecipitationButton,
                    System.Windows.Forms.Button aIrrigationButton,
                    String aFile,
                    String aPrecipitationFile,
                    Boolean aIrrigationRequired,
                    String aIrrigationFile,
                    String aPPTFile,
                    Boolean aPPTRequired,
                    String aOutputDir,
                    Steema.TeeChart.TChart achrtPrec1)
        {
            Boolean success = false;
              if (!Directory.Exists(aOutputDir))
              {
            if (MessageBox.Show("Output dir " + aOutputDir + " does not exist. Create it?", "Error", MessageBoxButtons.YesNo) == DialogResult.Yes)
            {
              Directory.CreateDirectory(aOutputDir);
            }
              }
              if (Directory.Exists(aOutputDir))
              {
            try
            {
              Running = false;
              brTimes = aTimeBar;
              PrecipitationFile = aPrecipitationFile;
              brPoints = aPointBar;
              LogBox = aLog;
              OutputDir = aOutputDir;
              LogBox.Clear();
              LogBox.AppendText("Started at " + DateTime.Now.ToString() + "\n");
              Top = new List<TPoint>();
              Bottom = new List<TPoint>();
              Left = new List<TPoint>();
              Right = new List<TPoint>();
              IrrigationRequired = aIrrigationRequired;
              IrrigationFile = aIrrigationFile;
              PPTFile = aPPTFile;
              PPTRequired = aPPTRequired;
              chrtPrec1 = achrtPrec1;
              PlotToShow = new List<TPlotToShow>();

              if (PPTRequired)
              {
            PPT = new TPPT();
              }

              DataManager.SaveToIniFile(aFile, aPrecipitationFile, aIrrigationFile, aOutputDir, aIrrigationRequired, aPPTRequired, aPPTFile);
              DataManager.ReadExcelFile(aFile);

              if (DataManager.ExcelIsAvailable)
              {

            SetDateFormat();

            TotalBitmap = new Bitmap(800, 600);
            //        TotalBitmap.SetResolution(300, 300);
            DataManager.ReadContourSheet(Top, Right, Bottom, Left);
            MyDrawing = new TDrawing(BackgroundColor, TextColor);
            //      MyDrawing.DrawContours(Top, Right, Bottom, Left);
            MyGraph = Graphics.FromImage(TotalBitmap);

            Int32 NumberOfPlots = DataManager.ReadNumberOfPlots();

            AssignmentMethod = DataManager.ReadAssignmentMethod();

            Plot = new List<TPlot>();
            for (Int32 i = 0; i < NumberOfPlots; i++)
            {
              TPlot MyPlot = new TPlot(i);
              MyPlot.AddBoundaries(Top, Bottom, Left, Right);
              MyPlot.AssignmentMethod = AssignmentMethod;

              Plot.Add(MyPlot);
            }

            DataManager.ReadPlotDescription(Plot);
            DataManager.ReadVisualization(PlotToShow);

            DistributePlots();

            for (Int32 i = 0; i < NumberOfPlots; i++)
            {
              DataManager.ReadNodes(Plot[i].Node, i);
              DataManager.ReadElements(Plot[i].Node, Plot[i].Element, i);
              DataManager.ReadVirtualNodes(Plot[i].VirtualNode, i);
            }

            foreach (TPlotToShow MyPlot in PlotToShow)
            {
              Plot[MyPlot.PlotId].PrepareAndDrawGrid(MyPlot.ItemToVisualize);
            }

            DefineFirstAndLastNode();

            CreateTotalBitmap(false);

            SaveGraph(OutputDir, -100);

            MoistureClass = new List<TMoistureClass>();
            DerivedClass = new List<TDerivedClass>();
            DataManager.ReadDerivativeTables(Plot);
            DataManager.ReadMoistureClasses(MoistureClass, DerivedClass);

            MyMoistureLegend = new TLegend(Color.Black, Color.White);
            MyMoistureLegend.SetDrawingArea(800, 600);
            MyMoistureLegend.DrawLegend(MoistureClass);

            MyDerivedLegend = new TLegend(Color.Black, Color.White);
            MyDerivedLegend.SetDrawingArea(800, 600);
            MyDerivedLegend.DrawDerivedLegend(DerivedClass);

            String FileName = SaveGraph(OutputDir, -10);
            if (PPTRequired)
            {
              PPT.AddPictureToSlide(FileName);
            }
            FileName = SaveGraph(OutputDir, -11);
            if (PPTRequired)
            {
              PPT.AddPictureToSlide(FileName);
            }

            MoistureContent = DataManager.ReadMoistureContents();

            FindFirstAndLastDay();

            PrecipitationInterval = DataManager.ReadPInterval();

            ReadColors(aBackgroundButton, aTextButton, aPrecipitationButton, aIrrigationButton);

            DataManager.CloseExcelFile();

            Precipitation = DataManager.ReadPrecipitation(PrecipitationFile, FirstDay, LastDay);
            if (IrrigationRequired)
            {
              Irrigation = DataManager.ReadIrrigation(IrrigationFile);
            }

            DataManager.QuitExcel();

            chrtPrec2 = new Steema.TeeChart.TChart();

            // precipitation
            Steema.TeeChart.Styles.Bar NewSeries = new Steema.TeeChart.Styles.Bar();
            NewSeries.XValues.DateTime = true;
            NewSeries.Color = PrecipitationColor;
            NewSeries.Marks.Visible = false;
            NewSeries.Pen.Visible = false;
            chrtPrec2.Series.Add(NewSeries);

            // irrigation
            NewSeries = new Steema.TeeChart.Styles.Bar();
            NewSeries.XValues.DateTime = true;
            NewSeries.Color = IrrigationColor;
            NewSeries.Marks.Visible = false;
            NewSeries.Pen.Visible = false;
            chrtPrec2.Series.Add(NewSeries);

            // line
            Steema.TeeChart.Styles.Line Line = new Steema.TeeChart.Styles.Line();
            Line.Color = Color.Red;
            Line.VertAxis = Steema.TeeChart.Styles.VerticalAxis.Right;
            Line.XValues.DateTime = true;
            chrtPrec2.Axes.Right.Automatic = false;
            chrtPrec2.Axes.Right.Minimum = 0.0;
            chrtPrec2.Axes.Right.Maximum = 1.0;
            chrtPrec2.Axes.Right.Visible = false;
            chrtPrec2.Series.Add(Line);

            // clear
            chrtPrec1.Series[0].Clear();
            chrtPrec1.Series[1].Clear();
            chrtPrec1.Series[2].Clear();
            chrtPrec2.Series[0].Clear();
            chrtPrec2.Series[1].Clear();
            chrtPrec2.Series[2].Clear();

            ShowPrecipitation(1);
            ShowPrecipitation(2);

            //      MyDrawing.SaveGraph(OutputDir, -1);
              }
              LogBox.AppendText(@"Data read at " + DateTime.Now.ToString());
              success = true;
            }
            catch (Exception e)
            {
              String ErrorMessage = @"Error in input data : " + e.Message;
              MessageBox.Show(ErrorMessage);
              LogBox.AppendText(ErrorMessage);
            }
              }
              return success;
        }
        void ContingencyTableChart_GetAxisLabel(object sender, Steema.TeeChart.GetAxisLabelEventArgs e)
        {
            Steema.TeeChart.Axis axis = (Steema.TeeChart.Axis)sender;
            if (axis.Equals(ContingencyTableChart.Axes.Bottom))
            {
                // e.LabelText = "WOW" + e.ValueIndex + " " + e.LabelText;

                // e.Series[0].Label = "1Wow";

                /*
                switch (e.LabelIndex)
                {
                    case 0:
                        e.LabelValue = 5;
                        break;
                    case 1:
                        e.LabelValue = 13;
                        break;
                    case 2:
                        e.LabelValue = 19;
                        break;
                    default:
                        e.Stop = true;
                        break;
                } */
            }
        }
        /// <summary>
        /// Drawing first contingency table to chart
        /// </summary>
        /// <param name="hypothese">Hypothese to take contingency table from</param>
        /// <param name="chart">Chart to draw bars into</param>
        private void DrawBarsFromSecondTable(HypothesisStruct hypothese, Steema.TeeChart.TChart chart)
        {
            chart.Series.Clear();
            Random random = new Random();
            bool fft = false;

            this.ContingencyTableChart.Header.Text = this.resManager.GetString("SecondContingencyTable");

            //for miners with boolean antecedents and succedents - for now only 4ft
            foreach (BooleanLiteralStruct booleanLiteral in hypothese.booleanLiterals)
            {
                if ((booleanLiteral.cedentType == CedentEnum.Antecedent) || (booleanLiteral.cedentType == CedentEnum.Succedent))
                {
                    fft = true;
                    break;
                }
            }
               // int i = 0;
            int j = 0;

            int[][] transpondedTable = FerdaResultBrowserControl.Transpose(hypothese.quantifierSetting.secondContingencyTableRows);

            for (int k = transpondedTable.GetUpperBound(0); k >=0; k--)
            {
                Steema.TeeChart.Styles.Bar barSeries = new Steema.TeeChart.Styles.Bar();
                barSeries.Color = System.Drawing.Color.FromArgb(random.Next(255), random.Next(255), random.Next(255));
                barSeries.MultiBar = Steema.TeeChart.Styles.MultiBars.None;

                foreach (int number in transpondedTable[k])
                {
                    if ((fft) && (j == 0))
                    {
                        barSeries.Add(number, this.resManager.GetString("ColumnAntecedent"));
                    }
                    else
                    {
                        if ((fft) && (j == 1))
                        {
                            barSeries.Add(number, '\u00AC' + this.resManager.GetString("ColumnAntecedent"));
                        }
                        else
                        {
                            string seriesTitle = String.Empty;
                            foreach (LiteralStruct literal in hypothese.literals)
                            {
                                if (literal.cedentType == CedentEnum.Antecedent)
                                {
                                    if (literal.categoriesNames.Length > j)
                                    {
                                        seriesTitle = literal.categoriesNames[j];
                                    }
                                }
                            }
                            barSeries.Add(number, seriesTitle);
                        }
                    }
                    j++;
                }

                if (this.CheckBoxShowLabels.Checked)
                {
                    barSeries.Marks.Visible = true;
                }
                else
                {
                    barSeries.Marks.Visible = false;
                }
                barSeries.Marks.Style = Steema.TeeChart.Styles.MarksStyles.LabelValue;
                if (fft)
                {
                    if (k == 0)
                    {
                        barSeries.Title = this.resManager.GetString("ColumnSuccedent");
                    }
                    else
                    {
                        barSeries.Title = '\u00AC' + this.resManager.GetString("ColumnSuccedent");
                    }
                }
                else
                {
                    string seriesTitle = String.Empty;
                    foreach (LiteralStruct literal in hypothese.literals)
                    {
                        if (literal.cedentType == CedentEnum.Succedent)
                        {
                            if (literal.categoriesNames.Length > k)
                            {
                                seriesTitle = literal.categoriesNames[k];
                            }
                            break;
                        }
                    }
                    if (seriesTitle == String.Empty)
                    {
                        foreach (LiteralStruct literal in hypothese.literals)
                        {
                            if (literal.cedentType == CedentEnum.Antecedent)
                            {
                                if (literal.categoriesNames.Length > k)
                                {
                                    seriesTitle = literal.categoriesNames[k];
                                }
                            }
                        }
                    }

                    barSeries.Title = seriesTitle;
                }
                chart.Series.Add(barSeries);
             //   i++;
                j = 0;
            }
        }
 /// <summary>
 /// Method which toggles labels on/off for chart.
 /// </summary>
 /// <param name="chart">Chart to toggle lables for</param>
 private void ShowLabels(Steema.TeeChart.TChart chart)
 {
     foreach (Steema.TeeChart.Styles.Series serie in chart.Series)
     {
         if (this.CheckBoxShowLabels.Checked)
         {
             serie.Marks.Visible = true;
         }
         else
         {
             serie.Marks.Visible = false;
         }
     }
 }
Exemplo n.º 14
0
 private void fittedChart_AfterDraw(object sender, Steema.TeeChart.Drawing.Graphics3D g)
 {
     int xpos;
     xpos = fittedChart.Axes.Bottom.CalcXPosValue(ExtractBegin);
     Rectangle r = fittedChart.Chart.ChartRect;
     g.ClipRectangle(r);
     g.Pen.Color = Color.Blue;
     g.Pen.Width = 2;
     g.Pen.Style = System.Drawing.Drawing2D.DashStyle.DashDot;
     g.VerticalLine(xpos, r.Top, r.Bottom);
     xpos = fittedChart.Axes.Bottom.CalcXPosValue(TestBegin);
     g.VerticalLine(xpos, r.Top, r.Bottom);
     g.UnClip();
 }
Exemplo n.º 15
0
 /// <summary>
 /// �����ߣ���������ʱ��
 /// </summary>
 /// <param name="line33"></param>
 /// <param name="cmpdata"></param>
 /// <param name="datasource"></param>
 /// <param name="tcolor"></param>
 /// <param name="tname"></param>
 private void paintline(Steema.TeeChart.Styles.Line line33, string cmpdata, string datasource,Color tcolor,string tname)
 {
     if ("��������" == tname && cmpdata == "O_dis")
     {
         cmpdata = "O_disv";
     }
     string sqlstr = "select " + cmpdata + ",time  from "+ datasource +"";
     SqlConnection sql = new SqlConnection(Global.sqlconstr);
     sql.Open();
     DataTable dt = new DataTable();
     SqlDataAdapter da = new SqlDataAdapter(sqlstr, sql);
     da.Fill(dt);
     sql.Close();
     line33.Title = tname;
     line33.Color = tcolor;
     line33.DataSource = dt;
     line33.XValues.DateTime = true;
     line33.XValues.DataMember = "time";
     line33.YValues.DataMember = cmpdata;
     tChart1.Series.Add(line33);
 }
Exemplo n.º 16
0
 private bool Needs3D(Steema.TeeChart.Styles.Series series)
 {
     return (((series is Steema.TeeChart.Styles.Custom3D) && !(/*(series is Steema.TeeChart.Styles.ColorGrid)
                                                     || */(series is Steema.TeeChart.Styles.Contour)
                                                     || (series is Steema.TeeChart.Styles.Map)
                                                     || (series is Steema.TeeChart.Styles.Ternary)))
                                                     || (series is Steema.TeeChart.Styles.Pie));
 }
Exemplo n.º 17
0
        /// <summary>
        /// �����ߣ���������ʱ��
        /// </summary>
        /// <param name="line33"></param>
        /// <param name="cmpdata"></param>
        /// <param name="datasource"></param>
        /// <param name="tcolor"></param>
        /// <param name="tname"></param>
        private void paintline(Steema.TeeChart.Styles.Line line33, string cmpdata, string datasource, Color tcolor, string tname)
        {
            string sqlstr = "select " + cmpdata + ",time  from " + datasource + "";
            SqlConnection sql = new SqlConnection(Global.sqlconstr);
            sql.Open();
            DataTable dt = new DataTable();
            SqlDataAdapter da = new SqlDataAdapter(sqlstr, sql);
            da.Fill(dt);

            if (0 == dt.Rows.Count)
            {
                MessageBox.Show("û������");
            }
            else
            {
                line33.Title = tname;
                line33.Color = tcolor;
                line33.DataSource = dt;
                line33.XValues.DateTime = true;
                line33.XValues.DataMember = "time";
                line33.YValues.DataMember = cmpdata;
                tChart1.Series.Add(line33);
            }
            sql.Close();
        }
Exemplo n.º 18
0
        private void FillCorrelation(Series s1, Series s2, Steema.TeeChart.Styles.Line series1)
        {
            series1.XValues.DateTime = false;
            int sz = s1.Count;

            for (int i = 0; i < s1.Count; i++)
            {
                Point pt = s1[i];

                if (!pt.IsMissing)
                {
                    int idx = s2.IndexOf(pt.DateTime);
                    if (idx >= 0)
                    {
                        Point pt2 = s2[idx];
                        if (!pt2.IsMissing)
                        {
                            series1.Add(pt.Value, pt2.Value);
                        }
                    }
                }
            }
        }
Exemplo n.º 19
0
 private static void FillSortedSeries(Series s, Steema.TeeChart.Styles.Series tSeries)
 {
     tSeries.XValues.DateTime = false;
     int sz = s.Count;
     for (int i = 0; i < sz; i++)
     {
         Point pt = s[i];
         double x = pt.Percent;
         tSeries.Add(x, pt.Value);
     }
 }
Exemplo n.º 20
0
        /// <summary>
        /// copy data from TimeSeries.Series into Steema.TeeChart.Styles.Series
        /// </summary>
        /// <param name="s"></param>
        /// <param name="tSeries"></param>
        public void FillTimeSeries(Series s,Steema.TeeChart.Styles.Series tSeries)
        {
            if (s.Count == 0)
            {
                return;
            }

            tSeries.XValues.DateTime = true;
            double avg = TimeSeries.Math.AverageOfSeries(s);
            int sz = s.Count;
            for (int i = 0; i < sz; i++)
            {
                Point pt = s[i];
                double x = pt.DateTime.ToOADate();
                if (!pt.IsMissing)
                {
                    tSeries.Add(x, pt.Value);
                }
                else
                {
                    tSeries.Add(x, avg, System.Drawing.Color.Transparent);
                }
            }
        }