public ZoomingAndScrolling(ChartSample chartSample) { StackLayout grid = new StackLayout() { VerticalOptions = LayoutOptions.FillAndExpand }; StackLayout stackMode = new StackLayout() { Orientation = StackOrientation.Horizontal }; stackMode.Children.Add(new Label() { Text = "Zoom Mode", HorizontalOptions = LayoutOptions.Start,VerticalOptions=LayoutOptions.Center }); Picker picker = this.CreateZoomModePicker(); picker.VerticalOptions = LayoutOptions.Start; stackMode.Children.Add(picker); chart = ChartSampleFactory.GetFlexChartSample(chartSample); chart.ZoomMode = ZoomMode.XY; chart.ChartType = ChartType.Area; chart.Stacking = ChartStackingType.Stacked; grid.Children.Add(stackMode); grid.Children.Add(chart); chart.VerticalOptions = LayoutOptions.FillAndExpand; picker.SelectedIndex = 0; Content = grid; chart.AxisX.Scale = 0.5; chart.AxisY.DisplayedRange = 16000; chart.ChartTooltip.ShowTooltip = false; }
public StylingSeriesSample(ChartSample chartSample) : base() { FlexChart chart = ChartSampleFactory.GetFlexChartSample(chartSample); IEnumerable<ChartSeries> seriesList = chart.Series; ChartSeries[] seriesArray = chart.Series.ToArray(); seriesArray[0].Color = Color.Green; seriesArray[0].BorderColor = Color.Lime; seriesArray[0].BorderWidth = 2; seriesArray[1].Color = Color.Red; seriesArray[1].BorderColor = Color.Maroon; seriesArray[1].BorderWidth = 2; seriesArray[2].ChartType = Xuni.Xamarin.FlexChart.ChartType.LineSymbol; seriesArray[2].Color = Color.FromHex("#FF6A00"); seriesArray[2].BorderWidth = 10; seriesArray[2].SymbolColor = Color.Yellow; seriesArray[2].SymbolBorderColor = Color.Yellow; seriesArray[2].SymbolBorderWidth = 5; Content = chart; }
public DynamicChartsSample(ChartSample chartSample) : base() { chart = new AdaptiveFlexChart(); chart.BindingX = "Name"; chart.IsAnimated = false; chart.ChartType = Xuni.Xamarin.FlexChart.ChartType.Line; //bug on android, path rendering cant happen with hardware acceleration on Device.OnPlatform(Android: () => chart.ChartType = Xuni.Xamarin.FlexChart.ChartType.Line); chart.Series.Add(new ChartSeries(chart, "Trucks", "Trucks")); chart.Series.Add(new ChartSeries(chart, "Ships", "Ships")); chart.Series.Add(new ChartSeries(chart, "Planes", "Planes")); for (int i = 0; i < 8; i++) { list.Add(getItem()); } chart.ItemsSource = list; Content = chart; }
public TooltipsSample(ChartSample chartSample) : base() { FlexChart chart = ChartSampleFactory.GetFlexChartSample(chartSample); chart.ChartTooltip.Content = CountryRenderChartTooltip.GetCountryRenderChartTooltip(chart); Content = chart; }
public ToggleSeriesSample(ChartSample chartSample) : base() { chart = ChartSampleFactory.GetFlexChartSample(chartSample); chart.LegendToggle = true; chart.SeriesVisibilityChanged += chart_SeriesVisibilityChanged; RelativeLayout mainRelativeLayout = new RelativeLayout(); StackLayout pickerStack = new StackLayout(); pickerStack.Orientation = StackOrientation.Vertical; salesSwitch = new Switch(); salesSwitch.IsToggled = true; salesSwitch.Toggled += sales_Toggled; pickerStack.Children.Add(GetSwitchAndLabel("Sales", salesSwitch)); expensesSwitch = new Switch(); expensesSwitch.IsToggled = true; expensesSwitch.Toggled += expenses_Toggled; pickerStack.Children.Add(GetSwitchAndLabel("Expenses", expensesSwitch)); downloadsSwitch = new Switch(); downloadsSwitch.IsToggled = true; downloadsSwitch.Toggled += downloads_Toggled; pickerStack.Children.Add(GetSwitchAndLabel("Downloads", downloadsSwitch)); mainRelativeLayout.Children.Add(pickerStack, Constraint.Constant(0), Constraint.Constant(0)); mainRelativeLayout.Children.Add(chart, Constraint.Constant(0), Constraint.RelativeToView(pickerStack, (parent, sibling) => { return sibling.Y + sibling.Height; }), Constraint.RelativeToView(pickerStack, (parent, sibling) => { return parent.Width; }), Constraint.RelativeToView(pickerStack, (parent, sibling) => { return parent.Height - sibling.Height; })); // On Windows Phone,StackLayout and Picker will shrink automatically. // http://forums.xamarin.com/discussion/22436/picker-is-shrink-on-windows-phone-8 mainRelativeLayout.SizeChanged += (s, e) => { pickerStack.WidthRequest = mainRelativeLayout.Width; }; Content = mainRelativeLayout; }
public MixedChartTypesSample(ChartSample chartSample) : base() { FlexChart chart = ChartSampleFactory.GetFlexChartSample(chartSample); IEnumerable<ChartSeries> seriesList = chart.Series; seriesList.ToArray()[2].ChartType = Xuni.Xamarin.FlexChart.ChartType.Line; Content = chart; }
public ThemingSample(ChartSample chartSample) : base() { StackLayout grid = new StackLayout() { VerticalOptions = LayoutOptions.FillAndExpand }; Picker picker = this.CreatePalettesPicker(); picker.VerticalOptions = LayoutOptions.Start; grid.Children.Add(picker); chart = ChartSampleFactory.GetFlexChartSample(chartSample); grid.Children.Add(chart); chart.VerticalOptions = LayoutOptions.FillAndExpand; picker.SelectedIndex = 0; Content = grid; }
public static FlexChart GetFlexChartSample(ChartSample chartSample) { switch (chartSample.SampleDataType) { case (int)ChartSampleDataType.SALES_EXPENSES_DOWNLOADS: return SalesExpensesDownloads(); case (int)ChartSampleDataType.BUBBLE: return Bubble(); //case (int)ChartSampleDataType.FINANCIAL: // return FinancialChart(); } return null; }
public static FlexChart GetFlexChartSample(ChartSample chartSample) { switch (chartSample.SampleDataType) { case (int)ChartSampleDataType.SALES_EXPENSES_DOWNLOADS: return(SalesExpensesDownloads()); case (int)ChartSampleDataType.BUBBLE: return(Bubble()); //case (int)ChartSampleDataType.FINANCIAL: // return FinancialChart(); } return(null); }
public SelectionModesSample(ChartSample chartSample) : base() { FlexChart chart = ChartSampleFactory.GetFlexChartSample(chartSample); chart.SelectedBorderColor = Color.FromRgb(255, 0, 0); chart.SelectedBorderWidth = 3; chart.SelectedDashes = new double[] { 20, 10 }; RelativeLayout mainRelativeLayout = new RelativeLayout(); WrapLayout pickerStack = new WrapLayout(); pickerStack.Orientation = StackOrientation.Horizontal; Picker chartType = Pickers.GetChartTypePicker(chart); Picker selectionType = Pickers.GetSelectionModeTypePicker(chart); chartType.SelectedIndex = 0; selectionType.SelectedIndex = 1; pickerStack.Children.Add(chartType); pickerStack.Children.Add(selectionType); mainRelativeLayout.Children.Add(pickerStack, Constraint.Constant(0), Constraint.Constant(0)); mainRelativeLayout.Children.Add(chart, Constraint.Constant(0), Constraint.RelativeToView(pickerStack, (parent, sibling) => { return sibling.Y + sibling.Height; }), Constraint.RelativeToView(pickerStack, (parent, sibling) => { return parent.Width; }), Constraint.RelativeToView(pickerStack, (parent, sibling) => { return parent.Height - sibling.Height; })); // On Windows Phone,StackLayout and Picker will shrink automatically. // http://forums.xamarin.com/discussion/22436/picker-is-shrink-on-windows-phone-8 mainRelativeLayout.SizeChanged += (s, e) => { pickerStack.WidthRequest = mainRelativeLayout.Width; }; Content = mainRelativeLayout; }
public ChartTypesSample(ChartSample chartSample) : base() { FlexChart chart = ChartSampleFactory.GetFlexChartSample(chartSample); RelativeLayout mainRelativeLayout = new RelativeLayout(); WrapLayout pickerStack = new WrapLayout(); pickerStack.Orientation = StackOrientation.Horizontal; Picker chartType = Pickers.GetChartTypePicker(chart); Picker stackingType = Pickers.GetChartStackingTypePicker(chart); Picker rotationType = Pickers.GetChartRotationTypePicker(chart); pickerStack.Children.Add(chartType); pickerStack.Children.Add(stackingType); pickerStack.Children.Add(rotationType); mainRelativeLayout.Children.Add(pickerStack, Constraint.Constant(0), Constraint.Constant(0)); mainRelativeLayout.Children.Add(chart, Constraint.Constant(0), Constraint.RelativeToView(pickerStack, (parent, sibling) => { return sibling.Y + sibling.Height; }), Constraint.RelativeToView(pickerStack, (parent, sibling) => { return parent.Width; }), Constraint.RelativeToView(pickerStack, (parent, sibling) => { return parent.Height - sibling.Height; })); // On Windows Phone,StackLayout and Picker will shrink automatically. // http://forums.xamarin.com/discussion/22436/picker-is-shrink-on-windows-phone-8 mainRelativeLayout.SizeChanged += (s, e) => { pickerStack.WidthRequest = mainRelativeLayout.Width; }; Content = mainRelativeLayout; }
public TitleAndLegendSample(ChartSample chartSample) : base() { FlexChart chart = ChartSampleFactory.GetFlexChartSample(chartSample); chart.HeaderText = "Sample Chart"; chart.HeaderTextColor = Color.FromHex("#80044d"); chart.HeaderFont = Font.SystemFontOfSize(30); chart.HeaderXAlign = TextAlignment.Center; chart.FooterText = "2014 GrapeCity, Inc."; chart.FooterTextColor = Color.FromHex("#80044d"); chart.FooterFont = Font.SystemFontOfSize(14); chart.FooterXAlign = TextAlignment.Center; chart.AxisX.TitleText = "Amount"; chart.AxisX.TitleFont = Font.SystemFontOfSize(14, FontAttributes.Bold | FontAttributes.Italic); chart.AxisY.TitleText = "Country"; chart.AxisY.TitleFont = Font.SystemFontOfSize(14, FontAttributes.Bold | FontAttributes.Italic); Content = chart; }
public BubbleChartSample(ChartSample chartSample) { FlexChart chart = ChartSampleFactory.GetFlexChartSample(chartSample); Content = chart; }
public FinancialChart(ChartSample chartSample) { FlexChart chart = ChartSampleFactory.GetFlexChartSample(chartSample); Content = chart; }
public GettingStartedSample(ChartSample chartSample) : base() { chart = ChartSampleFactory.GetFlexChartSample(chartSample); Content = chart; }