public AnimationOptions() { InitializeComponent(); Title = AppResources.LoadAnimationTitle; //FlexChartDemo.Data.Views.Common.Utility.CheckNavBar(this); this.flexChart.ItemsSource = ChartSampleFactory.CreateEntityList(); this.pickerChartType.Items.Add(ChartType.Column.ToString()); this.pickerChartType.Items.Add(ChartType.Area.ToString()); this.pickerChartType.Items.Add(ChartType.Line.ToString()); this.pickerChartType.Items.Add(ChartType.LineSymbols.ToString()); this.pickerChartType.Items.Add(ChartType.Spline.ToString()); this.pickerChartType.Items.Add(ChartType.SplineSymbols.ToString()); this.pickerChartType.Items.Add(ChartType.SplineArea.ToString()); this.pickerChartType.Items.Add(ChartType.Scatter.ToString()); foreach (var item in Enum.GetNames(typeof(ChartAnimationMode))) { this.pickerAnimationMode.Items.Add(item); } this.pickerChartType.SelectedIndex = 0; this.pickerAnimationMode.SelectedIndex = 1; // customize animation this.flexChart.LoadAnimation.Duration = 1200; this.flexChart.LoadAnimation.StartDelay = 300; //this.flexChart.LoadAnimation.Easing = Easing.SpringIn; this.flexChart.Palette = Xuni.Forms.ChartCore.ChartPalettes.Modern; this.flexChart.AxisX.Format = "M/dd"; }
public SelectionModesSample() { InitializeComponent(); Title = AppResources.SelectionModesTitle; this.flexChart.ItemsSource = ChartSampleFactory.CreateEntityList(); Device.OnPlatform(Android: () => this.flexChart.SelectedDashes = new double[] { 15, 5 } ); Device.OnPlatform(WinPhone: () => this.flexChart.SelectedDashes = new double[] { 3, 1 } ); Device.OnPlatform(iOS: () => this.flexChart.SelectedDashes = new double[] { 7.5, 2.5 } ); this.pickerChartType.Items.Add(ChartType.Column.ToString()); this.pickerChartType.Items.Add(ChartType.Bar.ToString()); this.pickerChartType.Items.Add(ChartType.Scatter.ToString()); this.pickerChartType.Items.Add(ChartType.Line.ToString()); this.pickerChartType.Items.Add(ChartType.LineSymbols.ToString()); this.pickerChartType.Items.Add(ChartType.Area.ToString()); foreach (var item in Enum.GetNames(typeof(ChartSelectionModeType))) { this.pickerSelectionMode.Items.Add(item); } this.pickerChartType.SelectedIndex = 0; this.pickerSelectionMode.SelectedIndex = 1; }
public DataLabelSample() { InitializeComponent(); Title = AppResources.DataLabelsTitle; this.pickerChartType.Items.Add(ChartType.Column.ToString()); this.pickerChartType.Items.Add(ChartType.Bar.ToString()); this.pickerChartType.Items.Add(ChartType.Scatter.ToString()); this.pickerChartType.Items.Add(ChartType.Line.ToString()); this.pickerChartType.Items.Add(ChartType.LineSymbols.ToString()); this.pickerChartType.Items.Add(ChartType.Area.ToString()); this.pickerChartType.Items.Add(ChartType.Spline.ToString()); this.pickerChartType.Items.Add(ChartType.SplineSymbols.ToString()); this.pickerChartType.Items.Add(ChartType.SplineArea.ToString()); // the data labels sample should show a bar chart by default. this.pickerChartType.SelectedIndex = 1; this.pickerChartType.IsVisible = false; this.flexChart.ItemsSource = ChartSampleFactory.CreateEntityList(); this.flexChart.Palette = Xuni.Forms.ChartCore.ChartPalettes.Organic; foreach (var item in Enum.GetNames(typeof(ChartLabelPosition))) { this.pickPostion.Items.Add(item); } this.pickPostion.SelectedIndex = 1; }
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 TitleAndLegendSample() { InitializeComponent(); Title = AppResources.LegendSampleTitle; this.flexChart.ItemsSource = ChartSampleFactory.CreateEntityList(); }
public BubbleChartSample() { InitializeComponent(); Title = AppResources.BubbleChartTitle; this.flexChart.ItemsSource = ChartSampleFactory.CreateEntityList(); this.flexChart.LoadAnimation.AnimationMode = Xuni.Forms.ChartCore.ChartAnimationMode.Series; }
public TooltipsSample(ChartSample chartSample) : base() { FlexChart chart = ChartSampleFactory.GetFlexChartSample(chartSample); chart.ChartTooltip.Content = CountryRenderChartTooltip.GetCountryRenderChartTooltip(chart); Content = chart; }
public ScrollingSample() { InitializeComponent(); Title = AppResources.ScrollingTitle; this.flexChart.ItemsSource = ChartSampleFactory.FinancialData(); this.flexChart.Palette = Xuni.Forms.ChartCore.ChartPalettes.Midnight; this.flexChart.HeaderText = AppResources.ScrollZoomInstructions; }
public StylingSeriesSample() { InitializeComponent(); Title = AppResources.StylingSeriesTitle; this.flexChart.ItemsSource = ChartSampleFactory.CreateEntityList(); this.flexChart.AxisX.MajorTickWidth = 0; this.flexChart.AxisX.MinorTickWidth = 1; }
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 CustomizingAxesSample() { InitializeComponent(); Title = AppResources.CustomizingAxesTitle; this.flexChart.ItemsSource = ChartSampleFactory.CreateEntityList(); this.flexChart.AxisX.LabelLoading += AxisXLabeLoading; this.flexChart.AxisY.LabelLoading += AxisYLabeLoading; }
public ToggleSeriesSample() { InitializeComponent(); Title = AppResources.ToggleSeriesTitle; this.flexChart.ItemsSource = ChartSampleFactory.CreateEntityList(); this.flexChart.Palette = Xuni.Forms.ChartCore.ChartPalettes.Darkly; this.flexChart.AxisX.Format = "M/dd"; this.flexChart.LegendToggle = true; }
public MixedChartTypesSample() { InitializeComponent(); Title = AppResources.MixedChartTypesTitle; this.flexChart.ItemsSource = ChartSampleFactory.CreateEntityList(); this.flexChart.AxisX.LabelAngle = 45; this.flexChart.AxisX.MinorTickWidth = 1; this.flexChart.AxisX.MajorTickWidth = 0; }
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 DataLabelSample() { InitializeComponent(); this.flexChart.ItemsSource = ChartSampleFactory.CreateEntityList(); foreach (var item in Enum.GetNames(typeof(ChartLabelPosition))) { this.pickPostion.Items.Add(item); } this.pickPostion.SelectedIndex = 3; }
public DynamicChartsSample() { InitializeComponent(); this.flexChart.ItemsSource = ChartSampleFactory.CreateEntityList(); for (int i = 0; i < 8; i++) { list.Add(getItem()); } flexChart.ItemsSource = list; }
public GettingStartedSample() { InitializeComponent(); Title = AppResources.GettingStartedTitle; flexChart.ItemsSource = ChartSampleFactory.CreateEntityList(); flexChart.AxisX.MinorTickWidth = 1; flexChart.AxisX.MajorTickWidth = 0; flexChart.Tooltip.Threshold = 50; }
public ThemingSample() { InitializeComponent(); this.flexChart.ItemsSource = ChartSampleFactory.CreateEntityList(); IEnumerable <FieldInfo> fields = typeof(Palettes).GetRuntimeFields(); foreach (var item in fields) { picker.Items.Add(item.Name); } picker.SelectedIndex = 0; }
public FinancialChart() { InitializeComponent(); Title = AppResources.FinancialChartTitle; this.flexChart.ItemsSource = ChartSampleFactory.FinancialData(); this.flexChart.ChartType = ChartType.Candle; this.flexChart.Legend.Position = Xuni.Forms.ChartCore.ChartPositionType.None; this.flexChart.AxisY.MajorGridFill = Color.FromRgba(50, 50, 50, 20); this.flexChart.AxisX.Format = "yyyy/MM/dd"; this.pickerChartType.Items.Add(ChartType.Candle.ToString()); this.pickerChartType.Items.Add(ChartType.Hloc.ToString()); this.pickerChartType.SelectedIndex = 0; }
public DynamicChartsSample() { InitializeComponent(); Title = AppResources.DynamicChartTitle; this.flexChart.ItemsSource = ChartSampleFactory.CreateEntityList(); for (int i = 0; i < 8; i++) { list.Add(getItem()); } this.flexChart.ItemsSource = list; this.flexChart.Palette = Xuni.Forms.ChartCore.ChartPalettes.Coral; this.flexChart.ShowTooltips = false; }
public Snapshot() { InitializeComponent(); Title = AppResources.ExportImageTitle; snapshotFrame.Opacity = 0; this.flexChart.ItemsSource = ChartSampleFactory.CreateEntityList(); var tapGestureRecognizer = new TapGestureRecognizer(); tapGestureRecognizer.Tapped += (s, e) => { snapshotFrame.Opacity = 1; }; snapshotFrame.GestureRecognizers.Add(tapGestureRecognizer); }
public ZoomingAndScrolling() { InitializeComponent(); this.flexChart.ItemsSource = ChartSampleFactory.CreateEntityList(); //disable tooltip on android Device.OnPlatform(Android: () => this.flexChart.Tooltip = null); foreach (var item in Enum.GetNames(typeof(ZoomMode))) { this.pickerZoomMode.Items.Add(item); } this.pickerZoomMode.SelectedIndex = 2; }
public TooltipsSample() { InitializeComponent(); Title = AppResources.CustomTooltipsTitle; this.chart.ItemsSource = ChartSampleFactory.CreateEntityList(); this.chart.Palette = Xuni.Forms.ChartCore.ChartPalettes.Zen; this.chart.LoadAnimation.AnimationMode = Xuni.Forms.ChartCore.ChartAnimationMode.Series; this.chart.AxisX.MinorTickWidth = 1; this.chart.AxisX.MajorTickWidth = 0; this.chart.AxisX.LabelFontSize = 16; this.chart.AxisY.MajorTickWidth = 0; this.chart.AxisY.MajorUnit = 2000; this.chart.AxisY.AxisLineVisible = false; this.chart.AxisY.LabelFontSize = 16; }
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 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 LineMarkerSample() { InitializeComponent(); Title = AppResources.LineMarkerTitle; this.flexChart.ItemsSource = ChartSampleFactory.CreateEntityList(); this.flexChart.LineMarker.IsVisible = true; foreach (var item in Enum.GetNames(typeof(ChartMarkerInteraction))) { this.pickerInteraction.Items.Add(item); } foreach (var item in verticalPositions) { this.pickerVerPosition.Items.Add(item.ToString()); } this.pickerInteraction.SelectedIndex = 1; this.pickerVerPosition.SelectedIndex = 1; }
public SelectionModesSample() { InitializeComponent(); this.flexChart.ItemsSource = ChartSampleFactory.CreateEntityList(); this.pickerChartType.Items.Add(ChartType.Column.ToString()); this.pickerChartType.Items.Add(ChartType.Bar.ToString()); this.pickerChartType.Items.Add(ChartType.Scatter.ToString()); this.pickerChartType.Items.Add(ChartType.Line.ToString()); this.pickerChartType.Items.Add(ChartType.LineSymbol.ToString()); this.pickerChartType.Items.Add(ChartType.Area.ToString()); foreach (var item in Enum.GetNames(typeof(ChartSelectionModeType))) { this.pickerSelectionMode.Items.Add(item); } this.pickerChartType.SelectedIndex = 0; this.pickerSelectionMode.SelectedIndex = 1; }
public ChartTypesSample() { InitializeComponent(); Title = AppResources.BasicChartTypesTitle; this.flexChart.ItemsSource = ChartSampleFactory.CreateEntityList(); foreach (var item in ChartSampleFactory.GetBasicChartTypes()) { this.pickerChartType.Items.Add(item.ToString()); } foreach (var item in Enum.GetNames(typeof(ChartStackingType))) { this.pickerStackType.Items.Add(item); } this.pickerChartType.SelectedIndex = 5; this.pickerStackType.SelectedIndex = 1; this.flexChart.ZoomMode = ChartZoomMode.XY; }
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 AnimationOptions() { InitializeComponent(); FlexChartDemo.Data.Views.Common.Utility.CheckNavBar(this); this.flexChart.ItemsSource = ChartSampleFactory.CreateEntityList(); this.pickerChartType.Items.Add(ChartType.Column.ToString()); this.pickerChartType.Items.Add(ChartType.Bar.ToString()); this.pickerChartType.Items.Add(ChartType.Scatter.ToString()); this.pickerChartType.Items.Add(ChartType.Line.ToString()); this.pickerChartType.Items.Add(ChartType.LineSymbol.ToString()); this.pickerChartType.Items.Add(ChartType.Area.ToString()); foreach (var item in Enum.GetNames(typeof(AnimationMode))) { this.pickerAnimationMode.Items.Add(item); } this.pickerChartType.SelectedIndex = 0; this.pickerAnimationMode.SelectedIndex = 1; // customize animation this.flexChart.LoadAnimation.Duration = 900; this.flexChart.LoadAnimation.Easing = Easing.SpringIn; }