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() { 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 BaseChart() { Background = new SolidColorBrush(Colors.White); VerticalAxis = new LinearAxis(); HorizontalAxis = new CategoricalAxis { SmartLabelsMode = AxisSmartLabelsMode.SmartStep, LabelFitMode = AxisLabelFitMode.Rotate, LabelRotationAngle = 270 }; ChartTrackBallBehavior chartTrackBallBehavior = new ChartTrackBallBehavior { ShowIntersectionPoints = true, ShowTrackInfo = true, }; //System.Windows.Point position = chartTrackBallBehavior.Position; //position.X = (23); //position.Y = (45); //chartTrackBallBehavior.Position = position; ChartPanAndZoomBehavior panAndZoomBehavior = new ChartPanAndZoomBehavior { ZoomMode = ChartPanZoomMode.Both, PanMode = ChartPanZoomMode.Both }; Behaviors.Add(panAndZoomBehavior); Behaviors.Add(chartTrackBallBehavior); }
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 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); }
//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 PartitionScore SplitOnAxis(CategoricalAxis axis, List <Episode> episodes, double[] totalWeights) { // Calculate categories Dictionary <Enum, HashSet <Episode> > episodesByCategory = episodes .AsParallel() .Select(episode => EvaluateCategories(axis, episode)) .SelectMany(x => x.Categories.Select(category => new { Category = category, Episode = x.Episode, })) .GroupBy(g => g.Category) .ToDictionary(g => g.Key, g => new HashSet <Episode>(g.Select(x => x.Episode))); List <PartitionScore> partitions = new List <PartitionScore>(); HashSet <Episode> leftEpisodes = new HashSet <Episode>(episodes); List <Episode> rightEpisodes = new List <Episode>(); HashSet <Enum> rightCategories = new HashSet <Enum>(); double[] rightWeights = new double[TacticEntropy.NumTactics]; while (leftEpisodes.Count > 0) { List <AdditionalCategory> additionalCategories = episodesByCategory .AsParallel() .Select(kvp => EvaluateAdditionalCategory(kvp.Key, kvp.Value, totalWeights, rightWeights)) .ToList(); AdditionalCategory bestAdditionalCategory = additionalCategories.MinByOrDefault(x => x.Entropy); if (bestAdditionalCategory == null) { // Everything left belongs to no categories - nothing to move break; } // Update left and right rightCategories.Add(bestAdditionalCategory.Category); leftEpisodes.ExceptWith(bestAdditionalCategory.AdditionalEpisodes); rightEpisodes.AddRange(bestAdditionalCategory.AdditionalEpisodes); rightWeights = bestAdditionalCategory.NewRightWeights; // Create snapshot of partition partitions.Add(new PartitionScore { Partitioner = new CategoricalPartitioner(axis, rightCategories.ToArray()), LeftEpisodes = leftEpisodes.ToList(), RightEpisodes = rightEpisodes.ToList(), Entropy = bestAdditionalCategory.Entropy, }); // Remove additional episodes from other categories so we don't re-add them episodesByCategory.Remove(bestAdditionalCategory.Category); foreach (HashSet <Episode> otherEpisodes in episodesByCategory.Values) { otherEpisodes.ExceptWith(bestAdditionalCategory.AdditionalEpisodes); } } return(partitions.MinByOrDefault(p => p.Entropy)); }
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); 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. 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); 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); 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 void GenerateSeries(string seriesType) { CategoricalAxis horizontalAxis = new CategoricalAxis(); LinearAxis verticalAxis = new LinearAxis(); verticalAxis.AxisType = AxisType.Second; for (int i = 0; i < 2; i++) { CartesianSeries series; if (seriesType == "Area") { series = new AreaSeries(); } else { series = new LineSeries(); } series.PointSize = new SizeF(5, 5); series.HorizontalAxis = horizontalAxis; series.VerticalAxis = verticalAxis; series.BorderWidth = 2; series.CategoryMember = "Month"; series.ValueMember = "Revenue"; series.DataSource = i == 0 ? collection1 : collection2; series.ShowLabels = showLabels; series.CombineMode = selectedCombineMode; this.radChartView1.Series.Add(series); } }
protected override void OnLoad(EventArgs e) { base.OnLoad(e); CartesianArea area = this.radChartView1.GetArea <CartesianArea>(); area.ShowGrid = true; this.radDropDownList1.SelectedIndex = 0; LinearAxis verticalAcix = new LinearAxis(); verticalAcix.AxisType = AxisType.Second; CategoricalAxis horizontalAxis = new CategoricalAxis(); PerformanceModel model = new PerformanceModel(); for (int i = 0; i < 4; i++) { BarSeries barSeries = new BarSeries("Performance", "RepresentativeName"); barSeries.Name = "Q" + (i + 1); barSeries.HorizontalAxis = horizontalAxis; barSeries.VerticalAxis = verticalAcix; barSeries.DataSource = model.GetData(i); this.radChartView1.Series.Add(barSeries); foreach (DataPointElement pointElement in barSeries.Children) { pointElement.BorderWidth = 0; } } Theme theme = Theme.ReadCSSText(@" theme { name: ControlDefault; elementType: Telerik.WinControls.UI.RadChartElement; controlType: Telerik.WinControls.UI.RadChartView; } Bar { HeightAspectRatio { Value: 0.9; EndValue: 1; MaxValue: 1; Frames: 30; Interval: 20; EasingType: InOutCubic; RandomDelay: 200; RemoveAfterApply: true; } } "); ThemeRepository.Add(theme, false); }
private void SetupAxes() { LinearAxis verticalAxis = new LinearAxis(); verticalAxis.AxisType = AxisType.Second; CategoricalAxis horizontalAxis = new CategoricalAxis(); horizontalAxis.LabelFitMode = AxisLabelFitMode.MultiLine; this.radChartView1.Area.Axes.Add(horizontalAxis); this.radChartView1.Area.Axes.Add(verticalAxis); }
private CategorisedEpisode EvaluateCategories(CategoricalAxis axis, Episode episode) { var key = Tuple.Create(episode, axis); Enum[] categories; if (!_evaluateCache.TryGetValue(key, out categories)) { categories = CategoricalAxisEvaluator.Evaluate(axis, episode.World, episode.Hero).ToArray(); _evaluateCache[key] = categories; } return(new CategorisedEpisode { Episode = episode, Categories = categories, }); }
private void InitializeChart2() { CartesianArea area = this.radChartView2.GetArea <CartesianArea>(); CartesianGrid grid = area.GetGrid <CartesianGrid>(); grid.ForeColor = Color.FromArgb(235, 235, 235); grid.DrawVerticalStripes = false; grid.DrawHorizontalStripes = true; grid.DrawHorizontalFills = false; grid.DrawVerticalFills = false; area.ShowGrid = true; ChartTrackballController trackball = new ChartTrackballController(); trackball.IsFixedSize = true; trackball.FixedSize = new System.Drawing.Size(150, 30); trackball.TextNeeded += new TextNeededEventHandler(trackball_TextNeeded); this.radChartView2.Controllers.Add(trackball); AreaSeries areaSeries = new AreaSeries(); areaSeries.Spline = false; areaSeries.CategoryMember = "Category"; areaSeries.ValueMember = "Value"; areaSeries.DataSource = model.Data2; areaSeries.PointSize = new SizeF(0, 0); areaSeries.BorderColor = Color.FromArgb(142, 196, 65); areaSeries.BackColor = Color.FromArgb(150, Color.FromArgb(142, 196, 65)); this.radChartView2.Series.Add(areaSeries); this.radChartView2.ChartElement.TitlePosition = TitlePosition.Top; this.radChartView2.ChartElement.TitleElement.TextAlignment = ContentAlignment.MiddleLeft; this.radChartView2.ChartElement.TitleElement.Margin = new Padding(10, 10, 0, 0); this.radChartView2.ChartElement.TitleElement.Font = font; this.radChartView2.View.Margin = new Padding(10, 0, 0, 10); LinearAxis axeY = radChartView2.Axes.Get <LinearAxis>(1); axeY.Minimum = 3000; axeY.Maximum = 4200; CategoricalAxis axeX = radChartView2.Axes.Get <CategoricalAxis>(0); axeX.LabelInterval = 2; axeX.LabelFormat = "{0:HH}"; axeX.LastLabelVisibility = Charting.AxisLastLabelVisibility.Visible; }
public static List <Enum> BitsToCategories(CategoricalAxis axis, uint categoryBits) { List <Enum> categories = new List <Enum>(); int index = 0; while (categoryBits > 0) { if ((categoryBits & 1) != 0) { categories.Add(CategoricalAxisValue(axis, index)); } categoryBits >>= 1; ++index; } return(categories); }
void UpdateAxesPlotMode() { CategoricalAxis axis = this.radChartView1.Axes[0] as CategoricalAxis; if (axis != null) { if (this.radPivotGrid1.ChartDataProvider.GeneratedSeriesType == GeneratedSeriesType.Bar) { axis.PlotMode = Charting.AxisPlotMode.BetweenTicks; } else { axis.PlotMode = Charting.AxisPlotMode.OnTicksPadded; } } }
private void prepareChart() { CategoricalAxis horizontalAxis = new CategoricalAxis(); this.chartView.HorizontalAxis = horizontalAxis; LinearAxis verticalAxis = new LinearAxis(); verticalAxis.LabelFormat = "%.0f"; this.chartView.VerticalAxis = verticalAxis; for (int i = 0; i < 5; i++){ BarSeries series = new BarSeries(); series.LegendTitle = "Series " + (i + 1); series.CategoryBinding = new CategoryBinding(); series.ValueBinding = new ValueBinding(); series.Data = this.getData(); this.chartView.Series.Add(series); } }
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); }
//=======================================Functions========================================// private void InitializeChart() { TempHumChart.ShowTrackBall = true; TempHumChart.Area.View.Palette = KnownPalette.Autumn; CategoricalAxis categoricalAxis = TempHumChart.Axes[0] as CategoricalAxis; categoricalAxis.PlotMode = AxisPlotMode.OnTicksPadded; categoricalAxis.LabelFitMode = AxisLabelFitMode.Rotate; categoricalAxis.LabelRotationAngle = 310; LinearAxis verticalAxis = TempHumChart.Axes[1] as LinearAxis; verticalAxis.MajorStep = 1; verticalAxis.Maximum = 30; verticalAxis.Minimum = 20; verticalAxis.LabelInterval = 2; }
private void radChartView1_Initialized(object sender, EventArgs e) { CartesianArea area = this.radChartView1.GetArea <CartesianArea>(); CartesianGrid grid = area.GetGrid <CartesianGrid>(); grid.ForeColor = Color.FromArgb(235, 235, 235); grid.DrawVerticalStripes = false; grid.DrawHorizontalStripes = true; grid.DrawHorizontalFills = false; grid.DrawVerticalFills = false; area.ShowGrid = true; LineSeries lineSeries; lineSeries = new LineSeries(); lineSeries.BorderColor = Color.FromArgb(142, 196, 65); lineSeries.PointSize = new SizeF(0, 0); lineSeries.CategoryMember = "Category"; lineSeries.ValueMember = "Value"; lineSeries.DataSource = m_MainClass.m_LiveDataModel.Data; lineSeries.BorderWidth = 2; this.radChartView1.Series.Add(lineSeries); this.radChartView1.ChartElement.TitlePosition = TitlePosition.Top; this.radChartView1.ChartElement.TitleElement.TextAlignment = ContentAlignment.MiddleLeft; this.radChartView1.ChartElement.TitleElement.Margin = new Padding(10, 10, 0, 0); this.radChartView1.View.Margin = new Padding(10, 0, 35, 0); LinearAxis axeY = radChartView1.Axes.Get <LinearAxis>(1); axeY.Minimum = 0; axeY.Maximum = 300; axeY.MajorStep = 30; CategoricalAxis axeX = radChartView1.Axes.Get <CategoricalAxis>(0); axeX.ClipLabels = false; axeX.LabelInterval = 50; axeX.LabelFormat = "{0:HH:mm:ss.f}"; }
private void InitializeChartHeartRate() { CartesianArea area = this.radChartViewHeartRate.GetArea <CartesianArea>(); CartesianGrid grid = area.GetGrid <CartesianGrid>(); grid.ForeColor = Color.FromArgb(235, 235, 235); grid.DrawVerticalStripes = false; grid.DrawHorizontalStripes = true; grid.DrawHorizontalFills = false; grid.DrawVerticalFills = false; area.ShowGrid = true; LineSeries lineSeries = new LineSeries(); lineSeries.PointSize = new SizeF(0, 0); lineSeries.CategoryMember = "Time"; lineSeries.ValueMember = "Value"; lineSeries.DataSource = model.HeartRate; lineSeries.BorderColor = Color.FromArgb(142, 196, 65); lineSeries.BorderWidth = 2; this.radChartViewHeartRate.Series.Add(lineSeries); this.radChartViewHeartRate.ChartElement.TitlePosition = TitlePosition.Top; this.radChartViewHeartRate.Title = "Heart Rate"; this.radChartViewHeartRate.ChartElement.ShowTitle = true; this.radChartViewHeartRate.ChartElement.TitleElement.TextAlignment = ContentAlignment.MiddleLeft; this.radChartViewHeartRate.ChartElement.TitleElement.Margin = new Padding(10, 0, 0, 0); this.radChartViewHeartRate.ChartElement.TitleElement.Font = font; this.radChartViewHeartRate.View.Margin = new Padding(10, 0, 10, 0); LinearAxis axeY = radChartViewHeartRate.Axes.Get <LinearAxis>(1); axeY.Minimum = 100; axeY.Maximum = 180; //axeY.MajorStep = 1; CategoricalAxis axeX = radChartViewHeartRate.Axes.Get <CategoricalAxis>(0); axeX.LabelInterval = 5; axeX.LabelFormat = "{0:HH:mm:ss}"; axeX.LastLabelVisibility = Telerik.Charting.AxisLastLabelVisibility.Visible; }
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 void loadReligionList() { List <string> aReligion = new List <string>(); int iCntReligionMale = 0; int iCntReligionFemale = 0; foreach (StudentEnrollment se in stEnrolled) { if (!aReligion.Contains(se.student.Religion)) { aReligion.Add(se.student.Religion); } } LineSeries series = new LineSeries(); LineSeries series2 = new LineSeries(); foreach (String religion in aReligion) { iCntReligionMale = stEnrolled.FindAll(x => x.student.Religion == religion && x.student.Gender == "M").Count; series.DataPoints.Add(new CategoricalDataPoint(iCntReligionMale, religion)); iCntReligionFemale = stEnrolled.FindAll(x => x.student.Religion == religion && x.student.Gender == "F").Count; series2.DataPoints.Add(new CategoricalDataPoint(iCntReligionFemale, religion)); } this.radChartView1.Series.Add(series); this.radChartView1.Series.Add(series2); CategoricalAxis categoricalAxis = radChartView1.Axes[0] as CategoricalAxis; categoricalAxis.PlotMode = AxisPlotMode.OnTicksPadded; categoricalAxis.LabelFitMode = AxisLabelFitMode.Rotate; categoricalAxis.LabelRotationAngle = 310; this.radChartView1.ShowLegend = true; this.radChartView1.LegendTitle = "Legend"; this.radChartView1.ChartElement.LegendPosition = LegendPosition.Right; this.radChartView1.ChartElement.LegendElement.Items[0].Title = "Male"; this.radChartView1.ChartElement.LegendElement.Items[1].Title = "Female"; }
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 static Enum CategoricalAxisValue(CategoricalAxis axis, int index) { switch (axis) { case CategoricalAxis.MyHero: case CategoricalAxis.MyHeroes: case CategoricalAxis.EnemyHeroes: return((HeroType)index); case CategoricalAxis.MySpells: case CategoricalAxis.AllySpells: case CategoricalAxis.EnemySpells: return((ActionType)index); case CategoricalAxis.IsVisible: return((CategoricalBoolean)index); default: throw new ArgumentException("Cannot convert axis value from integer: " + axis); } }
private void loadGradeLevelList() { List <GradeLevel> sortedGL = new List <GradeLevel>(); List <GradeLevel> gradeLevel = new List <GradeLevel>(regService.GetAllGradeLevel()); gradeLevel.RemoveAll(x => x.GradeLev == "0"); int iCntGradeLevelMale = 0; int iCntGradeLevelFemale = 0; LineSeries series = new LineSeries(); LineSeries series2 = new LineSeries(); foreach (GradeLevel gl in gradeLevel) { iCntGradeLevelMale = stEnrolled.FindAll(x => x.student.GradeLevel == gl.GradeLev && x.student.Gender == "M").Count; series.DataPoints.Add(new CategoricalDataPoint(iCntGradeLevelMale, gl.Description)); //(series.HorizontalAxis as CategoricalAxis).GapLength = 0.75; iCntGradeLevelFemale = stEnrolled.FindAll(x => x.student.GradeLevel == gl.GradeLev && x.student.Gender == "F").Count; series2.DataPoints.Add(new CategoricalDataPoint(iCntGradeLevelFemale, gl.Description)); } this.radChartView1.Series.Add(series); this.radChartView1.Series.Add(series2); CategoricalAxis categoricalAxis = radChartView1.Axes[0] as CategoricalAxis; categoricalAxis.PlotMode = AxisPlotMode.OnTicksPadded; categoricalAxis.LabelFitMode = AxisLabelFitMode.Rotate; categoricalAxis.LabelRotationAngle = 310; this.radChartView1.ShowLegend = true; this.radChartView1.LegendTitle = "Legend"; this.radChartView1.ChartElement.LegendPosition = LegendPosition.Right; this.radChartView1.ChartElement.LegendElement.Items[0].Title = "Male"; this.radChartView1.ChartElement.LegendElement.Items[1].Title = "Female"; }
private void prepareChart() { CategoricalAxis horizontalAxis = new CategoricalAxis(); this.chartView.HorizontalAxis = horizontalAxis; LinearAxis verticalAxis = new LinearAxis(); verticalAxis.LabelFormat = "%.0f"; this.chartView.VerticalAxis = verticalAxis; for (int i = 0; i < 5; i++) { BarSeries series = new BarSeries(); series.LegendTitle = "Series " + (i + 1); series.CategoryBinding = new CategoryBinding(); series.ValueBinding = new ValueBinding(); series.Data = this.getData(); this.chartView.Series.Add(series); } }
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 void loadGenderList() { int iCntMale = 0; int iCntFemale = 0; LineSeries series = new LineSeries(); iCntMale = stEnrolled.FindAll(x => x.student.Gender == "M").Count; series.DataPoints.Add(new CategoricalDataPoint(iCntMale, "Male")); iCntFemale = stEnrolled.FindAll(x => x.student.Gender == "F").Count; series.DataPoints.Add(new CategoricalDataPoint(iCntFemale, "Female")); this.radChartView1.Series.Add(series); CategoricalAxis categoricalAxis = radChartView1.Axes[0] as CategoricalAxis; categoricalAxis.PlotMode = AxisPlotMode.OnTicksPadded; categoricalAxis.LabelFitMode = AxisLabelFitMode.Rotate; categoricalAxis.LabelRotationAngle = 310; }
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 void loadGradeSectionList() { this.radChartView1.Series.Clear(); List <GradeSection> gs = new List <GradeSection>(regService.GetAllGradeSection(cmbGradeLevel.SelectedValue.ToString())); int iCntGradeSectionMale = 0; int iCntGradeSectionFemale = 0; string gradelevel = cmbGradeLevel.SelectedValue.ToString(); LineSeries series = new LineSeries(); LineSeries series2 = new LineSeries(); foreach (GradeSection section in gs) { iCntGradeSectionMale = stEnrolled.FindAll(x => x.GradeLevel == gradelevel && x.GradeSectionCode == section.GradeSectionCode && x.student.Gender == "M").Count; series.DataPoints.Add(new CategoricalDataPoint(iCntGradeSectionMale, section.Section)); iCntGradeSectionFemale = stEnrolled.FindAll(x => x.GradeLevel == gradelevel && x.GradeSectionCode == section.GradeSectionCode && x.student.Gender == "F").Count; series2.DataPoints.Add(new CategoricalDataPoint(iCntGradeSectionFemale, section.Section)); } this.radChartView1.Series.Add(series); this.radChartView1.Series.Add(series2); CategoricalAxis categoricalAxis = radChartView1.Axes[0] as CategoricalAxis; categoricalAxis.PlotMode = AxisPlotMode.OnTicksPadded; categoricalAxis.LabelFitMode = AxisLabelFitMode.Rotate; categoricalAxis.LabelRotationAngle = 310; this.radChartView1.ShowLegend = true; this.radChartView1.LegendTitle = "Legend"; this.radChartView1.ChartElement.LegendPosition = LegendPosition.Right; this.radChartView1.ChartElement.LegendElement.Items[0].Title = "Male"; this.radChartView1.ChartElement.LegendElement.Items[1].Title = "Female"; }
private void PoissonDistributionViewForm_Load(object sender, EventArgs e) { if (DesignMode) { return; } _barSeries = new BarSeries(); poisson_ChartView.Series.Add(_barSeries); CategoricalAxis xAxis = poisson_ChartView.Axes[0] as CategoricalAxis; xAxis.PlotMode = AxisPlotMode.OnTicksPadded; xAxis.LabelFitMode = AxisLabelFitMode.Rotate; xAxis.LabelRotationAngle = 310; xAxis.LabelOffset = 0; LinearAxis yAxis = poisson_ChartView.Axes[1] as LinearAxis; yAxis.Title = "Threads"; Display(); }
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 CartesianAxis GetAxis() { if (Axis is DateTimeCategoricalAxis) { var axis = (DateTimeCategoricalAxis)Axis; var axisCopy = new DateTimeCategoricalAxis { LabelFormat = axis.LabelFormat, MajorTickStyle = axis.MajorTickStyle, ShowLabels = axis.ShowLabels, ElementBrush = axis.ElementBrush, FontSize = axis.FontSize, FontWeight = axis.FontWeight }; return(axisCopy); } if (Axis is CategoricalAxis) { var axis = (CategoricalAxis)Axis; var axisCopy = new CategoricalAxis { MajorTickStyle = axis.MajorTickStyle, ShowLabels = axis.ShowLabels, ElementBrush = axis.ElementBrush, FontSize = axis.FontSize, FontWeight = axis.FontWeight }; return(axisCopy); } return(Axis); }
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; }