Use attached to reproduce (comment the custom strategy). Workaround: in the attched project.
To reproduce: run the attached sample project and you will notice that the data points are not properly aligned. Workaround: use equal number of data points for the series.
How to reproduce: the issue can be observed when opening a form with a RadChartView which is not visible located in RadScrollablePanel. The panel will scroll to the chart which is not desired Workaround: public partial class RadForm1 : Telerik.WinControls.UI.RadForm { public RadForm1() { InitializeComponent(); this.radScrollablePanel1.AllowAutomaticScrollToControl = false; } protected override void OnVisibleChanged(EventArgs e) { base.OnVisibleChanged(e); this.radScrollablePanel1.HorizontalScrollbar.Value = 0;; } }
How to reproduce: Check the attached project Workaround: Create a separate custom MACD indicator and add it to the chart, uncomment the commented code in the attached project Friend Class MacdCustomIndicator Inherits MacdIndicator Private customBorderColor As Color Public Property BorderColor() As Color Get Return customBorderColor End Get Set(ByVal value As Color) customBorderColor = value Me.ChildIndicator.BorderColor = value End Set End Property Sub New() Dim customMacdInnerIndicator = New CustomMacdInnerIndicator(Me) Me.GetType().BaseType.GetField("childIndicator", BindingFlags.Instance Or BindingFlags.NonPublic).SetValue(Me, customMacdInnerIndicator) End Sub End Class Friend Class CustomMacdInnerIndicator Inherits MacdInnerIndicator Public Sub New(owner As MacdIndicator) MyBase.New(owner) End Sub Public Overrides Function GetProcessedValue(currentIndex As Integer) As Double Dim macd As Double = Me.CalculateMacdValue(currentIndex, LongPeriod, ShortPeriod) Me.Cache(macdValues).Add(currentIndex, macd) Return macd End Function End Class
To reproduce: - The total amount should go bellow 0 with the last point: var ws = new WaterfallSeries(); ws.ShowLabels = true; ws.DataPoints.Add(new Telerik.Charting.WaterfallDataPoint(10.0, false, false)); ws.DataPoints.Add(new Telerik.Charting.WaterfallDataPoint(2.0, false, false)); ws.DataPoints.Add(new Telerik.Charting.WaterfallDataPoint(3.0, false, false)); ws.DataPoints.Add(new Telerik.Charting.WaterfallDataPoint(-20.0, false, false)); radChartView1.Series.Add(ws); Workaround: Set the minimum: var verticalAxis = radChartView1.Axes[1] as LinearAxis; verticalAxis.Minimum = -10;
To reproduce: please refer to the attached sample project and gif file. Workaround: CustomLassoSelectionController lassoSelectionController = new CustomLassoSelectionController(); this.radChartView1.Controllers.Add(lassoSelectionController); public class CustomLassoSelectionController : LassoSelectionController { private IList<DataPoint> selectedPoints = null; public CustomLassoSelectionController() { this.selectedPoints = new List<DataPoint>(); } private Point ClipLocation(Point point) { CartesianArea area = this.Area.View.GetArea<CartesianArea>(); if (area != null) { RectangleF clipRect = GetCartesianClipRect(area); if (point.X < clipRect.X) { point = new Point((int)clipRect.X, point.Y); } if (point.X > clipRect.Width + clipRect.X) { point = new Point((int)clipRect.Width + (int)clipRect.X, point.Y); } if (point.Y < clipRect.Y) { point = new Point(point.X, (int)clipRect.Y); } if (point.Y > clipRect.Height + clipRect.Y) { point = new Point(point.X, (int)clipRect.Height + (int)clipRect.Y); } } return point; } internal RectangleF GetCartesianClipRect(CartesianArea area) { float x1, x2, y1, y2; x1 = 0; y1 = 0; x2 = (float)area.View.Viewport.Right; y2 = (float)area.View.Viewport.Bottom; foreach (var axis in area.View.Axes) { if (axis.AxisType == AxisType.First) { if (axis.Model.VerticalLocation == AxisVerticalLocation.Bottom) { y2 = Math.Min(y2, (float)axis.Model.LayoutSlot.Y); } else { y1 = Math.Max(y1, (float)axis.Model.LayoutSlot.Bottom); } x1 = Math.Min(x1, (float)axis.Model.LayoutSlot.X); x2 = Math.Min(x2, (float)axis.Model.LayoutSlot.Right); } else { if (axis.Model.HorizontalLocation == AxisHorizontalLocation.Left) { x1 = Math.Max(x1, (float)axis.Model.LayoutSlot.Right); } else { x2 = Math.Min(x2, (float)axis.Model.LayoutSlot.X); } y1 = Math.Max(y1, (float)axis.Model.LayoutSlot.Y); y2 = Math.Min(y2, (float)axis.Model.LayoutSlot.Bottom); } } RectangleF result = new RectangleF((float)area.View.Viewport.X + x1, (float)area.View.Viewport.Y + y1, x2 - x1 + 1, y2 - y1 + 1); return result; } protected override ActionResult OnMouseUp(MouseEventArgs e) { if (e.Button != MouseButtons.Left || this.MouseDownLocation == Point.Empty || this.MouseMoveLocation == Point.Empty) { return base.OnMouseUp(e); } if (MouseDownLocation != MouseMoveLocation) { this.MouseMoveLocation = ClipLocation(e.Location); CartesianArea area = this.Area.View.GetArea<CartesianArea>(); if (area != null) { this.selectedPoints.Clear(); RectangleF areaRect = RectangleF.Empty; IChartView chartView = this.Area.View; areaRect = GetCartesianClipRect(area); Point topLeft = new Point(Math.Min(MouseDownLocation.X, e.X), Math.Min(MouseDownLocation.Y, e.Y)); Point lowerRight = new Point(Math.Max(MouseDownLocation.X, e.X), Math.Max(MouseDownLocation.Y, e.Y)); RectangleF lassoRect = new RectangleF(new PointF(topLeft.X - (float)chartView.PlotOriginX - area.View.Margin.Left, topLeft.Y - (float)chartView.PlotOriginY - area.View.Margin.Top), new SizeF(lowerRight.X - topLeft.X, lowerRight.Y - topLeft.Y)); foreach (var series in area.View.Series) { foreach (var dataPoint in series.DataPoints) { if (lassoRect.Contains(new PointF((float)dataPoint.LayoutSlot.Location.X, (float)dataPoint.LayoutSlot.Location.Y))) { dataPoint.IsSelected = true; this.selectedPoints.Add(dataPoint); } else { dataPoint.IsSelected = false; } } } ChartDataPointsEventArgs changedArgs = new ChartDataPointsEventArgs(this.selectedPoints); this.OnLassoSelectedPointsChanged(changedArgs); } MouseDownLocation = MouseMoveLocation = Point.Empty; } this.Result.ShouldInvalidate = true; return this.Result; } }
To reproduce: - Add a polar chart with a selection controller. - Click near the bottom right corner of the point (10 pixels away) - The point is selected. Workaround: private void Chart_CreateRenderer(object sender, ChartViewCreateRendererEventArgs e) { e.Renderer = new MyPolarRenderer(e.Area as PolarArea); } class MyPolarRenderer : PolarRenderer { public MyPolarRenderer(PolarArea area) : base(area) { } protected override void Initialize() { base.Initialize(); for (int i = 0; i < this.DrawParts.Count; i++) { PolarPointSeriesDrawPart linePart = this.DrawParts[i] as PolarPointSeriesDrawPart; if (linePart != null) { this.DrawParts[i] = new MyDrawpart((PolarPointSeries)linePart.Element, this); } } } } class MyDrawpart : PolarPointSeriesDrawPart { public MyDrawpart(PolarPointSeries series, IChartRenderer renderer) : base(series, renderer) { } public override DataPoint HitTest(Point location) { if (this.Element.PointSize.Width == 0 || this.Element.PointSize.Height == 0) { return null; } for (int i = 0; i < this.Element.DataPoints.Count; i++) { RadRect slot = this.Element.DataPoints[i].LayoutSlot; float pointHalfWidth = this.Element.PointSize.Width / 2; float pointHalfHeight = this.Element.PointSize.Height / 2; RectangleF dataPointBounds = new RectangleF((float)(slot.X - pointHalfWidth), (float)(slot.Y - pointHalfHeight), this.Element.PointSize.Width, this.Element.PointSize.Height); if (dataPointBounds.Contains(location.X, location.Y)) { return this.Element.DataPoints[i]; } } return null; } }
Use attached to reproduce. Workaround: private void radChartView1_CreateRenderer(object sender, ChartViewCreateRendererEventArgs e) { e.Renderer = new CustomCartesianRenderer(e.Area as CartesianArea); } public class CustomCartesianRenderer : CartesianRenderer { public CustomCartesianRenderer(CartesianArea area) : base(area) { } protected override void Initialize() { base.Initialize(); for (int i = 0; i < this.DrawParts.Count; i++) { LineSeriesDrawPart linePart = this.DrawParts[i] as LineSeriesDrawPart; if (linePart != null) { this.DrawParts[i] = new CustomLineSeriesDrawPart((LineSeries)linePart.Element, this); } } } } public class CustomLineSeriesDrawPart : LineSeriesDrawPart { public CustomLineSeriesDrawPart(LineSeriesBase series, IChartRenderer renderer) : base(series, renderer) { } protected override PointF[] GetPointsPositionsArray() { List<DataPoint> points = new List<DataPoint>(this.Element.DataPoints); PointF[] result = new PointF[points.Count]; for (int i = 0; i < points.Count; i++) { result[i] = new PointF(this.OffsetX + (float)points[i].LayoutSlot.X, this.OffsetY + (float)points[i].LayoutSlot.Y); } return result; } }
Use attached to reproduce. If you add 163 points the axis will start from 3. There should be an option to start from 0.
To reproduce: DataTable table = new DataTable(); table.Columns.Add("Value", typeof(double)); table.Columns.Add("Name", typeof(string)); table.Rows.Add(1, "John"); table.Rows.Add(3, "Adam"); table.Rows.Add(5, "Peter"); table.Rows.Add(12, "Sam"); table.Rows.Add(6, "Paul"); BarSeries lineSeria = new BarSeries(); radChartView1.Series.Add(lineSeria); lineSeria.ValueMember = "Value"; lineSeria.CategoryMember = "Name"; this.radChartView1.DataSource = table; private void radButton1_Click(object sender, EventArgs e) { this.radChartView1.DataSource = null; } The chart data will be still visible. It is necessary to set explicitly the DataSource of the series: this.radChartView1.Series[0].DataSource = null;
The same issue can be observed in a DPI-aware application on higher scaling Workaround: set the RadControl.EnableDpiScaling property to false public partial class Form1 : Form { public Form1() { RadControl.EnableDpiScaling = false; InitializeComponent(); LineSeries lineSeries = new LineSeries(); lineSeries.DataPoints.Add(new CategoricalDataPoint(20, "Jan")); lineSeries.DataPoints.Add(new CategoricalDataPoint(22, "Apr")); lineSeries.DataPoints.Add(new CategoricalDataPoint(12, "Jul")); lineSeries.DataPoints.Add(new CategoricalDataPoint(19, "Oct")); this.radChartView1.Series.Add(lineSeries); LineSeries lineSeries2 = new LineSeries(); lineSeries2.DataPoints.Add(new CategoricalDataPoint(18, "Jan")); lineSeries2.DataPoints.Add(new CategoricalDataPoint(15, "Apr")); lineSeries2.DataPoints.Add(new CategoricalDataPoint(17, "Jul")); lineSeries2.DataPoints.Add(new CategoricalDataPoint(22, "Oct")); this.radChartView1.Series.Add(lineSeries2); LassoZoomController lassoZoomController = new LassoZoomController(); radChartView1.Controllers.Add(lassoZoomController); } private void radButton1_Click(object sender, EventArgs e) { this.radChartView1.ExportToImage(@"..\..\image.png", this.radChartView1.Size); } }
The new controller should allow lasso selection of data points without zooming the view port.
It would be great to be able to generate Box Plot graphics, both in the RadCharView control and in the Report.
To reproduce: public RadForm1() { InitializeComponent(); this.radChartView1.AreaType = ChartAreaType.Polar; PolarAreaSeries polarAreaSeries = new PolarAreaSeries(); PolarDataPoint polarPoint = new PolarDataPoint(); polarPoint.Value = 35; polarPoint.Angle = 50; polarAreaSeries.DataPoints.Add(polarPoint); polarPoint = new PolarDataPoint(); polarPoint.Value = 40; polarPoint.Angle = 200; polarAreaSeries.DataPoints.Add(polarPoint); polarPoint = new PolarDataPoint(); polarPoint.Value = 55; polarPoint.Angle = 320; polarAreaSeries.DataPoints.Add(polarPoint); this.radChartView1.Series.Add(polarAreaSeries); this.radChartView1.Axes[0].LabelFitMode = AxisLabelFitMode.Rotate; AxisLabelElement gauche = this.radChartView1.Axes[0].Children[1] as AxisLabelElement; gauche.Text = "IV Gestion des ressources" + Environment.NewLine + "humaines"; this.radChartView1.View.AxisLabelFormatting+=View_AxisLabelFormatting; } Font f = new Font("Arial", 10, FontStyle.Bold); private void View_AxisLabelFormatting(object sender, ChartAxisLabelFormattingEventArgs e) { if (e.LabelElement.Text.Contains("IV")) { e.LabelElement.Font = f; } }
Use attached to reproduce. Workaround: Use custom renderer: private void RadChartView1_CreateRenderer(object sender, ChartViewCreateRendererEventArgs e) { e.Renderer = new CustomCartesianRenderer(e.Area as CartesianArea); } public class CustomCartesianRenderer : CartesianRenderer { public CustomCartesianRenderer(CartesianArea area) : base(area) { } protected override void Initialize() { base.Initialize(); for (int i = 0; i < this.DrawParts.Count; i++) { CartesianGridLineAnnotationDrawPart linePart = this.DrawParts[i] as CartesianGridLineAnnotationDrawPart; if (linePart != null) { this.DrawParts[i] = new MyCartesianGridLineAnnotationDrawPart((CartesianGridLineAnnotation)linePart.Element, this); } } } } class MyCartesianGridLineAnnotationDrawPart : CartesianGridLineAnnotationDrawPart { public MyCartesianGridLineAnnotationDrawPart(CartesianGridLineAnnotation element, CartesianRenderer renderer) : base(element, renderer) { } public override void Draw() { PropertyInfo modelProperty = typeof(CartesianGridLineAnnotation).GetProperty("Model", System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.NonPublic); object model = modelProperty.GetValue(this.Element); PropertyInfo layoutProperty = model.GetType().GetProperty("LayoutSlot", BindingFlags.Public | BindingFlags.Instance); RadRect radRect = (RadRect)layoutProperty.GetValue(model); RectangleF rect = ChartRenderer.ToRectangleF(radRect); rect.Offset(this.ViewportOffsetX, this.ViewportOffsetY); Graphics graphics = this.Renderer.Surface as Graphics; RadGdiGraphics radGraphics = new RadGdiGraphics(graphics); var clipRect = ChartRenderer.ToRectangle(this.Element.View.GetArea<CartesianArea>().AreaModel.PlotArea.LayoutSlot); clipRect.Offset((int)this.ViewportOffsetX,(int) this.ViewportOffsetY); graphics.SetClip(clipRect); GraphicsPath path = new GraphicsPath(); path.AddLine(rect.Location, new PointF(rect.Right, rect.Bottom)); BorderPrimitiveImpl border = new BorderPrimitiveImpl(this.Element, null); border.PaintBorder(radGraphics, null, path, rect); rect.Size = graphics.MeasureString(this.Element.Label, this.Element.Font); rect.Offset(this.Element.PositonOffset.Width + 1, this.Element.PositonOffset.Height + 1); TextParams tp = new TextParams(); tp.font = this.Element.Font; tp.foreColor = this.Element.ForeColor; tp.paintingRectangle = rect; tp.text = this.Element.Label; TextPrimitiveHtmlImpl text = new TextPrimitiveHtmlImpl(); text.PaintPrimitive(radGraphics, 0f, new SizeF(1f, 1f), tp); } }
How to reproduce: check the attached project Workaround: private void button1_Click(object sender, EventArgs e) { this.radChartView1.DataSource = null; foreach (ChartSeries series in this.radChartView1.Series) { series.DataSource = null; } this.radChartView1.Series.Clear(); }
Workaround: public class MyRadChartView : RadChartView { public override string ThemeClassName { get { return typeof(RadChartView).FullName; } } protected override void Dispose(bool disposing) { base.Dispose(false); } }
https://demos.telerik.com/kendo-ui/radar-charts/radar-column The attached proejct shows a sample implementation.
To reproduce: BarSeries barSeries = new BarSeries("Performance", "RepresentativeName"); barSeries.DataPoints.Add(new CategoricalDataPoint(177, "Harley")); barSeries.DataPoints.Add(new CategoricalDataPoint(128, "White")); barSeries.DataPoints.Add(new CategoricalDataPoint(143, "Smith")); barSeries.DataPoints.Add(new CategoricalDataPoint(111, "Jones")); barSeries.DataPoints.Add(new CategoricalDataPoint(118, "Marshall")); this.radChartView1.Series.Add(barSeries); LinearAxis verticalAxis = radChartView1.Axes.Get<LinearAxis>(1); verticalAxis.MajorStep = 5; LinearAxisModel axisModel = verticalAxis.Model as LinearAxisModel; AxisScaleBreak scaleBreakItem = new AxisScaleBreak(); scaleBreakItem.Name = "Item1"; scaleBreakItem.From = 80d; scaleBreakItem.To = 120d; verticalAxis.ScaleBreaks.Add(scaleBreakItem);