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 App() { //Register Syncfusion license Syncfusion.Licensing.SyncfusionLicenseProvider.RegisterLicense("MTc0NTcwQDMxMzcyZTMzMmUzME1Ybnd3WitCVlVlYmhrVmRxUnhDamFmZm90Q09UcTZ1R3hlUUFPbTIzS1U9"); InitializeComponent(); MainPage = new ChartSample(); }
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; }
private void Button_Click(object sender, RoutedEventArgs e) { var sp = new Stopwatch(); sp.Start(); ChartSample.Redraw(); GC.Collect(); long mem = GC.GetTotalMemory(true); Console.WriteLine("処理時間={0:#,0}ミリ秒,メモリ消費量={1:#,0}byte", sp.Elapsed.TotalMilliseconds.ToString(), mem); }
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 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 CustomizingAxesSample(ChartSample chartSample) : base() { FlexChart chart = ChartSampleFactory.GetFlexChartSample(chartSample); chart.AxisY.LineWidth = 2; chart.AxisY.MajorTickWidth = 0; chart.AxisY.MajorGridColor = Color.FromHex("#C4C4C4"); chart.AxisY.AxisLineVisible = true; chart.AxisY.MinorTickWidth = 1; chart.AxisY.Format = "c0"; chart.AxisY.Max = 10000; chart.AxisY.MajorUnit = 2000; chart.AxisX.MajorTickWidth = 1; chart.AxisX.LineColor = Color.FromHex("#C4C4C4"); chart.AxisX.MajorGridColor = Color.FromHex("#C4C4C4"); chart.AxisX.MajorTickColor = Color.FromHex("#C4C4C4"); Content = chart; }
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 GettingStartedSample(ChartSample chartSample) : base() { chart = ChartSampleFactory.GetFlexChartSample(chartSample); Content = chart; }
public FinancialChart(ChartSample chartSample) { FlexChart chart = ChartSampleFactory.GetFlexChartSample(chartSample); Content = chart; }
public BubbleChartSample(ChartSample chartSample) { FlexChart chart = ChartSampleFactory.GetFlexChartSample(chartSample); Content = chart; }
public static ContentPage GetChartContentPage(ChartSample chartSample) { ContentPage page = null; switch (chartSample.SampleViewType) { case (int)ChartSampleViewType.GETTING_STARTED: page = new GettingStartedSample(); break; case (int)ChartSampleViewType.CHART_TYPES: page = new ChartTypesSample(); break; case (int)ChartSampleViewType.MIXED_CHART_TYPES: page = new MixedChartTypesSample(); break; case (int)ChartSampleViewType.LEGEND_AND_TITLES: page = new TitleAndLegendSample(); break; case (int)ChartSampleViewType.TOOLTIPS: page = new TooltipsSample(); break; case (int)ChartSampleViewType.STYLING_SERIES: page = new StylingSeriesSample(); break; case (int)ChartSampleViewType.CUSTOMIZING_AXES: page = new CustomizingAxesSample(); break; case (int)ChartSampleViewType.THEMING: page = new ThemingSample(); break; case (int)ChartSampleViewType.SELECTION_MODES: page = new SelectionModesSample(); break; case (int)ChartSampleViewType.TOGGLE_SERIES: page = new ToggleSeriesSample(); break; case (int)ChartSampleViewType.DYNAMIC_CHARTS: page = new DynamicChartsSample(); break; case (int)ChartSampleViewType.BUBBLE_CHART: page = new BubbleChartSample(); break; case (int)ChartSampleViewType.FINANCIAL_CHART: page = new FinancialChart(); break; case (int)ChartSampleViewType.ZOOMING_AND_SCROLLING: page = new ZoomingAndScrolling(); break; case (int)ChartSampleViewType.HITTEST: page = new HitTest(); break; case (int)ChartSampleViewType.ANIMATION: page = new AnimationOptions(); break; } page.Title = chartSample.Name; return(page); }
private static void Main(string[] args) { Thread.CurrentThread.CurrentCulture = new System.Globalization.CultureInfo("en-US"); //Paragraphs ParagraphSample.SimpleFormattedParagraphs(); ParagraphSample.ForceParagraphOnSinglePage(); ParagraphSample.ForceMultiParagraphsOnSinglePage(); ParagraphSample.TextActions(); ParagraphSample.Heading(); ////Document DocumentSample.AddCustomProperties(); DocumentSample.ReplaceText(); DocumentSample.ApplyTemplate(); DocumentSample.AppendDocument(); //Images ImageSample.AddPicture(); ImageSample.CopyPicture(); ImageSample.ModifyImage(); //Indentation/Direction/Margins MarginSample.SetDirection(); MarginSample.Indentation(); MarginSample.Margins(); //Header/Footers HeaderFooterSample.HeadersFooters(); //Tables TableSample.InsertRowAndImageTable(); TableSample.TextDirectionTable(); TableSample.CreateRowsFromTemplate(); TableSample.ColumnsWidth(); TableSample.MergeCells(); //Hyperlink HyperlinkSample.Hyperlinks(); //Section SectionSample.InsertSections(); //Lists ListSample.AddList(); //Equations EquationSample.InsertEquation(); //Bookmarks BookmarkSample.InsertBookmarks(); BookmarkSample.ReplaceText(); //Charts ChartSample.BarChart(); ChartSample.LineChart(); ChartSample.PieChart(); ChartSample.Chart3D(); //Tale of Content TableOfContentSample.InsertTableOfContent(); TableOfContentSample.InsertTableOfContentWithReference(); //Lines LineSample.InsertHorizontalLine(); //Protection ProtectionSample.AddPasswordProtection(); ProtectionSample.AddProtection(); //Parallel ParallelSample.DoParallelActions(); //Others MiscellaneousSample.CreateRecipe(); MiscellaneousSample.CompanyReport(); MiscellaneousSample.CreateInvoice(); Console.WriteLine("\nPress any key to exit."); Console.ReadKey(); }
public static Page GetChartContentPage(ChartSample chartSample) { Page page = null; switch (chartSample.SampleViewType) { case (int)ChartSampleViewType.GETTING_STARTED: page = new GettingStartedSample(); break; case (int)ChartSampleViewType.CHART_TYPES: page = new ChartTypesSample(); break; case (int)ChartSampleViewType.MIXED_CHART_TYPES: page = new MixedChartTypesSample(); break; case (int)ChartSampleViewType.LEGEND_AND_TITLES: page = new TitleAndLegendSample(); break; case (int)ChartSampleViewType.TOOLTIPS: page = new TooltipsSample(); break; case (int)ChartSampleViewType.STYLING_SERIES: page = new StylingSeriesSample(); break; case (int)ChartSampleViewType.CUSTOMIZING_AXES: page = new CustomizingAxesSample(); break; case (int)ChartSampleViewType.THEMING: page = new ThemingSample(); break; case (int)ChartSampleViewType.SELECTION_MODES: page = new SelectionModesSample(); break; case (int)ChartSampleViewType.TOGGLE_SERIES: page = new ToggleSeriesSample(); break; case (int)ChartSampleViewType.DYNAMIC_CHARTS: page = new DynamicChartsSample(); break; case (int)ChartSampleViewType.BUBBLE_CHART: page = new BubbleChartSample(); break; case (int)ChartSampleViewType.FINANCIAL_CHART: page = new FinancialChart(); break; case (int)ChartSampleViewType.ZOOMING_AND_SCROLLING: page = new ZoomingAndScrolling(); break; case (int)ChartSampleViewType.HITTEST: page = new HitTest(); break; case (int)ChartSampleViewType.ANIMATION: page = new AnimationOptions(); break; case (int)ChartSampleViewType.MUTIPLE_AXES: page = new MultipleAxesSamples(); break; case (int)ChartSampleViewType.CUSTOM_PLOT_ELEMENTS: page = new CustomPlotElements(); break; case (int)ChartSampleViewType.CONDITIONAL_FORMAT: page = new ConditionalFormatting(); break; case (int)ChartSampleViewType.DATA_LABEL: page = new DataLabelSample(); break; case (int)ChartSampleViewType.SNAPSHOT: page = new Snapshot(); break; case (int)ChartSampleViewType.UPDATE_ANIMATION: page = new UpdateAnimation(); break; case (int)ChartSampleViewType.SCROLLING: page = new ScrollingSample(); break; } page.Title = chartSample.Name; return(page); }