http://www.telerik.com/help/wpf/common-export-support.html Resolution: Add an option to export the chart to an image or a stream using the ExportToImage methods.
Add vertical cursors for Line series that stay in place unless the user drags them. Each cursor should select the data points that covers. The cursor should allow setting its position programmatically.
Currently values can only increase from left to right and from bottom to top.
IMPROVE. RadChartView - one should be able to access the tooltip instance in order to customize it (change font, delay, etc)
To reproduce: - Add at least two series and zoom the chart so the point from one of the series are visible only - Move the TrackBall - The Track ball is not shown for some of the points.
Steps to reproduce: 1. Add a chart to a form. 2. Add any cartesian series 3. Set the LabelFitMode of the horizontal axis to Rotate. You will see that labels have incorrect layout.
Currently RadChartView does not support null values.
http://www.telerik.com/help/winforms/chart-features-marked-zones.html
Add print functionality
One should be able to add annotations at certain positions within RadChartView.
I'm using version 2012.3.1310.40 I use ChartView to create a pie chart with the following data Assets 2248550.22 Income 19748.67 Equity 2228253.95 Liability 547.60 So, when the chart displays, the Percentage is set as follows: Assets 50% Income 0% Equity 50% Liability 0% I notice when the percentage is 0% for any data, the pie chart shows "0%" near the chart title (please see attachment). Or if the calculated data returns 0, it doesn't show any percentage on the chart, but it will shows "NaN" near the title as well. (please see attachment).
To reproduce: public Form1() { InitializeComponent(); ScatterSeries series = new ScatterSeries(); series.DataPoints.Add(new ScatterDataPoint(5, 5)); series.DataPoints.Add(new ScatterDataPoint(4, 2)); series.DataPoints.Add(new ScatterDataPoint(-1, 3)); series.DataPoints.Add(new ScatterDataPoint(8, 4)); radChartView1.Series.Add(series); LinearAxis horizontalAxis = radChartView1.Axes.Get<LinearAxis>(0); horizontalAxis.Minimum = -10; horizontalAxis.Maximum = 10; } private void radButton1_Click(object sender, EventArgs e) { LinearAxis horizontalAxis = radChartView1.Axes.Get<LinearAxis>(0); horizontalAxis.DesiredTickCount = 20; }
Workaround: public class CustomLassoZoomController : LassoZoomController { protected override ActionResult OnMouseUp(MouseEventArgs e) { if (this.MouseDownLocation == Point.Empty || this.MouseMoveLocation == Point.Empty) { return Controller.Empty; } return base.OnMouseUp(e); } } public Form1() { InitializeComponent(); BarSeries barSeries = new BarSeries("Performance", "RepresentativeName"); barSeries.Name = "Q1"; 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); BarSeries barSeries2 = new BarSeries("Performance", "RepresentativeName"); barSeries2.Name = "Q2"; barSeries2.DataPoints.Add(new CategoricalDataPoint(153, "Harley")); barSeries2.DataPoints.Add(new CategoricalDataPoint(141, "White")); barSeries2.DataPoints.Add(new CategoricalDataPoint(130, "Smith")); barSeries2.DataPoints.Add(new CategoricalDataPoint(88, "Jones")); barSeries2.DataPoints.Add(new CategoricalDataPoint(109, "Marshall")); this.radChartView1.Series.Add(barSeries2); CustomLassoZoomController lassoZoomController = new CustomLassoZoomController(); radChartView1.Controllers.Add(lassoZoomController); }
Note: similar to the axis, the series should also have ClipLabels property which will control whether the labels will be clipped or not. How to reproduce: zoom and pan along the chart public Form1() { InitializeComponent(); this.radChartView1.CreateRenderer += radChartView1_CreateRenderer; this.radChartView1.ShowPanZoom = true; BarSeries barSeries = new BarSeries(); Random rand = new Random(); for (int i = 1; i < 10; i++) { barSeries.DataPoints.Add(new CategoricalDataPoint(rand.Next(100), i)); } barSeries.ShowLabels = true; this.radChartView1.Series.Add(barSeries); } Workaround: public partial class Form1 : Form { public Form1() { InitializeComponent(); this.radChartView1.CreateRenderer += radChartView1_CreateRenderer; this.radChartView1.ShowPanZoom = true; BarSeries barSeries = new BarSeries(); Random rand = new Random(); for (int i = 1; i < 10; i++) { barSeries.DataPoints.Add(new CategoricalDataPoint(rand.Next(100), i)); } barSeries.ShowLabels = true; this.radChartView1.Series.Add(barSeries); } 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++) { BarLabelElementDrawPart labelPart = this.DrawParts[i] as BarLabelElementDrawPart; if (labelPart != null) { this.DrawParts[i] = new CustomLabelElementDrawPart((BarSeries)labelPart.Element, this); } } } } public class CustomLabelElementDrawPart : BarLabelElementDrawPart { public CustomLabelElementDrawPart(ChartSeries owner, IChartRenderer renderer) : base(owner, renderer) { } public override void Draw() { Graphics graphics = this.Renderer.Surface as Graphics; CartesianSeries cartesianSeries = this.Element as CartesianSeries; if (cartesianSeries != null) { CartesianArea area = (CartesianArea)cartesianSeries.GetType().GetField("area", BindingFlags.Instance | BindingFlags.NonPublic).GetValue(cartesianSeries); RectangleF clipRect = (RectangleF)area.GetType().GetMethod("GetCartesianClipRect", BindingFlags.Instance | BindingFlags.NonPublic).Invoke(area, new object[] { });//.GetCartesianClipRect(); graphics.SetClip(clipRect); } base.Draw(); graphics.ResetClip(); } }
This problem is related to different serie types are added to the chartview
When trying to drill down PieChart on RadChartView the code throws exception. Workaround: private void radChartView_Drill(object sender, DrillEventArgs e){ e.View.Parent = this.radChartViewUsers.ChartElement.Wrapper; e.View.AreaType = ChartAreaType.Pie; //do drill logic}
How to reproduce: Dim table As New DataTable() table.Columns.Add("Name", GetType(String)) table.Columns.Add("X", GetType(Integer)) For i As Integer = 0 To 99 table.Rows.Add($"User {i}", i) Next Dim series As New BarSeries() series.DataSource = table series.CategoryMember = "Name" series.ValueMember = "X" RadChartView1.Series.Add(series) CType(RadChartView1.Area, CartesianArea).Orientation = Orientation.Horizontal Dim panZoomController As New ChartPanZoomController() panZoomController.PanZoomMode = ChartPanZoomMode.Vertical RadChartView1.Controllers.Add(panZoomController) RadChartView1.Zoom(1, 8) Workaround: create a custom ChartPanZoomController Dim panZoomController As New MyChartPanZoomController() panZoomController.PanZoomMode = ChartPanZoomMode.Vertical RadChartView1.Controllers.Add(panZoomController) Public Class MyChartPanZoomController Inherits ChartPanZoomController Protected Overrides Function OnMouseMove(e As MouseEventArgs) As ActionResult Dim cartesianArea As CartesianArea = TryCast(Me.Area, CartesianArea) If cartesianArea Is Nothing Then Return MyBase.OnMouseMove(e) End If Dim panPoint As Point? = Me.GetType().BaseType.GetField("panPoint", BindingFlags.Instance Or BindingFlags.NonPublic).GetValue(Me) If e.Button = MouseButtons.Left AndAlso panPoint.HasValue Then Dim offsetX As Double = Me.GetType().BaseType.GetField("offsetX", BindingFlags.Instance Or BindingFlags.NonPublic).GetValue(Me) Dim currentOffsetX As Double = offsetX Dim defaultAxis As Axis = If(cartesianArea.Orientation = Orientation.Horizontal, Me.Area.GetType().GetMethod("GetDefaultFirstAxis", BindingFlags.Instance Or BindingFlags.NonPublic).Invoke(Me.Area, New Object() {}), Me.Area.GetType().GetMethod("GetDefaultSecondAxis", BindingFlags.Instance Or BindingFlags.NonPublic).Invoke(Me.Area, New Object() {})) If Me.PanZoomMode = ChartPanZoomMode.Horizontal OrElse Me.PanZoomMode = ChartPanZoomMode.Both Then currentOffsetX += (panPoint.Value.X - e.Location.X) * -1 If currentOffsetX > 0 Then currentOffsetX = 0 End If If currentOffsetX < defaultAxis.Model.LayoutSlot.Width * (DirectCast(cartesianArea.View, IChartView).ZoomWidth - 1) Then currentOffsetX = -defaultAxis.Model.LayoutSlot.Width * (DirectCast(cartesianArea.View, IChartView).ZoomWidth - 1) End If End If Dim offsetY As Double = Me.GetType().BaseType.GetField("offsetY", BindingFlags.Instance Or BindingFlags.NonPublic).GetValue(Me) Dim currentOffsetY As Double = offsetY If Me.PanZoomMode = ChartPanZoomMode.Vertical OrElse Me.PanZoomMode = ChartPanZoomMode.Both Then currentOffsetY += (panPoint.Value.Y - e.Location.Y) * -1 If currentOffsetY > 0 Then currentOffsetY = 0 End If If currentOffsetY < -defaultAxis.Model.LayoutSlot.Height * (DirectCast(cartesianArea.View, IChartView).ZoomHeight - 1) Then currentOffsetY = -defaultAxis.Model.LayoutSlot.Height * (DirectCast(cartesianArea.View, IChartView).ZoomHeight - 1) End If End If cartesianArea.View.Pan(currentOffsetX, currentOffsetY) End If Return Controller.Empty End Function End Class
To reproduce: private void RadChartView1_LabelFormatting(object sender, ChartViewLabelFormattingEventArgs e) { var dataPoint = e.LabelElement.DataPoint as CategoricalDataPoint; if (dataPoint != null) { e.LabelElement.IsVisible = false; } } Workaround: private void RadChartView1_LabelFormatting(object sender, ChartViewLabelFormattingEventArgs e) { var dataPoint = e.LabelElement.DataPoint as CategoricalDataPoint; if (dataPoint != null) { e.LabelElement.Text = ""; } }
How to reproduce: explicitly set the border color of the series Workaround: public partial class Form1 : Form { private RangeSelectorViewElement chartElement; public Form1() { InitializeComponent(); LineSeries lineSeries = new LineSeries(); lineSeries.Name = "Line"; lineSeries.BorderColor = Color.Green; 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); this.chartElement = this.radRangeSelector1.RangeSelectorElement.AssociatedElement as RangeSelectorViewElement; this.chartElement.SeriesInitialized += ChartElement_SeriesInitialized; } private void ChartElement_SeriesInitialized(object sender, SeriesInitializedEventArgs e) { if (e.Series.Name == "Line") { e.Series.BorderColor = this.radChartView1.Series.Where(s => s.Name == "Line").First().BorderColor; } } }
Steps to reproduce: 1. Add chart to a form. 2. Add two bar series with CombineMode set to Stack100 3. Add two data points to the series with values 0.0 and identical category 4. Run the project an you will see an exception.