FIX. RadChartView - Vertical Stripes go out of the chart area when PanZoom is using.
RadChartView - sometimes Property Builder of RadChartView is setting HorizontalAxis to be LinearAxis and to VerticalAxis to be DateTimeCategoricalAxis when you select "Linear & Date Time Categorical " which leads to incorrect work of PanZoom. Workaround: Use Smart Tag instead of Property Builder or swap the types of the axes in Design file.
Add null value support for RadChartView
Add Three Line Break Series to RadChartView
Currently, ScatterSeries are able to use NumericAxes only. A good improvement will be to allow using DateTimeContinuousAxes as well.
Axes should allow custom formatting for each individual label. Consider the following scenario - a chart provides information for each hour of the day. Each label should contain only the hours data, however, when the date changes the label should contain the full date information.
HeightAspectRatio affects the height of BarSeries even when the area has a horizontal orientation
To reproduce: Add a RadChartView and add some LineSeries and data points. Set the ShowTrackBall property to true. In some cases KeyNotFound exception occurs. Workaround: Use the following class: public class MyController : ChartTrackballController { protected override string GetTrackballText(List<DataPointInfo> points) { StringBuilder result = new StringBuilder("<html>"); SortedDictionary<ChartSeries, List<DataPoint>> visiblePoints = new SortedDictionary<ChartSeries, List<DataPoint>>(new ChartSeriesComparer()); foreach (DataPointInfo pointInfo in points) { if (visiblePoints.ContainsKey(pointInfo.Series)) { visiblePoints[pointInfo.Series].Add(pointInfo.DataPoint); } else { visiblePoints.Add(pointInfo.Series, new List<DataPoint>() { pointInfo.DataPoint }); } } int counter = 0; foreach (ChartSeries series in visiblePoints.Keys) { for (int i = 0; i < visiblePoints[series].Count; i++) { Color pointColor = this.GetColorForDataPoint(series, visiblePoints[series][i]); string color = string.Format("{0},{1},{2},{3}", pointColor.A, pointColor.R, pointColor.G, pointColor.B); result.AppendFormat("<color={0}>{1}", color, this.GetPointText(visiblePoints[series][i])); if (i < visiblePoints[series].Count) { result.Append(" "); } } counter++; if (counter < visiblePoints.Keys.Count) { result.Append("\n"); } } result.Append("</html>"); return result.ToString(); } class ChartSeriesComparer : IComparer<ChartSeries> { public ChartSeriesComparer() { } public int Compare(ChartSeries x, ChartSeries y) { if (!(x is IndicatorBase) && y is IndicatorBase) { return -1; } else if (x is IndicatorBase && !(y is IndicatorBase)) { return 1; } return x.GetHashCode().CompareTo(y.GetHashCode()); } } } Replace the old controller as follows: for (int i = 0; i < this.radChartView1.Controllers.Count; i++) { if (this.radChartView1.Controllers[i] is ChartTrackballController) { this.radChartView1.Controllers[i] = new MyController(); break; } } Note that the controller must be replaced before any data is added to the chart
RadChartView cannot read data from integer columns of a DataTable
Allow user to export current view as an image.
To reproduce use the following code to initialize the chart: DataTable dt = new DataTable(); dt.Columns.Add("Category", typeof(string)); dt.Columns.Add("Value", typeof(int)); dt.Rows.Add("010010", 5); dt.Rows.Add("000020", 6); dt.Rows.Add("000030", 2); dt.Rows.Add("000040", 11); return dt; BarSeries bs = new BarSeries("Value", "Category"); bs.Palette = new PaletteEntry(Color.BlanchedAlmond); radChartView1.DataSource = dt; radChartView1.Series.Clear(); radChartView1.Series.Add(bs); radChartView1.GetArea<CartesianArea>().Orientation = Orientation.Horizontal; Workaround: CategoricalAxis Axis = radChartView1.Axes.Get<CategoricalAxis>(1); Axis.LabelFormat = "{0:000000}";
Create a chart with a LinesSeries with a DateTimeContinuousAxis axis and set the following properties: DateTimeContinuousAxis horizontalAxis = new DateTimeContinuousAxis(); horizontalAxis.Title = tupleItem.HorizontalAxis; horizontalAxis.AxisType = AxisType.First; horizontalAxis.VerticalLocation = AxisVerticalLocation.Bottom; horizontalAxis.AutomaticBorderColor = false; horizontalAxis.MaximumTicks = 10; horizontalAxis.LabelFormat = "{0:HH:mm:ss.fff}"; You will see that there are less labels than ticks. When the chart is zoomed the labels also disappear from the ticks.
It would be very helpful if you either added ScaleBreaks (as in the deprecated RadChart control - http://www.telerik.com/help/winforms/chart-features-scale-breaks.html) or provided an alternative way. I use them a great deal with bar charts and logarithmic scales are not optimal.
To reproduce: 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); this.radChartView1.GetArea<CartesianArea>().Orientation = Orientation.Horizontal;
To reproduce: - Add 3 series to an array and add them to the chart. - Clear the chart series and add them back. - All labels are removed from the chart. Workaround: - Create new series.
The lasso controller does not zoom properly the vertical axis - the interval is not correct. Workaround: public class Lasso : LassoZoomController { protected override ActionResult OnMouseUp(MouseEventArgs e) { if (e.Button != MouseButtons.Left) { return base.OnMouseUp(e); } if (MouseDownLocation != MouseMoveLocation) { Point point = (Point)typeof(LassoZoomController).GetMethod("ClipLocation", System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.NonPublic).Invoke(this, new object[] { e.Location }); this.MouseMoveLocation = point; SizeF areaSize = SizeF.Empty; CartesianArea area = this.Area.View.GetArea<CartesianArea>(); if (area != null) { IChartView chartView = this.Area.View; var temp = area.GetType().GetMethod("GetCartesianClipRect", System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Instance).Invoke(area, null); areaSize = ((RectangleF)temp).Size; double delta = this.Area.View.Viewport.Width - areaSize.Width + this.Area.View.Viewport.X; double start = ((this.MouseDownLocation.X - chartView.PlotOriginX - delta) / areaSize.Width / chartView.ZoomWidth) * 100; double end = (MouseMoveLocation.X - chartView.PlotOriginX - delta) / areaSize.Width / chartView.ZoomWidth * 100; double zoomFactor = 100d / Math.Abs(start - end); double deltaHeight = this.Area.View.Viewport.Height - areaSize.Height + this.Area.View.Viewport.Y; double startH = ((this.MouseDownLocation.Y - chartView.PlotOriginY - deltaHeight) / areaSize.Height / chartView.ZoomHeight) * 100; double endH = (MouseMoveLocation.Y - chartView.PlotOriginY - deltaHeight) / areaSize.Height / chartView.ZoomHeight * 100; double zoomFactorH = 100d / Math.Abs(startH - end); if (zoomFactor < 1d) { zoomFactor = 1d; } if (zoomFactor > 100d) { zoomFactor = 100d; } if (zoomFactorH < 1d) { zoomFactorH = 1d; } if (zoomFactorH > 100d) { zoomFactorH = 100d; } double pan = (((areaSize.Width - 1) * zoomFactor) / 100) * Math.Min(start, end); double panH = (((areaSize.Height - 1) * zoomFactorH) / 100) * Math.Min(startH, endH); this.Area.View.Zoom(zoomFactor, zoomFactorH); this.Area.View.Pan(-pan, -panH); } } ViewResult result = typeof(LassoZoomController).GetField("result", System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.NonPublic).GetValue(this) as ViewResult; result.ShouldInvalidate = true; return new ViewResult() { ShouldInvalidate = true }; } }
To reproduce: 1. Perform zoom and pan operation and click the print/print preview button: 2. You will notice that the printed chart is not exactly the same as the displayed one. Please refer to the attached screenshot. public Form1() { 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); ChartPanZoomController panZoomController = new ChartPanZoomController(); panZoomController.PanZoomMode = ChartPanZoomMode.Horizontal; radChartView1.Controllers.Add(panZoomController); } private void radButton1_Click(object sender, EventArgs e) { this.radChartView1.PrintPreview(); } 3.The issue also appears when the LassoZoomController is used.
To reproduce: - Start the Q3 2014 SP1 demo application. - Open the Bar example. - Set the orientation to horizontal. In addition please note that the first and the last labels of the horizontal axis are missing as well. Workaround: CategoricalAxis vertiacalAxis = radChartView1.Axes[1] as CategoricalAxis; if (vertiacalAxis != null) { vertiacalAxis.LabelFitMode = AxisLabelFitMode.Rotate; vertiacalAxis.LabelRotationAngle = .1; }
Steps to reproduce: 1. On a button click create a chart, add series and a data source. 2. Call the Dispose method of the chart. You will notice that the memory allocated by the chart will not be released Workaround: clear the series before you dispose of the chart.
Steps to reproduce: 1. Add a chart with bar series to a form 2. Set the border of the bars to be larger than 2px You will see that bars are taller/longer with the border applied than they are without a border.