Ejemplo n.º 1
0
        void snippet6()
        {
            // >> chart-bar-gap-cs
            var series = new TKChartBarSeries(pointsWithCategoriesAndValues.ToArray());

            series.GapLength = 0.5f;
            chart.AddSeries(series);
            // << chart-bar-gap-cs
        }
Ejemplo n.º 2
0
		void LoadBarSeries()
		{
			chart.RemoveAllData ();
			TKChartBarSeries barSeries = new TKChartBarSeries (barData.ToArray ());
			barSeries.Style.PointLabelStyle.TextHidden = false;
			barSeries.Style.PointLabelStyle.LabelOffset = new UIOffset (15, 0);
			chart.AddSeries (barSeries);
			chart.ReloadData ();
		}
Ejemplo n.º 3
0
        void LoadBarSeries(object sender, EventArgs e)
        {
            chart.RemoveAllData();
            TKChartBarSeries barSeries = new TKChartBarSeries(barData.ToArray());

            barSeries.Style.PointLabelStyle.TextHidden  = false;
            barSeries.Style.PointLabelStyle.LabelOffset = new UIOffset(15, 0);
            chart.AddSeries(barSeries);
            chart.ReloadData();
        }
Ejemplo n.º 4
0
        void LoadBarSeries()
        {
            chart.RemoveAllData();
            TKChartBarSeries barSeries = new TKChartBarSeries(barData.ToArray());

            // >> chart-labels-overview-cs
            barSeries.Style.PointLabelStyle.TextHidden  = false;
            barSeries.Style.PointLabelStyle.LabelOffset = new UIOffset(15, 0);
            // << chart-labels-overview-cs

            chart.AddSeries(barSeries);
            chart.ReloadData();
        }
Ejemplo n.º 5
0
        public void setupBarSeries(object sender, EventArgs e)
        {
            chart.RemoveAllData ();

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

            TKChartBarSeries barSeries = new TKChartBarSeries (list.ToArray());
            barSeries.SelectionMode = TKChartSeriesSelectionMode.Series;
            chart.AddSeries (barSeries);
        }
Ejemplo n.º 6
0
		public void setupBarSeries()
		{
			chart.RemoveAllData ();

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

			TKChartBarSeries barSeries = new TKChartBarSeries (list.ToArray());
			barSeries.Selection = TKChartSeriesSelection.Series;
			chart.AddSeries (barSeries);
		}
Ejemplo n.º 7
0
        public void barSelected(object sender, EventArgs e)
        {
            chart.RemoveAllData ();

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

            TKChartBarSeries series = new TKChartBarSeries (list.ToArray());
            series.Style.PaletteMode = TKChartSeriesStylePaletteMode.UseItemIndex;
            series.SelectionMode = TKChartSeriesSelectionMode.DataPoint;
            chart.AddSeries (series);

            chart.ReloadData ();
        }
Ejemplo n.º 8
0
        void snippet5()
        {
            // >> chart-bar-visual-cs
            var series = new TKChartBarSeries(pointsWithCategoriesAndValues.ToArray());

            // >> chart-column-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-column-visual-cs
            // << chart-bar-visual-cs
        }
Ejemplo n.º 9
0
        void snippet2()
        {
            // >> chart-bar-cls-cs
            var pointsWithCategoriesAndValues  = new List <TKChartDataPoint> ();
            var pointsWithCategoriesAndValues2 = new List <TKChartDataPoint>();
            var categories = new [] { "Greetings", "Perfecto", "NearBy", "Family Store", "Fresh & Green" };
            var values     = new [] { 70, 75, 58, 59, 88 };

            for (int i = 0; i < categories.Length; ++i)
            {
                pointsWithCategoriesAndValues.Add(new TKChartDataPoint(new NSNumber(values [i]), NSObject.FromObject(categories [i])));
            }

            var values2 = new [] { 40, 80, 32, 69, 95 };

            for (int i = 0; i < categories.Length; ++i)
            {
                pointsWithCategoriesAndValues2.Add(new TKChartDataPoint(new NSNumber(values2 [i]), NSObject.FromObject(categories [i])));
            }

            List <NSObject> objectCategories = new List <NSObject> ();

            for (int i = 0; i < categories.Length; i++)
            {
                objectCategories.Add(new NSString(categories [i]));
            }
            var categoryAxis = new TKChartCategoryAxis(objectCategories.ToArray());

            chart.YAxis = categoryAxis;

            var series1 = new TKChartBarSeries(pointsWithCategoriesAndValues.ToArray());

            series1.YAxis = categoryAxis;

            var series2 = new TKChartBarSeries(pointsWithCategoriesAndValues2.ToArray());

            series2.YAxis = categoryAxis;

            chart.BeginUpdates();
            chart.AddSeries(series1);
            chart.AddSeries(series2);
            chart.EndUpdates();
            // << chart-bar-cls-cs
        }
Ejemplo n.º 10
0
        void snippet3()
        {
            // >> chart-bar-stack-cs
            var stackInfo = new TKChartStackInfo(new NSNumber(1), TKChartStackMode.Stack);

            var series1 = new TKChartBarSeries(pointsWithCategoriesAndValues.ToArray());

            series1.StackInfo = stackInfo;

            var series2 = new TKChartBarSeries(pointsWithCategoriesAndValues2.ToArray());

            series2.StackInfo = stackInfo;

            chart.BeginUpdates();
            chart.AddSeries(series1);
            chart.AddSeries(series2);
            chart.EndUpdates();
            // << chart-bar-stack-cs
        }
Ejemplo n.º 11
0
        void snippet1()
        {
            var pointsWithCategoriesAndValues = new List <TKChartDataPoint> ();
            var categories = new [] { "Greetings", "Perfecto", "NearBy", "Family Store", "Fresh & Green" };
            var values     = new [] { 70, 75, 58, 59, 88 };

            for (int i = 0; i < categories.Length; ++i)
            {
                pointsWithCategoriesAndValues.Add(new TKChartDataPoint(new NSNumber(values [i]), NSObject.FromObject(categories [i])));
            }

            // >> chart-bar-width-cs
            var series = new TKChartBarSeries(pointsWithCategoriesAndValues.ToArray());

            series.MinBarHeight = 20;
            series.MaxBarHeight = 50;
            chart.AddSeries(series);
            // << chart-bar-width-cs
        }
Ejemplo n.º 12
0
        public void barSelected(object sender, EventArgs e)
        {
            chart.RemoveAllData();

            Random r = new Random();
            List <TKChartDataPoint> list = new List <TKChartDataPoint> ();

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

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

            series.Style.PaletteMode = TKChartSeriesStylePaletteMode.UseItemIndex;
            series.SelectionMode     = TKChartSeriesSelectionMode.DataPoint;
            chart.AddSeries(series);

            chart.ReloadData();
        }