async void OnFetchDataTap(object sender, EventArgs e) { InitialiseChart(); BTProgressHUD.Show("Fetching data"); var data = await GetDataAsync(); // set data source var barSeriesSource = new IGCategorySeriesDataSourceHelper(); barSeriesSource.Values = data.ProductSales.ToArray(); barSeriesSource.Labels = data.ProductName.ToArray(); // Create axis types and add it to the chart var xAxisBar = new IGNumericXAxis("xAxis"); var yAxisBar = new IGCategoryYAxis("yAxis"); yAxisBar.LabelAlignment = IGHorizontalAlign.IGHorizontalAlignRight; chart.AddAxis(xAxisBar); chart.AddAxis(yAxisBar); // decide on what series need to be displayed on the chart var barSeries = new IGBarSeries("series"); barSeries.XAxis = xAxisBar; barSeries.YAxis = yAxisBar; // set the appropriate data sources barSeries.DataSource = barSeriesSource; chart.AddSeries(barSeries); BTProgressHUD.Dismiss(); }
async void OnFetchDataTap (object sender, EventArgs e) { InitialiseChart (); BTProgressHUD.Show ("Fetching data"); var data = await GetDataAsync (); // set data source var barSeriesSource = new IGCategorySeriesDataSourceHelper (); barSeriesSource.Values = data.ProductSales.ToArray (); barSeriesSource.Labels = data.ProductName.ToArray (); // Create axis types and add it to the chart var xAxisBar = new IGNumericXAxis ("xAxis"); var yAxisBar = new IGCategoryYAxis ("yAxis"); yAxisBar.LabelAlignment = IGHorizontalAlign.IGHorizontalAlignRight; chart.AddAxis (xAxisBar); chart.AddAxis (yAxisBar); // decide on what series need to be displayed on the chart var barSeries = new IGBarSeries ("series"); barSeries.XAxis = xAxisBar; barSeries.YAxis = yAxisBar; // set the appropriate data sources barSeries.DataSource = barSeriesSource; chart.AddSeries (barSeries); BTProgressHUD.Dismiss (); }