Ejemplo n.º 1
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);
                }
            }
        }
 private void tChart1_ClickSeries(object sender, Steema.TeeChart.Styles.Series s, int valueIndex, System.Windows.Forms.MouseEventArgs e)
 {
     if (valueIndex >= 0)
     {
         numericUpDown1.Value = valueIndex;
     }
 }
Ejemplo n.º 3
0
        void Form1_GetSeriesMark(Steema.TeeChart.Styles.Series series, Steema.TeeChart.Styles.GetSeriesMarkEventArgs e)
        {
            var t   = DateTime.FromOADate(Convert.ToDouble(series.XValues[e.ValueIndex].ToString()));
            var val = Convert.ToDouble(series.YValues[e.ValueIndex].ToString()).ToString("#,###,###.##");

            e.MarkText = "Series: " + series.Title + "\r\nDate-Time: " + t.ToString("MM/dd/yyyy HH:mm") + "\r\nValue: " + val;
        }
Ejemplo n.º 4
0
        private void tChart1_ClickSeries(object sender, Steema.TeeChart.Styles.Series s, int valueIndex, MouseEventArgs e)
        {
            int idx = this.tChart1.Series.IndexOf(s);

            // MessageBox.Show(s.Title);
            Reclamation.Core.Logger.WriteLine(s.Title);
        }
Ejemplo n.º 5
0
 private void tChart3_ClickSeries(object sender, Steema.TeeChart.Styles.Series s, int valueIndex, MouseEventArgs e)
 {
     if (valueIndex != -1)
     {
         setBottomChartIndex(valueIndex);
     }
 }
Ejemplo n.º 6
0
 private void tChart1_ClickSeries(object sender, Steema.TeeChart.Styles.Series s, int valueIndex, System.Windows.Forms.MouseEventArgs e)
 {
     if (!checkBox1.Checked)
     {
         SetCallout(valueIndex);
     }
 }
        private void gantt1_GetSeriesMark(Steema.TeeChart.Styles.Series series, Steema.TeeChart.Styles.GetSeriesMarkEventArgs e)
        {
            // Add custom data to display at each gantt bar, for example: "Completion %"
            switch (e.ValueIndex)
            {
            case 0:
                e.MarkText = "20 %";
                break;

            case 1:
                e.MarkText = "40 %";
                break;

            case 2:
                e.MarkText = "10 %";
                break;

            case 3:
                e.MarkText = "75 %";
                break;

            case 4:
                e.MarkText = "55 %";
                break;

            case 5:
                e.MarkText = "60 %";
                break;

            case 6:
                e.MarkText = "25 %";
                break;
            }
        }
Ejemplo n.º 8
0
        private void tChart1_ClickSeries(object sender, Steema.TeeChart.Styles.Series s, int valueIndex, MouseEventArgs e)
        {
            int idx = this.tChart1.Series.IndexOf(s);

            modifySeriesAppearance(idx, e);
            Reclamation.Core.Logger.WriteLine(s.Title);
        }
Ejemplo n.º 9
0
        private void CalcLimits(Steema.TeeChart.Styles.Series Good, Steema.TeeChart.Styles.Series Bad)
        {
            double sum, sumn, tmp, aux,
                   lcp, lcn, numtotal, percent;
            int n;

            this.colorLine1.Value = 0.0;
            this.colorLine2.Value = 0.0;
            n    = 0;
            sum  = 0.0;
            sumn = 0.0;
            for (int i = 0; i < Good.Count; i++)
            {
                percent  = (Bad.YValues[i] * Good.YValues[i] / 100.0);
                numtotal = Good.YValues[i] + percent;
                if (numtotal > 0)
                {
                    sum  += percent / numtotal;
                    sumn += numtotal;
                    n++;
                }
            }
            lcp = sum / n;
            lcn = sumn / n;
            tmp = (lcp * (1.0 - lcp)) / lcn;
            if (tmp > 0)
            {
                aux = 3 * Math.Sqrt(tmp);               // <-- 3 by square root
                this.colorLine1.Value = 100.0 * (lcp + aux);
                this.colorLine2.Value = 100.0 * (lcp - aux);
            }
        }
Ejemplo n.º 10
0
        private void surfaceSeries1_GetYValue(Steema.TeeChart.Styles.Series sender, Steema.TeeChart.Styles.Custom3DGrid.GetYValueEventArgs e)
        {
            double       piPortion = Math.PI / this.surfaceSeries1.NumXValues;
            const double halfPI    = Math.PI * 0.5;
            double       tmpX      = e.X * piPortion;
            double       tmpZ      = e.Z * piPortion;

            // sample surfaces...
            switch ((int)this.numericUpDown1.Value)
            {
            case 1: e.Value = 0.5 * Math.Pow(Math.Cos(e.X / (this.surfaceSeries1.NumXValues * 0.2)), 2) +
                              Math.Pow(Math.Cos(e.Z / (this.surfaceSeries1.NumXValues * 0.2)), 2) -
                              Math.Cos(e.Z / (this.surfaceSeries1.NumXValues * 0.5)); break;

            case 2: e.Value = Math.Pow(Math.Cos(tmpX), 2) * Math.Pow(Math.Sin(tmpZ), 2); break;

            case 3: e.Value = Math.Cos(tmpX * tmpX) + Math.Sin(tmpZ * tmpZ); break;

            case 4: e.Value = Math.Pow(Math.Cos(tmpX), 2) + Math.Pow(Math.Sin(tmpZ), 2); break;

            case 5: e.Value = -tmpX + Math.Pow(tmpZ, 2) * Math.Sin(tmpX * tmpZ); break;

            case 6: e.Value = Math.Sqrt(tmpX * tmpX + tmpZ * tmpZ); break;

            case 7: e.Value = Math.Cos(Math.Abs(tmpX - halfPI)) * Math.Sin(tmpZ); break;

            case 8: e.Value = Math.Cos(Math.Abs(tmpX - halfPI) * Math.Abs(tmpZ - halfPI)); break;
            }
        }
Ejemplo n.º 11
0
 private void Chart_ClickSeries(object sender, Steema.TeeChart.Styles.Series s, int valueIndex, Steema.TeeChart.Drawing.MouseEventArgs e)
 {
     ann.Active = true;
     ann.Text   = pie.PieValues.Value[valueIndex].ToString();
     ann.Left   = e.X - ann.Width / 2;
     ann.Top    = e.Y - 20;
 }
Ejemplo n.º 12
0
        private void ReportForm_Load(object sender, EventArgs e)
        {
            nfi = new System.Globalization.CultureInfo(System.Globalization.CultureInfo.CurrentCulture.ToString(), false).NumberFormat;
            nfi.CurrencyDecimalDigits = 0;

            // TODO: This line of code loads data into the 'techProductsLtdDataSet1.Lookup_Continent' table. You can move, or remove it, as needed.
            this.lookup_ContinentTableAdapter.Fill(this.techProductsLtdDataSet1.Lookup_Continent);
            // TODO: This line of code loads data into the 'techProductsLtdDataSet1.Fact_Orders' table. You can move, or remove it, as needed.
            this.fact_OrdersTableAdapter.Fill(this.techProductsLtdDataSet1.Fact_Orders);                         //TeeGrid

            this.___SalesByYearContinentTableAdapter.Fill(this.techProductsLtdDataSet1.___SalesByYearContinent); //TChart2
            this.___SalesByContinentTableAdapter.Fill(this.techProductsLtdDataSet1.___SalesByContinent);         //Tchart2
            this.___SalesByCountry_2015TableAdapter.Fill(this.techProductsLtdDataSet1.___SalesByCountry_2015);


            tChart1[0].CheckDataSource();              //country
            tChart3[0].CheckDataSource();              //region

            ReportInit();

            setHighestValueHistory();
            tChart1.Axes.Bottom.SetMinMax(2005, 2010);
            IndexBarClicked  = -1;
            BarSeriesClicked = null;
            tChart1.Draw();
            setComments(commentType.global);
        }
Ejemplo n.º 13
0
 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));
 }
Ejemplo n.º 14
0
 void bar1_GetSeriesMark(Steema.TeeChart.Styles.Series series, Steema.TeeChart.Styles.GetSeriesMarkEventArgs e)
 {
     if (e.ValueIndex == ShowMark)
     {
         e.MarkText = e.MarkText;
     }
     else
     {
         e.MarkText = "";
     }
 }
Ejemplo n.º 15
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);
            }
        }
Ejemplo n.º 16
0
        private Series GetTimeSeriesFromTChartSeries(Steema.TeeChart.Styles.Series sIn)
        {
            var s = new Series();

            s.Name = sIn.Title.Split(' ')[0].ToString() + "_" + sIn.Title.Split(' ')[1].ToString();
            for (int j = 0; j < sIn.Count; j++)
            {
                var jthT = new DateTime(Convert.ToInt32(sIn.Title.Split(' ')[2].ToString()), DateTime.FromOADate(sIn[j].X).Month, DateTime.FromOADate(sIn[j].X).Day);
                s.Add(jthT, sIn[j].Y);
            }
            return(s);
        }
Ejemplo n.º 17
0
        private void ganttSeries1_GetSeriesMark(Steema.TeeChart.Styles.Series series, Steema.TeeChart.Styles.GetSeriesMarkEventArgs e)
        {
            // Example, customize Series marks...
            switch (e.ValueIndex)
            {
            case 0: e.MarkText = "John"; break;

            case 1: e.MarkText = "Ann"; break;

            case 2: e.MarkText = "David"; break;

            case 3: e.MarkText = "Carol"; break;
            }
        }
        private void lineSeries1_BeforeDrawValues(object sender, Steema.TeeChart.Drawing.Graphics3D g)
        {
            //  make opaque
            if (checkBox1.Checked)
            {
                Steema.TeeChart.Styles.Series s = sender as Steema.TeeChart.Styles.Series;

                int left   = s.GetHorizAxis.IStartPos;
                int right  = s.GetHorizAxis.IEndPos;
                int top    = s.GetVertAxis.IStartPos;
                int bottom = s.GetVertAxis.IEndPos;
                tChart1.Graphics3D.ClipRectangle(left, top, right, bottom);
            }
        }
        private void cbStyle_SelectedIndexChanged(object sender, EventArgs e)
        {
            Steema.TeeChart.Styles.Series s = tChart1[0];

            switch (cbStyle.SelectedIndex)
            {
            case 0:
                Steema.TeeChart.Styles.Series.ChangeType(ref s, typeof(Steema.TeeChart.Styles.HorizBar));
                break;

            case 1:
                Steema.TeeChart.Styles.Series.ChangeType(ref s, typeof(Steema.TeeChart.Styles.Bar));
                break;
            }
            UpdateMarksLocation();
        }
Ejemplo n.º 20
0
        void chart_ClickSeries(object sender, Steema.TeeChart.Styles.Series s, int valueIndex, MotionEvent e)
        {
            if (s is Steema.TeeChart.Styles.Pie)
            {
                var pie = (Steema.TeeChart.Styles.Pie)s;
                pie.ExplodedSlice[valueIndex] = (pie.ExplodedSlice[valueIndex] > 0) ? 0 : 15;
            }

            if ((chart[0] is Steema.TeeChart.Styles.Line) || (chart[0] is Steema.TeeChart.Styles.Points))
            {
                string text = (valueIndex != -1) ? "point index " + valueIndex.ToString() : "no point clicked";
                ShowToast(text);
            }

            if ((s is Steema.TeeChart.Styles.CircularGauge) || (s is Steema.TeeChart.Styles.CustomGauge))
            {
                //To-Do
            }
        }
Ejemplo n.º 21
0
        // Returns Series point index that is nearest to xy position.
        private int NearestPoint(Steema.TeeChart.Styles.Series ASeries, int x, int y)
        {
            int diff = -1;
            int tmpDiff, t, tmpX, tmpY, res;

            res = -1;
            for (t = 0; t < ASeries.Count; t++)
            {
                tmpX    = ASeries.CalcXPos(t) - x;
                tmpY    = ASeries.CalcYPos(t) - y;
                tmpDiff = TeeChart.Utils.Round(Math.Sqrt(TeeChart.Utils.Sqr(tmpX) + TeeChart.Utils.Sqr(tmpY)));
                if (diff == -1 || tmpDiff < diff)
                {
                    diff = tmpDiff;
                    res  = t;
                }
            }
            return(res);
        }
Ejemplo n.º 22
0
        public static void MovePoints(Steema.TeeChart.Styles.Series series, UIModels.PointD p1, UIModels.PointD p2)
        {
            int startIndex = Convert.ToInt32(p1.X * 10);
            int endIndex   = Convert.ToInt32(p2.X * 10);

            if (startIndex < 0 && endIndex < 0 && endIndex >= series.YValues.Count)
            {
                return;
            }
            p1.Y = Math.Round(p1.Y, 0);
            p2.Y = Math.Round(p2.Y, 0);
            int    pCount = endIndex - startIndex;
            double stepY  = (p2.Y - p1.Y) / pCount;

            for (int index = startIndex, i = 0; index < endIndex; index++, i++)
            {
                series.YValues[index] = Math.Round(p1.Y + stepY * i);
            }
            series.YValues[endIndex] = p2.Y;
        }
Ejemplo n.º 23
0
        private async void Chart_ClickSeries(object sender, Steema.TeeChart.Styles.Series s, int valueIndex, NSSet e)
        {
            Chart.Header.Text = "Series clicked! ";

            annotation.Active = false;

            annotation.Shape.AutoSize       = true;
            annotation.Shape.Shadow.Visible = false;

            annotation.Text              = "P:" + valueIndex.ToString() + " - V: " + s.ValueMarkText(valueIndex); // Point . Value
            annotation.Callout.Visible   = true;
            annotation.Callout.Style     = Steema.TeeChart.Styles.PointerStyles.Sphere;
            annotation.Shape.ShapeStyle  = Steema.TeeChart.Drawing.TextShapeStyle.RoundRectangle;
            annotation.Callout.Color     = Color.FromArgb(255, 17, 164, 216);
            annotation.Callout.Pen.Color = Color.White;
            annotation.Callout.Pen.Width = 2;
            annotation.Callout.VertSize  = 4;
            annotation.Callout.HorizSize = 4;
            annotation.Shape.Font.Color  = Color.FromArgb(255, 31, 154, 224);
            annotation.ClipText          = true;

            var touch     = Utils.GetMouseButton(e);
            var locInView = touch.LocationInView(touch.View);

            Point tmpP = new Point(Utils.Round(locInView.X), Utils.Round(locInView.Y));

            annotation.Left = tmpP.X - (annotation.Width / 2);
            annotation.Top  = tmpP.Y - 35;
            annotation.Callout.XPosition = tmpP.X;
            annotation.Callout.YPosition = tmpP.Y;
            annotation.Callout.ZPosition = 0;
            annotation.TextAlign         = CTTextAlignment.Center;

            annotation.Active = true;

            // In the case we wanto to simulate a ToolTip which appears for one second , we can do :
            await Task.Delay(1000);

            annotation.Active = false;
        }
Ejemplo n.º 24
0
        void Form1_GetSeriesMark(Steema.TeeChart.Styles.Series series, Steema.TeeChart.Styles.GetSeriesMarkEventArgs e)
        {
            var t   = DateTime.FromOADate(Convert.ToDouble(series.XValues[e.ValueIndex].ToString()));
            var val = Convert.ToDouble(series.YValues[e.ValueIndex].ToString()).ToString("#,###,###.##");

            int yr = 0;

            if (int.TryParse(series.Title, out yr))
            {
                DateTime strDate = DateTime.Parse(t.ToString("MM/dd/") + series.Title);
                if (shiftAnnotationDate && t.Month >= 10)
                { // get proper date from water year
                    yr--;
                    strDate = DateTime.Parse(t.ToString("MM/dd/" + yr));
                }
                e.MarkText = "Series: " + series.Title + "\r\nDate-Time: " + strDate.ToString("MMM-d-yyyy") + "\r\nValue: " + val;
            }
            else
            {
                e.MarkText = "Series: " + series.Title + "\r\nDate-Time: " + t.ToString("MMM-d-yyyy") + "\r\nValue: " + val;
            }
        }
        public WelcomeForm()
        {
            //
            // Required for Windows Form Designer support
            //
            InitializeComponent();
            // constants to rotate...
            // fill the series
            pieSeries1.FillSampleValues(7);

            //Color set with transparency
            pieSeries1.Colors[0] = Color.FromArgb(120, 224, 77, 44);
            pieSeries1.Colors[1] = Color.FromArgb(120, 244, 158, 54);
            pieSeries1.Colors[2] = Color.FromArgb(120, 251, 197, 65);
            pieSeries1.Colors[3] = Color.FromArgb(120, 254, 236, 58);
            pieSeries1.Colors[4] = Color.FromArgb(120, 154, 183, 194);
            pieSeries1.Colors[5] = Color.FromArgb(120, 50, 99, 125);
            pieSeries1.Colors[6] = Color.FromArgb(120, 28, 63, 95);
            pieSeries1.Colors[7] = Color.FromArgb(120, 170, 155, 51);

            lineSeries1.FillSampleValues(30);
            lineSeries2.FillSampleValues(30);
            fastLineSeries1.FillSampleValues(50);
            Delta                         = 1;
            DeltaElev                     = 1;
            DeltaRot                      = 1;
            TheSeries                     = pieSeries1;
            tChart1.Aspect.Zoom           = 1;
            tChart1.Aspect.Orthogonal     = false;
            tChart1.Aspect.Elevation      = 315;
            tChart1.Aspect.Rotation       = 360;
            tChart1.Aspect.Perspective    = 0;
            tChart1.Aspect.Chart3DPercent = 40;

            r = new Random();
        }
 private void bar1_GetSeriesMark(Steema.TeeChart.Styles.Series series, Steema.TeeChart.Styles.GetSeriesMarkEventArgs e)
 {
     e.MarkText = e.MarkText + " $";
 }
Ejemplo n.º 27
0
 private void series_clicked(object sender, Steema.TeeChart.Styles.Series s, int valueIndex, UIGestureRecognizer e)
 {
     Console.WriteLine("Series clicked");
 }
 void area1_GetSeriesMark(Steema.TeeChart.Styles.Series series, Steema.TeeChart.Styles.GetSeriesMarkEventArgs e)
 {
     e.MarkText = e.ValueIndex < area1.Count - 1 ? e.MarkText + " €" : "";                             //"Dummy" point mark removed
 }
Ejemplo n.º 29
0
 private void tChart2_ClickSeries(object sender, Steema.TeeChart.Styles.Series s, int valueIndex, MouseEventArgs e)
 {
     refreshRegionChart(s.Labels[valueIndex]);
 }
Ejemplo n.º 30
0
 void simple_GetSeriesMark(Steema.TeeChart.Styles.Series series, Steema.TeeChart.Styles.GetSeriesMarkEventArgs e)
 {
     e.MarkText = series.Title;
 }