public void rangeBarSelected(object sender, EventArgs e)
        {
            chart.RemoveAllData ();
            List<TKChartRangeDataPoint> list = new List<TKChartRangeDataPoint> ();
            for (int i = 0; i < 8; i++) {
                list.Add(TKChartRangeDataPoint.RangeBarDataPoint(new NSNumber(i), lowValues[i], highValues[i]));
            }

            TKChartRangeBarSeries series = new TKChartRangeBarSeries (list.ToArray());
            series.Style.PaletteMode = TKChartSeriesStylePaletteMode.UseItemIndex;
            series.SelectionMode = TKChartSeriesSelectionMode.DataPoint;
            chart.AddSeries(series);
            chart.ReloadData ();
        }
Beispiel #2
0
        public void rangeBarSelected()
        {
            chart.RemoveAllData();
            List <TKChartRangeDataPoint> list = new List <TKChartRangeDataPoint> ();

            for (int i = 0; i < 8; i++)
            {
                list.Add(TKChartRangeDataPoint.RangeBarDataPoint(new NSNumber(i), lowValues[i], highValues[i]));
            }

            TKChartRangeBarSeries series = new TKChartRangeBarSeries(list.ToArray());

            series.Style.PaletteMode = TKChartSeriesStylePaletteMode.UseItemIndex;
            series.Selection         = TKChartSeriesSelection.DataPoint;
            chart.AddSeries(series);
            chart.ReloadData();
        }
        void barRange()
        {
            // >> chart-range-bar-cs
            var lowValues = new NSNumber[] {
                new NSNumber(33), new NSNumber(29),
                new NSNumber(55), new NSNumber(21),
                new NSNumber(10), new NSNumber(39),
                new NSNumber(40), new NSNumber(11)
            };

            var highValues = new NSNumber[] {
                new NSNumber(47), new NSNumber(61),
                new NSNumber(64), new NSNumber(40),
                new NSNumber(33), new NSNumber(90),
                new NSNumber(87), new NSNumber(69)
            };


            var lowValues2 = new NSNumber[] {
                new NSNumber(31), new NSNumber(32),
                new NSNumber(57), new NSNumber(18),
                new NSNumber(12), new NSNumber(31),
                new NSNumber(45), new NSNumber(14)
            };

            var highValues2 = new NSNumber[] {
                new NSNumber(43), new NSNumber(66),
                new NSNumber(61), new NSNumber(49),
                new NSNumber(31), new NSNumber(80),
                new NSNumber(82), new NSNumber(78)
            };

            List <TKChartRangeDataPoint> list  = new List <TKChartRangeDataPoint> ();
            List <TKChartRangeDataPoint> list2 = new List <TKChartRangeDataPoint> ();

            for (int i = 0; i < 8; i++)
            {
                list.Add(TKChartRangeDataPoint.RangeBarDataPoint(new NSNumber(i), lowValues[i], highValues[i]));
                list2.Add(TKChartRangeDataPoint.RangeBarDataPoint(new NSNumber(i), lowValues2[i], highValues2[i]));
            }

            TKChartRangeBarSeries series  = new TKChartRangeBarSeries(list.ToArray());
            TKChartRangeBarSeries series2 = new TKChartRangeBarSeries(list2.ToArray());

            chart.AddSeries(series);
            chart.AddSeries(series2);
            // << chart-range-bar-cs

            // >> chart-range-bar-visual-cs
            series.Style.Palette = new TKChartPalette();
            var paletteItem = new TKChartPaletteItem();

            paletteItem.Fill   = new TKSolidFill(UIColor.Red);
            paletteItem.Stroke = new TKStroke(UIColor.Black);
            series.Style.Palette.AddPaletteItem(paletteItem);
            chart.AddSeries(series);
            // << chart-range-bar-visual-cs

            // >> chart-range-bar-gap-cs
            series.GapLength = 0.5f;
            // << chart-range-bar-gap-cs

            // >> chart-range-bar-height-cs
            series.MinBarHeight = 20;
            series.MaxBarHeight = 50;
            // << chart-range-bar-height-cs
        }