Ejemplo n.º 1
0
        public void reloadChart(object sender, EventArgs e)
        {
            chart.RemoveAllData ();

            Random r = new Random ();

            for (int i = 0; i < 3; i++) {

                List<TKChartDataPoint> list = new List<TKChartDataPoint> ();
                for (int j = 0; j < 8; j++) {
                    list.Add(new TKChartDataPoint(new NSNumber(j+1), new NSNumber(r.Next()%100)));
                }

                TKChartSeries series = null;

                switch (this.SelectedOption)
                {
                    case 0:
                        series = new TKChartLineSeries (list.ToArray ());
                        break;
                    case 1:
                        series = new TKChartSplineSeries (list.ToArray ());
                        break;
                    case 2:
                        series = new TKChartAreaSeries (list.ToArray());
                        break;
                    case 3:
                        series = new TKChartSplineAreaSeries (list.ToArray());
                        break;
                }
                series.SelectionMode = TKChartSeriesSelectionMode.Series;
                chart.AddSeries (series);
            }
        }
Ejemplo n.º 2
0
            public override TKChartSeries GetSeries(TKChart chart, nuint index)
            {
                TKChartSeries series = null;

                if (index == 2) {
                    series = new TKChartSplineSeries ();
                } else {
                    series = new TKChartLineSeries ();
                }

                series.SelectionMode = TKChartSeriesSelectionMode.Series;
                series.Style.PointShape = new TKPredefinedShape (TKShapeType.Circle, new System.Drawing.SizeF (10, 10));
                series.Title = string.Format ("Series: {0}", index + 1);
                return series;
            }
Ejemplo n.º 3
0
        public void reloadChart()
        {
            chart.RemoveAllData();

            List <TKChartDataPoint> array = new List <TKChartDataPoint> ();

            string[] categories = new [] { "1", "2", "3", "4", "5", "6", "7", "8", "9", "10" };
            int[]    values     = new [] { 65, 56, 65, 38, 56, 78, 62, 89, 78, 65 };

            for (int i = 0; i < categories.Length; i++)
            {
                if (i == 4 || i == 5)
                {
                    array.Add(new TKChartDataPoint(new NSString(categories [i]), null));
                }
                else
                {
                    array.Add(new TKChartDataPoint(new NSString(categories[i]), new NSNumber(values[i])));
                }
            }

            TKChartLineSeries series = null;

            switch (this.SelectedOption)
            {
            case 0:
                series = new TKChartLineSeries(array.ToArray());
                break;

            case 1:
                series = new TKChartSplineSeries(array.ToArray());
                break;

            case 2:
                series = new TKChartAreaSeries(array.ToArray());
                break;

            case 3:
                series = new TKChartSplineAreaSeries(array.ToArray());
                break;
            }

            series.Selection = TKChartSeriesSelection.Series;
            series.DisplayNilValuesAsGaps = true;
            chart.AddSeries(series);
        }
Ejemplo n.º 4
0
            public override TKChartSeries GetSeries(TKChart chart, nuint index)
            {
                TKChartSeries series = null;

                if (index == 2)
                {
                    series = new TKChartSplineSeries();
                }
                else
                {
                    series = new TKChartLineSeries();
                }

                series.SelectionMode    = TKChartSeriesSelectionMode.Series;
                series.Style.PointShape = new TKPredefinedShape(TKShapeType.Circle, new System.Drawing.SizeF(10, 10));
                series.Title            = string.Format("Series: {0}", index + 1);
                return(series);
            }
Ejemplo n.º 5
0
        public void ReloadChart()
        {
            chart.RemoveAllData();

            Random r = new Random();

            for (int i = 0; i < 3; i++)
            {
                List <TKChartDataPoint> list = new List <TKChartDataPoint> ();
                for (int j = 0; j < 8; j++)
                {
                    list.Add(new TKChartDataPoint(new NSNumber(j + 1), new NSNumber(r.Next() % 100)));
                }

                TKChartSeries series = null;
                switch (this.SelectedOption)
                {
                case 0:
                    series = new TKChartLineSeries(list.ToArray());
                    break;

                case 1:
                    series = new TKChartSplineSeries(list.ToArray());
                    break;

                case 2:
                    series = new TKChartAreaSeries(list.ToArray());
                    break;

                case 3:
                    series = new TKChartSplineAreaSeries(list.ToArray());
                    break;
                }
                chart.AddSeries(series);

                // >> chart-selection-cs
                series.Selection = TKChartSeriesSelection.Series;
                // << chart-selection-cs
            }
        }
Ejemplo n.º 6
0
        public void reloadChart(object sender, EventArgs e)
        {
            chart.RemoveAllData ();

            List<TKChartDataPoint> array = new List<TKChartDataPoint> ();

            string[] categories = new []{ "1", "2", "3", "4", "5", "6", "7", "8", "9", "10" };
            int[] values = new []{ 65, 56, 65, 38, 56, 78, 62, 89, 78, 65 };

            for ( int i = 0; i<categories.Length; i++ ) {
                if (i == 4 || i == 5) {
                    array.Add (new TKChartDataPoint (new NSString (categories [i]), null));
                }
                else {
                    array.Add(new TKChartDataPoint(new NSString(categories[i]), new NSNumber(values[i])));
                }
            }

            TKChartLineSeries series = null;

            switch (this.SelectedOption)
            {
            case 0:
                series = new TKChartLineSeries (array.ToArray ());
                break;
            case 1:
                series = new TKChartSplineSeries (array.ToArray ());
                break;
            case 2:
                series = new TKChartAreaSeries (array.ToArray());
                break;
            case 3:
                series = new TKChartSplineAreaSeries (array.ToArray());
                break;
            }

            series.SelectionMode = TKChartSeriesSelectionMode.Series;
            series.DisplayNilValuesAsGaps = true;
            chart.AddSeries (series);
        }
Ejemplo n.º 7
0
        public void reloadChart(object sender, EventArgs e)
        {
            chart.RemoveAllData();

            Random r = new Random();

            for (int i = 0; i < 3; i++)
            {
                List <TKChartDataPoint> list = new List <TKChartDataPoint> ();
                for (int j = 0; j < 8; j++)
                {
                    list.Add(new TKChartDataPoint(new NSNumber(j + 1), new NSNumber(r.Next() % 100)));
                }

                TKChartSeries series = null;

                switch (this.SelectedOption)
                {
                case 0:
                    series = new TKChartLineSeries(list.ToArray());
                    break;

                case 1:
                    series = new TKChartSplineSeries(list.ToArray());
                    break;

                case 2:
                    series = new TKChartAreaSeries(list.ToArray());
                    break;

                case 3:
                    series = new TKChartSplineAreaSeries(list.ToArray());
                    break;
                }
                series.SelectionMode = TKChartSeriesSelectionMode.Series;
                chart.AddSeries(series);
            }
        }