private RadCartesianChartView createChart() { //Create the Chart View RadCartesianChartView chart = new RadCartesianChartView(this.Activity); //Create the scatter bubble series and attach axes and value bindings. ScatterBubbleSeries scatterBubbleSeries = new ScatterBubbleSeries(); scatterBubbleSeries.BubbleScale = 1000; scatterBubbleSeries.XValueBinding = new XValueBinding(); scatterBubbleSeries.YValueBinding = new YValueBinding(); scatterBubbleSeries.BubbleSizeBinding = new AreaValueBinding(); LinearAxis verticalAxis = new LinearAxis(); //The values in the linear axis will not have values after the decimal point. verticalAxis.LabelFormat = "%.2f"; LinearAxis horizontalAxis = new LinearAxis(); horizontalAxis.LabelFormat = "%.2f"; scatterBubbleSeries.VerticalAxis = verticalAxis; scatterBubbleSeries.HorizontalAxis = horizontalAxis; //Bind series to data scatterBubbleSeries.Data = this.getData(); //Add series to chart chart.Series.Add(scatterBubbleSeries); return(chart); }
private RadCartesianChartView createChart() { RadCartesianChartView chart = new RadCartesianChartView(this.Activity); // context is an instance of Context. OhlcSeries series = new OhlcSeries(); series.CategoryBinding = new CategoryBinding(); series.OpenBinding = new OpenValueBinding(); series.HighBinding = new HighValueBinding(); series.LowBinding = new LowValueBinding(); series.CloseBinding = new CloseValueBinding(); series.Data = this.getData(); chart.Series.Add(series); CategoricalAxis horizontalAxis = new CategoricalAxis(); chart.HorizontalAxis = horizontalAxis; LinearAxis verticalAxis = new LinearAxis(); chart.VerticalAxis = verticalAxis; return(chart); }
//public override bool OnOptionsItemSelected(IMenuItem item) //{ // var id = item.ItemId; // if (id == Resource.Id.home) // { // var frag = new Fragment1(); // FragmentManager fg = this.Activity.SupportFragmentManager; // FragmentTransaction ft = fg.BeginTransaction(); // ft.Replace(Resource.Id.content_frame, frag); // ft.SetTransition(FragmentTransaction.TransitFragmentFade); // ft.Commit(); // } // return base.OnOptionsItemSelected(item); //} private RadCartesianChartView createChart() { //var client = ServiceStack.JsonServiceClient("http://localhost:52303"); // var client= JsonServiceClient("http://localhost:52303"); //var client = new JsonServiceClient("http://localhost:52303"); //var res = client.Get(new GetTextileSample()); //var d = res.Samples; //Create the Chart View RadCartesianChartView chart = new RadCartesianChartView(this.Activity); //Create the bar series and attach axes and value bindings. BarSeries barSeries = new BarSeries(); barSeries.ValueBinding = new ValueBinding(); barSeries.CategoryBinding = new CategoryBinding(); LinearAxis verticalAxis = new LinearAxis(); //The values in the linear axis will not have values after the decimal point. CategoricalAxis horizontalAxis = new CategoricalAxis(); horizontalAxis.LabelFormat = "%.0f"; barSeries.VerticalAxis = verticalAxis; barSeries.HorizontalAxis = horizontalAxis; //Bind series to data barSeries.Data = this.getData(); //Add series to chart chart.Series.Add(barSeries); return(chart); }
private RadCartesianChartView createChart() { //Create the Chart View RadCartesianChartView chart = new RadCartesianChartView(this.Activity); LinearAxis verticalAxis = new LinearAxis(); //The values in the linear axis will not have values after the decimal point. verticalAxis.LabelFormat = "%.0f"; CategoricalAxis horizontalAxis = new CategoricalAxis(); chart.VerticalAxis = verticalAxis; chart.HorizontalAxis = horizontalAxis; for (int i = 0; i < 3; i++) { //Create the spline area series and attach axes and value bindings. SplineAreaSeries areaSeries = new SplineAreaSeries(); //We want to stack the different area series. areaSeries.CombineMode = ChartSeriesCombineMode.Stack; areaSeries.ValueBinding = new ValueBinding(); areaSeries.CategoryBinding = new CategoryBinding(); //Bind series to data areaSeries.Data = this.getData(); //Add series to chart chart.Series.Add(areaSeries); } return chart; }
private RadCartesianChartView createChart() { RadCartesianChartView chart = new RadCartesianChartView(this.Activity); BarSeries series = new BarSeries(); DateTimeContinuousAxis axis = new DateTimeContinuousAxis(); axis.LabelFormat = "MM/dd"; series.HorizontalAxis = axis; LinearAxis verticalAxis = new LinearAxis(); verticalAxis.LabelFormat = "%.0f"; series.VerticalAxis = verticalAxis; series.ValueBinding = new ValueBinding(); series.CategoryBinding = new CategoryBinding(); series.Data = this.getData(); chart.Series.Add(series); return(chart); }
private RadCartesianChartView createChart(){ RadCartesianChartView chart = new RadCartesianChartView(this.Activity); CategoricalAxis horizontalAxis = new CategoricalAxis(); chart.HorizontalAxis = horizontalAxis; LinearAxis vertical1 = new LinearAxis(); vertical1.LabelFormat = "%.0f"; LinearAxis vertical2 = new LinearAxis(); vertical2.LabelFormat = "%.0f"; BarSeries series1 = new BarSeries(); ArrayList data = this.getData(); series1.ValueBinding = new ValueBinding1(); series1.CategoryBinding = new CategoryBinding(); series1.VerticalAxis = vertical1; series1.Data = data; chart.Series.Add(series1); LineSeries series2 = new LineSeries(); series2.ValueBinding = new ValueBinding2(); series2.CategoryBinding = new CategoryBinding(); series2.VerticalAxis = (vertical2); vertical2.HorizontalLocation = AxisHorizontalLocation.Right; series2.Data = data; chart.Series.Add(series2); return chart; }
private RadCartesianChartView createChart() { //Create the Chart View RadCartesianChartView chart = new RadCartesianChartView(this.Activity); //Create the spline area series and attach axes and value bindings. SplineSeries splineSeries = new SplineSeries(); splineSeries.ValueBinding = new ValueBinding(); splineSeries.CategoryBinding = new CategoryBinding(); LinearAxis verticalAxis = new LinearAxis(); //The values in the linear axis will not have values after the decimal point. verticalAxis.LabelFormat = "%.0f"; CategoricalAxis horizontalAxis = new CategoricalAxis(); splineSeries.VerticalAxis = verticalAxis; splineSeries.HorizontalAxis = horizontalAxis; //Bind series to data splineSeries.Data = this.getData(); //Add series to chart chart.Series.Add(splineSeries); return(chart); }
private RadCartesianChartView createChart() { //Create the Chart View RadCartesianChartView chart = new RadCartesianChartView(this.Activity); LinearAxis verticalAxis = new LinearAxis(); //The values in the linear axis will not have values after the decimal point. verticalAxis.LabelFormat = "%.0f"; CategoricalAxis horizontalAxis = new CategoricalAxis(); chart.VerticalAxis = verticalAxis; chart.HorizontalAxis = horizontalAxis; for (int i = 0; i < 3; i++) { //Create the spline area series and attach axes and value bindings. SplineAreaSeries areaSeries = new SplineAreaSeries(); //We want to stack the different area series. areaSeries.CombineMode = ChartSeriesCombineMode.Stack; areaSeries.ValueBinding = new ValueBinding(); areaSeries.CategoryBinding = new CategoryBinding(); //Bind series to data areaSeries.Data = this.getData(); //Add series to chart chart.Series.Add(areaSeries); } return(chart); }
private RadCartesianChartView createChart(){ //Create the Chart View RadCartesianChartView chart = new RadCartesianChartView(this.Activity); //Create the bar series and attach axes and value bindings. BarSeries barSeries = new BarSeries(); barSeries.ValueBinding = new ValueBinding(); barSeries.CategoryBinding = new CategoryBinding(); LinearAxis verticalAxis = new LinearAxis(); //The values in the linear axis will not have values after the decimal point. verticalAxis.LabelFormat = "%.0f"; CategoricalAxis horizontalAxis = new CategoricalAxis(); horizontalAxis.LabelFitMode = AxisLabelFitMode.MultiLine; barSeries.VerticalAxis = verticalAxis; barSeries.HorizontalAxis = horizontalAxis; //Bind series to data barSeries.Data = this.getData(); //Add series to chart chart.Series.Add(barSeries); ChartSelectionBehavior sb = new ChartSelectionBehavior(); sb.DataPointsSelectionMode = ChartSelectionMode.Single; chart.Behaviors.Add(sb); return chart; }
private RadCartesianChartView createChart(){ //Create the Chart View RadCartesianChartView chart = new RadCartesianChartView(this.Activity); //Create the bar series and attach axes and value bindings. BarSeries barSeries = new BarSeries(); barSeries.ValueBinding = new ValueBinding(); barSeries.CategoryBinding = new CategoryBinding(); LinearAxis verticalAxis = new LinearAxis(); //The values in the linear axis will not have values after the decimal point. verticalAxis.LabelFormat = "%.0f"; CategoricalAxis horizontalAxis = new CategoricalAxis(); barSeries.VerticalAxis = verticalAxis; barSeries.HorizontalAxis = horizontalAxis; //Bind series to data barSeries.Data = this.getData(); //Add series to chart chart.Series.Add(barSeries); CartesianGridLineAnnotation annotation = new CartesianGridLineAnnotation(verticalAxis, 3); chart.Annotations.Add(annotation); annotation.LabelHorizontalAlignment = HorizontalAlignment.Left; annotation.StrokeColor = Color.Argb(255, 235, 100, 32); annotation.StrokeWidth = 4; annotation.ZIndex = 1001; annotation.Label = "This is Grid Line annotation"; return chart; }
private RadCartesianChartView createChart() { //Create the Chart View RadCartesianChartView chart = new RadCartesianChartView(this.Activity); //Create the bar series and attach axes and value bindings. BarSeries barSeries = new BarSeries(); barSeries.ValueBinding = new ValueBinding(); barSeries.CategoryBinding = new CategoryBinding(); LinearAxis verticalAxis = new LinearAxis(); //The values in the linear axis will not have values after the decimal point. verticalAxis.LabelFormat = "%.0f"; CategoricalAxis horizontalAxis = new CategoricalAxis(); barSeries.VerticalAxis = verticalAxis; barSeries.HorizontalAxis = horizontalAxis; //Bind series to data barSeries.Data = this.getData(); //Add series to chart chart.Series.Add(barSeries); CartesianPlotBandAnnotation annotation = new CartesianPlotBandAnnotation(verticalAxis, 6, 8); chart.Annotations.Add(annotation); annotation.FillColor = Color.Argb(150, 0, 148, 255); annotation.StrokeColor = Color.Argb(150, 0, 74, 127); annotation.StrokeColor = 4; annotation.ZIndex = 1001; return chart; }
private RadCartesianChartView createChart(){ //Create the Chart View RadCartesianChartView chart = new RadCartesianChartView(this.Activity); //Create the scatter bubble series and attach axes and value bindings. ScatterBubbleSeries scatterBubbleSeries = new ScatterBubbleSeries(); scatterBubbleSeries.BubbleScale = 1000; scatterBubbleSeries.XValueBinding = new XValueBinding(); scatterBubbleSeries.YValueBinding = new YValueBinding(); scatterBubbleSeries.BubbleSizeBinding = new AreaValueBinding(); LinearAxis verticalAxis = new LinearAxis(); //The values in the linear axis will not have values after the decimal point. verticalAxis.LabelFormat = "%.2f"; LinearAxis horizontalAxis = new LinearAxis(); horizontalAxis.LabelFormat = "%.2f"; scatterBubbleSeries.VerticalAxis = verticalAxis; scatterBubbleSeries.HorizontalAxis = horizontalAxis; //Bind series to data scatterBubbleSeries.Data = this.getData(); //Add series to chart chart.Series.Add(scatterBubbleSeries); return chart; }
private RadCartesianChartView createChart(){ //Create the Chart View RadCartesianChartView chart = new RadCartesianChartView(this.Activity); //Create the area series and attach axes and value bindings. AreaSeries areaSeries = new AreaSeries(); areaSeries.ValueBinding = new ValueBinding(); areaSeries.CategoryBinding = new CategoryBinding(); LinearAxis verticalAxis = new LinearAxis(); //The values in the linear axis will not have values after the decimal point. verticalAxis.LabelFormat = "%.0f"; CategoricalAxis horizontalAxis = new CategoricalAxis(); horizontalAxis.LabelInterval = 10; horizontalAxis.LabelFitMode = AxisLabelFitMode.MultiLine; areaSeries.VerticalAxis = verticalAxis; areaSeries.HorizontalAxis = horizontalAxis; //Bind series to data areaSeries.Data = this.getData(); //Add series to chart chart.Series.Add(areaSeries); ChartPanAndZoomBehavior pzBehavior = new ChartPanAndZoomBehavior(); pzBehavior.PanMode = ChartPanZoomMode.Both; pzBehavior.ZoomMode = ChartPanZoomMode.Both; chart.Behaviors.Add(pzBehavior); return chart; }
public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View rootView = inflater.Inflate(Resource.Layout.fragment_chart_legend_example, container, false); this.chartView = rootView.FindViewById(Resource.Id.chartView).JavaCast<RadCartesianChartView>(); this.legendView = rootView.FindViewById(Resource.Id.legendView).JavaCast<RadLegendView>(); this.prepareChart(); this.legendView.LegendProvider = this.chartView; return rootView; }
private RadCartesianChartView createChart() { RadCartesianChartView chart = new RadCartesianChartView(this.Activity); DateTimeCategoricalAxis horizontalAxis = new DateTimeCategoricalAxis(); horizontalAxis.DateTimeFormat = new SimpleDateFormat("MM/dd"); horizontalAxis.DateTimeComponent = DateTimeComponent.Date; LinearAxis verticalAxis = new LinearAxis(); DataPointBinding categoryBinding = new CategoryBinding(); DataPointBinding openBinding = new OpenValueBinding(); DataPointBinding highBinding = new HighValueBinding(); DataPointBinding lowBinding = new LowValueBinding(); DataPointBinding closeBinding = new CloseValueBinding(); ArrayList data = this.getData(); CandlestickSeries series = new CandlestickSeries(); series.CategoryBinding = categoryBinding; series.OpenBinding = openBinding; series.HighBinding = highBinding; series.LowBinding = lowBinding; series.CloseBinding = closeBinding; series.Data = data; BollingerBandsIndicator bollingerBands = new BollingerBandsIndicator(); bollingerBands.CategoryBinding = categoryBinding; bollingerBands.ValueBinding = closeBinding; bollingerBands.Period = 5; bollingerBands.StandardDeviations = 2; bollingerBands.Data = data; MovingAverageIndicator movingAverage = new MovingAverageIndicator(); movingAverage.CategoryBinding = categoryBinding; movingAverage.ValueBinding = closeBinding; movingAverage.Period = 5; movingAverage.Data = data; chart.VerticalAxis = verticalAxis; chart.HorizontalAxis = horizontalAxis; chart.Series.Add(series); chart.Series.Add(bollingerBands); chart.Series.Add(movingAverage); // irrelevant horizontalAxis.LabelFitMode = AxisLabelFitMode.Rotate; return(chart); }
public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View rootView = inflater.Inflate(Resource.Layout.fragment_chart_legend_example, container, false); this.chartView = rootView.FindViewById(Resource.Id.chartView).JavaCast <RadCartesianChartView>(); this.legendView = rootView.FindViewById(Resource.Id.legendView).JavaCast <RadLegendView>(); this.prepareChart(); this.legendView.LegendProvider = this.chartView; return(rootView); }
private RadCartesianChartView createChart() { RadCartesianChartView chart = new RadCartesianChartView(this.Activity); DateTimeCategoricalAxis horizontalAxis = new DateTimeCategoricalAxis(); horizontalAxis.SetDateTimeFormat(new SimpleDateFormat("MM/dd")); horizontalAxis.DateTimeComponent = DateTimeComponent.Date; LinearAxis verticalAxis = new LinearAxis(); DataPointBinding categoryBinding = new CategoryBinding(); DataPointBinding openBinding = new OpenValueBinding(); DataPointBinding highBinding = new HighValueBinding(); DataPointBinding lowBinding = new LowValueBinding(); DataPointBinding closeBinding = new CloseValueBinding(); ArrayList data = this.getData(); CandlestickSeries series = new CandlestickSeries(); series.CategoryBinding = categoryBinding; series.OpenBinding = openBinding; series.HighBinding = highBinding; series.LowBinding = lowBinding; series.CloseBinding = closeBinding; series.Data = data; BollingerBandsIndicator bollingerBands = new BollingerBandsIndicator(); bollingerBands.CategoryBinding = categoryBinding; bollingerBands.ValueBinding = closeBinding; bollingerBands.Period = 5; bollingerBands.StandardDeviations = 2; bollingerBands.Data = data; MovingAverageIndicator movingAverage = new MovingAverageIndicator(); movingAverage.CategoryBinding = categoryBinding; movingAverage.ValueBinding = closeBinding; movingAverage.Period = 5; movingAverage.Data = data; chart.VerticalAxis = verticalAxis; chart.HorizontalAxis = horizontalAxis; chart.Series.Add(series); chart.Series.Add(bollingerBands); chart.Series.Add(movingAverage); // irrelevant horizontalAxis.LabelFitMode = AxisLabelFitMode.Rotate; return chart; }
private void UpdateGradientBarRenderers() { TXFC.RadCartesianChart xfChart = (TXFC.RadCartesianChart) this.Element; RadCartesianChartView nativeChart = (RadCartesianChartView)this.Control; for (int i = 0; i < nativeChart.Series.Size(); i++) { BarSeries barSeries = nativeChart.Series.Get(i) as BarSeries; if (barSeries != null) { this.TrySetGradientBarRenderer(barSeries, xfChart.Series[i]); } } }
private void UpdatePointMarkRenderers() { TXFC.RadCartesianChart xfChart = (TXFC.RadCartesianChart) this.Element; RadCartesianChartView nativeChart = (RadCartesianChartView)this.Control; for (int i = 0; i < nativeChart.Series.Size(); i++) { LineSeries lineSeries = nativeChart.Series.Get(i) as LineSeries; if (lineSeries != null) { this.TrySetPointMarkRenderer(lineSeries, xfChart.Series[i]); } } }
private RadCartesianChartView createChart() { //Create the Chart View RadCartesianChartView chart = new RadCartesianChartView(this.Activity); LinearAxis verticalAxis = new LinearAxis(); //The values in the linear axis will not have values after the decimal point. verticalAxis.LabelFormat = "%.0f"; CategoricalAxis horizontalAxis = new CategoricalAxis(); chart.VerticalAxis = verticalAxis; chart.HorizontalAxis = horizontalAxis; for (int i = 0; i < 3; i++) { //Create the bar series and attach axes and value bindings. AreaSeries areaSeries = new AreaSeries(); //We want to stack the different area series. areaSeries.CombineMode = ChartSeriesCombineMode.Stack; areaSeries.ValueBinding = new ValueBinding(); areaSeries.CategoryBinding = new CategoryBinding(); //Bind series to data areaSeries.Data = this.getData(); //Add series to chart chart.Series.Add(areaSeries); } ChartPalette defaultPaletteClone = new ChartPalette(chart.Palette); // We acquire the palette entry containing the settings for the third series in the chart setup. PaletteEntry areaSeriesEntry = defaultPaletteClone.GetEntry(ChartPalette.AreaFamily, 2); //We set the fill color of the third series to be cyan. areaSeriesEntry.Fill = Color.Cyan; //We reset the chart palette by applying the new one. chart.Palette = defaultPaletteClone; return(chart); }
private RadCartesianChartView createChart() { //Create the Chart View RadCartesianChartView chart = new RadCartesianChartView(this.Activity); LinearAxis verticalAxis = new LinearAxis(); //The values in the linear axis will not have values after the decimal point. verticalAxis.LabelFormat = "%.0f"; CategoricalAxis horizontalAxis = new CategoricalAxis(); chart.VerticalAxis = verticalAxis; chart.HorizontalAxis = horizontalAxis; for (int i = 0; i < 3; i++) { //Create the bar series and attach axes and value bindings. AreaSeries areaSeries = new AreaSeries(); //We want to stack the different area series. areaSeries.CombineMode = ChartSeriesCombineMode.Stack; areaSeries.ValueBinding = new ValueBinding(); areaSeries.CategoryBinding = new CategoryBinding(); //Bind series to data areaSeries.Data = this.getData(); //Add series to chart chart.Series.Add(areaSeries); } ChartPalette defaultPaletteClone = new ChartPalette(chart.Palette); // We acquire the palette entry containing the settings for the third series in the chart setup. PaletteEntry areaSeriesEntry = defaultPaletteClone.GetEntry(ChartPalette.AreaFamily, 2); //We set the fill color of the third series to be cyan. areaSeriesEntry.Fill = Color.Cyan; //We reset the chart palette by applying the new one. chart.Palette = defaultPaletteClone; return chart; }
private RadCartesianChartView createChart() { //Create the Chart View RadCartesianChartView chart = new RadCartesianChartView(this.Activity); //Create the bar series and attach axes and value bindings. BarSeries barSeries = new BarSeries(); barSeries.ValueBinding = new ValueBinding(); barSeries.CategoryBinding = new CategoryBinding(); LinearAxis verticalAxis = new LinearAxis(); //The values in the linear axis will not have values after the decimal point. verticalAxis.LabelFormat = "%.0f"; CategoricalAxis horizontalAxis = new CategoricalAxis(); chart.VerticalAxis = verticalAxis; chart.HorizontalAxis = horizontalAxis; //Bind series to data barSeries.Data = this.getData(); //Add series to chart chart.Series.Add(barSeries); //Set an instance of the CartesianChartGrid to the chart. CartesianChartGrid grid = new CartesianChartGrid(); grid.MajorYLinesRenderMode = GridLineRenderMode.InnerAndLast; grid.LineThickness = 1; grid.LineColor = Color.White; grid.MajorLinesVisibility = GridLineVisibility.Y; grid.StripLinesVisibility = GridLineVisibility.Y; ObservableCollection yBrushes = grid.YStripeBrushes; yBrushes.Clear(); chart.Grid = grid; return(chart); }
private RadCartesianChartView createChart(){ RadCartesianChartView chart = new RadCartesianChartView(this.Activity); BarSeries series = new BarSeries(); DateTimeContinuousAxis axis = new DateTimeContinuousAxis(); axis.LabelFormat = "MM/dd"; series.HorizontalAxis = axis; LinearAxis verticalAxis = new LinearAxis(); verticalAxis.LabelFormat = "%.0f"; series.VerticalAxis = verticalAxis; series.ValueBinding = new ValueBinding(); series.CategoryBinding = new CategoryBinding(); series.Data = this.getData(); chart.Series.Add(series); return chart; }
private RadCartesianChartView createChart() { RadCartesianChartView chart = new RadCartesianChartView(this.Activity); CategoricalAxis horizontalAxis = new CategoricalAxis(); chart.HorizontalAxis = horizontalAxis; LinearAxis vertical1 = new LinearAxis(); vertical1.LabelFormat = "%.0f"; LinearAxis vertical2 = new LinearAxis(); vertical2.LabelFormat = "%.0f"; BarSeries series1 = new BarSeries(); ArrayList data = this.getData(); series1.ValueBinding = new ValueBinding1(); series1.CategoryBinding = new CategoryBinding(); series1.VerticalAxis = vertical1; series1.Data = data; chart.Series.Add(series1); LineSeries series2 = new LineSeries(); series2.ValueBinding = new ValueBinding2(); series2.CategoryBinding = new CategoryBinding(); series2.VerticalAxis = (vertical2); vertical2.HorizontalLocation = AxisHorizontalLocation.Right; series2.Data = data; chart.Series.Add(series2); return(chart); }
private RadCartesianChartView createChart() { //Create the Chart View RadCartesianChartView chart = new RadCartesianChartView(this.Activity); //Create the bar series and attach axes and value bindings. BarSeries barSeries = new BarSeries(); barSeries.ValueBinding = new ValueBinding(); barSeries.CategoryBinding = new CategoryBinding(); LinearAxis verticalAxis = new LinearAxis(); //The values in the linear axis will not have values after the decimal point. CategoricalAxis horizontalAxis = new CategoricalAxis(); horizontalAxis.LabelFormat = "%.0f"; barSeries.VerticalAxis = verticalAxis; barSeries.HorizontalAxis = horizontalAxis; //Bind series to data barSeries.Data = this.getData(); //Add series to chart chart.Series.Add(barSeries); //Set an instance of the CartesianChartGrid to the chart. CartesianChartGrid grid = new CartesianChartGrid(); grid.MajorYLinesRenderMode = GridLineRenderMode.InnerAndLast; grid.LineThickness = 1; grid.LineColor = Color.White; grid.MajorLinesVisibility = GridLineVisibility.Y; grid.StripLinesVisibility = GridLineVisibility.Y; ObservableCollection yBrushes = grid.YStripeBrushes; yBrushes.Clear(); chart.Grid = grid; return chart; }
private RadCartesianChartView createChart() { RadCartesianChartView chart = new RadCartesianChartView(this.Activity); // context is an instance of Context. OhlcSeries series = new OhlcSeries(); series.CategoryBinding = new CategoryBinding(); series.OpenBinding = new OpenValueBinding(); series.HighBinding = new HighValueBinding(); series.LowBinding = new LowValueBinding(); series.CloseBinding = new CloseValueBinding(); series.Data = this.getData(); chart.Series.Add(series); CategoricalAxis horizontalAxis = new CategoricalAxis(); chart.HorizontalAxis = horizontalAxis; LinearAxis verticalAxis = new LinearAxis(); chart.VerticalAxis = verticalAxis; return chart; }
private RadCartesianChartView createChart() { //Create the Chart View RadCartesianChartView chart = new RadCartesianChartView(this.Activity); //Create the bar series and attach axes and value bindings. BarSeries barSeries = new BarSeries(); barSeries.ValueBinding = new ValueBinding(); barSeries.CategoryBinding = new CategoryBinding(); LinearAxis verticalAxis = new LinearAxis(); //The values in the linear axis will not have values after the decimal point. verticalAxis.LabelFormat = "%.0f"; CategoricalAxis horizontalAxis = new CategoricalAxis(); barSeries.VerticalAxis = verticalAxis; barSeries.HorizontalAxis = horizontalAxis; //Bind series to data barSeries.Data = this.getData(); //Add series to chart chart.Series.Add(barSeries); CartesianPlotBandAnnotation annotation = new CartesianPlotBandAnnotation(verticalAxis, 6, 8); chart.Annotations.Add(annotation); annotation.FillColor = Color.Argb(150, 0, 148, 255); annotation.StrokeColor = Color.Argb(150, 0, 74, 127); annotation.StrokeColor = 4; annotation.ZIndex = 1001; return(chart); }
private RadCartesianChartView createChart() { //Create the Chart View RadCartesianChartView chart = new RadCartesianChartView(this.Activity); //Create the bar series and attach axes and value bindings. BarSeries barSeries = new BarSeries(); barSeries.ValueBinding = new ValueBinding(); barSeries.CategoryBinding = new CategoryBinding(); LinearAxis verticalAxis = new LinearAxis(); //The values in the linear axis will not have values after the decimal point. verticalAxis.LabelFormat = "%.0f"; CategoricalAxis horizontalAxis = new CategoricalAxis(); barSeries.VerticalAxis = verticalAxis; barSeries.HorizontalAxis = horizontalAxis; //Bind series to data barSeries.Data = this.getData(); //Add series to chart chart.Series.Add(barSeries); CartesianGridLineAnnotation annotation = new CartesianGridLineAnnotation(verticalAxis, 3); chart.Annotations.Add(annotation); annotation.LabelHorizontalAlignment = HorizontalAlignment.Left; annotation.StrokeColor = Color.Argb(255, 235, 100, 32); annotation.StrokeWidth = 4; annotation.ZIndex = 1001; annotation.Label = "This is Grid Line annotation"; return(chart); }
private RadCartesianChartView createChart() { //Create the Chart View RadCartesianChartView chart = new RadCartesianChartView(this.Activity); //Create the area series and attach axes and value bindings. AreaSeries areaSeries = new AreaSeries(); areaSeries.ValueBinding = new ValueBinding(); areaSeries.CategoryBinding = new CategoryBinding(); LinearAxis verticalAxis = new LinearAxis(); //The values in the linear axis will not have values after the decimal point. verticalAxis.LabelFormat = "%.0f"; CategoricalAxis horizontalAxis = new CategoricalAxis(); horizontalAxis.LabelInterval = 10; horizontalAxis.LabelFitMode = AxisLabelFitMode.MultiLine; areaSeries.VerticalAxis = verticalAxis; areaSeries.HorizontalAxis = horizontalAxis; //Bind series to data areaSeries.Data = this.getData(); //Add series to chart chart.Series.Add(areaSeries); ChartPanAndZoomBehavior pzBehavior = new ChartPanAndZoomBehavior(); pzBehavior.PanMode = ChartPanZoomMode.Both; pzBehavior.ZoomMode = ChartPanZoomMode.Both; chart.Behaviors.Add(pzBehavior); return(chart); }
private RadCartesianChartView createChart(){ //Create the Chart View RadCartesianChartView chart = new RadCartesianChartView(this.Activity); //Create the bar series and attach axes and value bindings. BarSeries barSeries = new BarSeries(); barSeries.ValueBinding = new ValueBinding(); barSeries.CategoryBinding = new CategoryBinding(); LinearAxis horizontalAxis = new LinearAxis(); //The values in the linear axis will not have values after the decimal point. horizontalAxis.LabelFormat = "%.0f"; CategoricalAxis verticalAxis = new CategoricalAxis(); barSeries.VerticalAxis = verticalAxis; barSeries.HorizontalAxis = horizontalAxis; //Bind series to data barSeries.Data = this.getData(); //Add series to chart chart.Series.Add(barSeries); return chart; }
private RadCartesianChartView createChart() { //Create the Chart View RadCartesianChartView chart = new RadCartesianChartView(this.Activity); //Create the bar series and attach axes and value bindings. BarSeries barSeries = new BarSeries(); barSeries.ValueBinding = new ValueBinding(); barSeries.CategoryBinding = new CategoryBinding(); LinearAxis verticalAxis = new LinearAxis(); //The values in the linear axis will not have values after the decimal point. verticalAxis.LabelFormat = "%.0f"; CategoricalAxis horizontalAxis = new CategoricalAxis(); horizontalAxis.LabelFitMode = AxisLabelFitMode.MultiLine; barSeries.VerticalAxis = verticalAxis; barSeries.HorizontalAxis = horizontalAxis; //Bind series to data barSeries.Data = this.getData(); //Add series to chart chart.Series.Add(barSeries); ChartSelectionBehavior sb = new ChartSelectionBehavior(); sb.DataPointsSelectionMode = ChartSelectionMode.Single; chart.Behaviors.Add(sb); return(chart); }
public MainPage() { InitializeComponent(); #if __IOS__ // UI FOR XAMARIN iOS native controls RootGrid.Padding = new Thickness(0, 20, 0, 0); var explanation1 = new UILabel { MinimumFontSize = 14f, Lines = 0, LineBreakMode = UILineBreakMode.WordWrap, Text = "This is the native iOS TKChart", }; HeaderGrid.Children.Add(explanation1); // Chart TKChart chart = new TKChart(); chart.AllowAnimations = true; chart.AutoresizingMask = UIViewAutoresizing.FlexibleWidth | UIViewAutoresizing.FlexibleHeight; // Sample Data Random r = new Random(); var list = Enumerable.Range(1, 12).Select(i => new TKChartDataPoint(new NSNumber(i), new NSNumber(r.Next() % 2000))).ToArray(); // Add Series TKChartLineSeries series = new TKChartLineSeries(list); series.Selection = TKChartSeriesSelection.Series; chart.AddSeries(series); BodyGrid.Children.Add(chart); #endif #if __ANDROID__ // UI FOR XAMARIN Android native controls HeaderGrid.Children.Add(new TextView(Forms.Context) { Text = "This is the native Android RadCartesianChartView", TextSize = 14 }); RadCartesianChartView chartView = new RadCartesianChartView(Forms.Context); chartView.HorizontalAxis = new CategoricalAxis(); chartView.VerticalAxis = new LinearAxis(); // Sample Data var monthResults = new Java.Util.ArrayList(); monthResults.Add(new MonthResult("Jan", 12)); monthResults.Add(new MonthResult("Feb", 5)); monthResults.Add(new MonthResult("Mar", 10)); monthResults.Add(new MonthResult("Apr", 7)); chartView.Series.Add(new LineSeries { CategoryBinding = new MonthResultDataBinding("Month"), ValueBinding = new MonthResultDataBinding("Result"), Data = monthResults }); BodyGrid.Children.Add(chartView); #endif #if WINDOWS_UWP // UI FOR XAMARIN UWP native controls var explanation1 = new TextBlock { Text = "The next control is a CustomControl (a customized TextBlock with a bad ArrangeOverride implementation).", FontSize = 14, FontFamily = new FontFamily("HelveticaNeue"), TextWrapping = TextWrapping.Wrap }; HeaderGrid.Children.Add(explanation1); // Set up chart var chartView = new RadCartesianChart(); chartView.HorizontalAxis = new CategoricalAxis(); chartView.VerticalAxis = new LinearAxis(); // sample data var monthResults = new List <MonthResult> { new MonthResult("Jan", 12), new MonthResult("Feb", 5), new MonthResult("Mar", 10), new MonthResult("Apr", 7) }; chartView.Series.Add(new LineSeries { CategoryBinding = new PropertyNameDataPointBinding("Month"), ValueBinding = new PropertyNameDataPointBinding("Result"), ItemsSource = monthResults }); // Add native chart to Visual Tree BodyGrid.Children.Add(chartView); #endif }