void pickerStackType_SelectedIndexChanged(object sender, EventArgs e) { ChartStackingType stacking = (ChartStackingType)Enum.Parse(typeof(ChartStackingType), this.pickerStackType.Items[this.pickerStackType.SelectedIndex]); this.flexChart.Stacking = stacking; this.flexChart.AxisY.Format = stacking == ChartStackingType.Stacked100pc ? "P0" : string.Empty; }
public static Picker GetChartStackingTypePicker(FlexChart chart) { Picker picker = new Picker(); picker.VerticalOptions = LayoutOptions.FillAndExpand; picker.HorizontalOptions = LayoutOptions.FillAndExpand; picker.Title = "Stacking Type"; picker.Items.Add("None"); picker.Items.Add("Stacked"); picker.Items.Add("Stacked 100%"); picker.SelectedIndexChanged += (e, sender) => { Picker sentPicker = (Picker)e; ChartStackingType stackingTypeEnum = ChartStackingType.None; switch (sentPicker.SelectedIndex) { case 0: stackingTypeEnum = ChartStackingType.None; break; case 1: stackingTypeEnum = ChartStackingType.Stacked; break; case 2: stackingTypeEnum = ChartStackingType.Stacked100pc; break; } if (chart.Stacking != stackingTypeEnum) { chart.Stacking = stackingTypeEnum; } }; return(picker); }
void pickerStackType_SelectedIndexChanged(object sender, EventArgs e) { ChartStackingType stacking = (ChartStackingType)Enum.Parse(typeof(ChartStackingType), this.pickerStackType.Items[this.pickerStackType.SelectedIndex]); this.flexChart.Stacking = stacking; }