private void SetTrackBall() { ChartTrackballController trackBallElement = new ChartTrackballController(); trackBallElement.Element.TextAlignment = ContentAlignment.MiddleLeft; trackBallElement.Element.BorderColor = Color.Black; trackBallElement.Element.BackColor = Color.White; trackBallElement.Element.BorderGradientStyle = Telerik.WinControls.GradientStyles.Solid; trackBallElement.Element.GradientStyle = Telerik.WinControls.GradientStyles.Solid; trackBallElement.Element.Padding = new Padding(3, 0, 3, 3); this.radChartView2.Controllers.Add(trackBallElement); }
private void SetTrackBall() { ChartTrackballController trackBallElement = new ChartTrackballController(); //trackBallElement.Element.TextAlignment = ContentAlignment.MiddleCenter; //trackBallElement.Element.BorderColor = Color.Black; trackBallElement.Element.ForeColor = Color.Black; //trackBallElement.Element.BackColor = Color.White; trackBallElement.Element.BorderGradientStyle = Telerik.WinControls.GradientStyles.Solid; //trackBallElement.Element.GradientStyle = Telerik.WinControls.GradientStyles.Solid; trackBallElement.Element.Padding = new Padding(3, 0, 3, 3); trackBallElement.PointFormatString = "{0}:{1} USD"; trackBallElement.TextNeeded += new TextNeededEventHandler(trackBallElement_TextNeeded); this.radChartView1.Controllers.Add(trackBallElement); }
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; }
private void Initialize() { var panZoomController = new ChartPanZoomController { PanZoomMode = ChartPanZoomMode.Horizontal }; radChartView1.Controllers.Add(panZoomController); radChartView1.ShowPanZoom = true; ChartTrackballController controler = new ChartTrackballController(); controler.TextNeeded += controler_TextNeeded; radChartView1.Controllers.Add(controler); radChartView1.Controllers.Add(new ChartTooltipController()); radChartView1.ShowToolTip = false; radChartView1.Zoom(85, 1); radChartView1.Pan(1000, 0); radChartView1.ShowLegend = true; this.radChartView1.LegendTitle = "Legend"; this.radChartView1.ChartElement.LegendElement.TitleElement.Font = new Font("Arial", 16, FontStyle.Italic); //setup the Cartesian Grid var area = radChartView1.GetArea <CartesianArea>(); area.ShowGrid = true; CartesianGrid grid = area.GetGrid <CartesianGrid>(); grid.DrawHorizontalFills = true; grid.BorderDashStyle = System.Drawing.Drawing2D.DashStyle.Solid; grid.ForeColor = Color.LightGray; grid.DrawHorizontalFills = true; grid.DrawVerticalFills = true; grid.AlternatingVerticalColor = true; grid.AlternatingHorizontalColor = true; grid.AlternatingBackColor = Color.White; grid.AlternatingBackColor2 = Color.White; }