To reproduce: public partial class Form1 : Form { private BindingList<MyData> data; public Form1() { InitializeComponent(); LoadDatas(); MyBarSeries bars = new MyBarSeries(); bars.DataSource = data; bars.ValueMember = "Montant"; bars.CategoryMember = "Month"; bars.LegendTitle = "My series of MyData"; this.radChartView1.ShowLegend = true; this.radChartView1.Series.Add(bars); } private void LoadDatas() { data = new BindingList<MyData>(); data.Add(new MyData(20, "janv", 1)); data.Add(new MyData(50, "fev", 2)); data.Add(new MyData(30, "mars", 3)); data.Add(new MyData(25, "avril", 4)); data.Add(new MyData(40, "mai", 5)); data.Add(new MyData(80, "juin", 6)); data.Add(new MyData(20, "juil", 7)); } public class MyData { public int Montant { get; set; } public string Month { get; set; } public double NumMonth { get; set; } public MyData(int montant, string month, double numMonth) { this.Montant = montant; this.Month = month; this.NumMonth = numMonth; } } public class MyBarSeries : BarSeries { } } Resolution: When you inherit from a serie, the original control themes are not automatically inherited. You need to override the ThemeRole property. Here is the code snippet: public class MyBarSeries : BarSeries { public override string ThemeRole { get { return typeof(BarSeries).Name; } } }
Currently the PieRenderer class is private and cannot be inherited nor extended. All other renderer classes are public.
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.
Adding a series with null values and combine mode Stack or Stack100 results in an exception.
Inside the constructor of a form create a pie series and populate it with data. Then add it to a RadChartView. You will notice that there are two legend items per data point.
To reproduce use the following code: public Form1() { InitializeComponent(); radChartView1.AreaType = Telerik.WinControls.UI.ChartAreaType.Pie; radChartView1.ShowLegend = true; series.ValueMember = "CategoryID"; series.DisplayMember = "CategoryName"; series.DataSource = this.nwindDataSet1.Categories; radChartView1.Series.Add(series); } private void radButton1_Click(object sender, EventArgs e) { this.categoriesTableAdapter.Fill(this.nwindDataSet1.Categories); } private void Form1_Load(object sender, EventArgs e) { // TODO: This line of code loads data into the 'nwindDataSet1.Categories' table. You can move, or remove it, as needed. this.categoriesTableAdapter.Fill(this.nwindDataSet1.Categories); } Workaround: - Clear the items manually: this.radChartView1.ChartElement.LegendElement.StackElement.Children.Clear();
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}";
To reproduce: Create a RadChartView, add a ZoomController and set the ShowGrid property to true: 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(11, 4)); chart.Series.Add(series); chart.Controllers.Add(new LassoZoomController()); chart.ShowGrid = true; You will see that the grid is painted outside of the chart area where the points are
To reproduce: use the following code snippet: Random rand = new Random(); List<LineSeries> list = new List<LineSeries>(); for (int i = 0; i < 15; i++) { LineSeries ls = new LineSeries(); ls.LegendTitle = "Series" + i; list.Add(ls); } for (int i = 0; i < 1000; i++) { foreach (LineSeries s in list) { s.DataPoints.Add(new CategoricalDataPoint(i, rand.Next(0, rand.Next(5, 20)))); } } radChartView1.Series.AddRange(list.ToArray()); this.radChartView1.ChartElement.LegendPosition = LegendPosition.Bottom; this.radChartView1.ChartElement.LegendElement.StackElement.Orientation = Orientation.Horizontal; Resolution: The issue is duplicated with item IMPROVE. RadChartView - ChartLegend should be able to wrap its items. From Q1 2015 when there are many items in the chart legend a scroll bar will appear so users can scroll through the items. More info in the following feedback item http://feedback.telerik.com/Project/154/Feedback/Details/149848-add-radchartview-when-the-legend-has-many-items-a-scrollbar-should-appear
To reproduce: Create a RadChartView with LineSeries. Subscribe to the CreatePointElement event and use the following code: void Chart_CreatePointElement(object sender, ChartViewCreatePointElementEventArgs e) { e.DataPointElement = new DataPointElement(e.DataPoint); e.DataPointElement.GradientStyle = GradientStyles.Solid; e.DataPointElement.GradientAngle = 270; e.DataPointElement.Shape = new DiamondShape(); e.DataPointElement.BackColor = Color.Red; e.DataPointElement.BackColor2 = Color.Blue; e.DataPointElement.BackColor3 = Color.Blue; e.DataPointElement.BackColor4 = Color.Blue; } The elements paint when you use ChamferedRectShape. Workaround class MyDiamondShape : ElementShape { public override GraphicsPath CreatePath(Rectangle bounds) { GraphicsPath path = new GraphicsPath(); path.AddPolygon(new PointF[] { new PointF(bounds.X + 0.5f * bounds.Width, bounds.Top), new PointF(bounds.Right, bounds.Y + 0.5f * bounds.Height), new PointF(bounds.X + 0.5f * bounds.Width, bounds.Bottom), new PointF(bounds.Left, bounds.Y + 0.5f * bounds.Height) }); return path; } } class MyStarShape : ElementShape { private int arms; private float innerRadiusRatio; public MyStarShape() { this.arms = 8; this.innerRadiusRatio = 0.2f; } /// <summary> /// Creates Star like shape. Overrides CreatePath method in the base class /// ElementShape. /// </summary> public override GraphicsPath CreatePath(Rectangle bounds) { GraphicsPath path = new GraphicsPath(); double angle = Math.PI / arms; double offset = Math.PI / 2d; PointF center = new PointF(bounds.X + bounds.Width / 2f, bounds.Y + bounds.Height / 2f); PointF[] points = new PointF[arms * 2]; for (int i = 0; i < 2 * arms; i++) { float r = (i & 1) == 0 ? bounds.Width / 2f : bounds.Width / 2f * innerRadiusRatio; float currX = center.X + (float)Math.Cos(i * angle - offset) * r; float currY = center.Y + (float)Math.Sin(i * angle - offset) * r; points[i] = new PointF(currX, currY); } path.AddPolygon(points); return path; } } class MyHeartShape : ElementShape { public override GraphicsPath CreatePath(Rectangle bounds) { GraphicsPath path = new GraphicsPath(); path.AddArc(new Rectangle(bounds.X, bounds.Y, bounds.Width / 2, bounds.Height / 2), 150, 210); path.AddArc(new Rectangle(bounds.X + bounds.Width / 2, bounds.Y, bounds.Width / 2, bounds.Height / 2), 180, 210); path.AddLine(path.GetLastPoint(), new Point(bounds.X + bounds.Width / 2, bounds.Bottom)); path.CloseFigure(); return path; } }
ADD. RadChartView - add waterfall series type.
To reproduce: Add a RadChartView and use the following code: public Form1() { InitializeComponent(); this.radChartView1.ShowTrackBall = true; this.radChartView1.ShowLegend = true; Random rand = new Random(); var lineSeries = new LineSeries(); for (int i = 0; i < 1000; i++) { lineSeries.DataPoints.Add(new CategoricalDataPoint(i, rand.Next(0, rand.Next(5, 20)))); } radChartView1.Series.Add(lineSeries); } Workaround: change the LegendPosition: this.radChartView1.ChartElement.LegendPosition = LegendPosition.Bottom;
so that Y increases as you move down the screen. (Even) microsoft chart component supports this.
To reproduce: Have a RadButton and a RadChartView on a form. On button click use the following code: private void GenerateSeries() { LineSeries lineSeries = new LineSeries(); lineSeries.DataPoints.Add(new CategoricalDataPoint(20, "Jan") { Label = "January" }); lineSeries.DataPoints.Add(new CategoricalDataPoint(22, "Apr")); lineSeries.DataPoints.Add(new CategoricalDataPoint(12, "Jul")); lineSeries.DataPoints.Add(new CategoricalDataPoint(19, "Oct")); lineSeries.LegendTitle = "Line 1 "; this.Chart.Series.Add(lineSeries); lineSeries.BackColor = Color.Black; lineSeries.PointSize = new SizeF(15, 15); 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")); lineSeries2.LegendTitle = "Line 2 "; this.Chart.Series.Add(lineSeries2); } void RadButton_Click(object sender, EventArgs e) { this.Chart.Series.Clear(); this.GenerateSeries(); } You will notice that the memory will not decrease after a few presses of the button. Workaround: Set the Provider of the LegendElement to null: private void GenerateSeries() { this.Chart.ChartElement.LegendElement.Provider = null; LineSeries lineSeries = new LineSeries(); lineSeries.DataPoints.Add(new CategoricalDataPoint(20, "Jan") { Label = "January" }); lineSeries.DataPoints.Add(new CategoricalDataPoint(22, "Apr")); lineSeries.DataPoints.Add(new CategoricalDataPoint(12, "Jul")); lineSeries.DataPoints.Add(new CategoricalDataPoint(19, "Oct")); lineSeries.LegendTitle = "Line 1 "; this.Chart.Series.Add(lineSeries); lineSeries.BackColor = Color.Black; lineSeries.PointSize = new SizeF(15, 15); 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")); lineSeries2.LegendTitle = "Line 2 "; this.Chart.Series.Add(lineSeries2); } void Button_Click(object sender, EventArgs e) { this.Chart.Series.Clear(); this.GenerateSeries(); }
To reproduce: use the following code snippet public Form1() { InitializeComponent(); ScatterLineSeries scatterSeries = new ScatterLineSeries(); scatterSeries.DataPoints.Add(new ScatterDataPoint(15, 19)); scatterSeries.DataPoints.Add(new ScatterDataPoint(18, 10)); scatterSeries.DataPoints.Add(new ScatterDataPoint(13, 15)); scatterSeries.DataPoints.Add(new ScatterDataPoint(10, 8)); scatterSeries.DataPoints.Add(new ScatterDataPoint(5, 2)); scatterSeries.PointSize = new SizeF(8, 8); this.radChartView1.Series.Add(scatterSeries); ScatterLineSeries scatterSeries2 = new ScatterLineSeries(); scatterSeries2.DataPoints.Add(new ScatterDataPoint(2, 24)); scatterSeries2.DataPoints.Add(new ScatterDataPoint(7, 12)); scatterSeries2.DataPoints.Add(new ScatterDataPoint(15, 10)); scatterSeries2.DataPoints.Add(new ScatterDataPoint(18, 22)); scatterSeries2.DataPoints.Add(new ScatterDataPoint(20, 20)); scatterSeries2.Shape = new RoundRectShape(1); scatterSeries2.PointSize = new SizeF(8, 8); this.radChartView1.Series.Add(scatterSeries2); ChartTooltipController toolTipController = new ChartTooltipController(); radChartView1.Controllers.Add(toolTipController); } Workaround: use custom renderer public Form1() { InitializeComponent(); this.radChartView1.CreateRenderer += radChartView1_CreateRenderer; } 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++) { ScatterSeriesDrawPart scatterPart = this.DrawParts[i] as ScatterSeriesDrawPart; if (scatterPart != null) { this.DrawParts[i] = new CustomScatterSeriesDrawPart((ScatterLineSeries)scatterPart.Element, this); } } } } public class CustomScatterSeriesDrawPart : ScatterLineSeriesDrawPart { public CustomScatterSeriesDrawPart(ScatterLineSeries series, IChartRenderer renderer) : base(series, renderer) { } public override DataPoint HitTest(Point location) { 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 scatterBounds = new RectangleF((float)(this.OffsetX + slot.X - pointHalfWidth), (float)(this.OffsetY + slot.Y - pointHalfHeight), this.Element.PointSize.Width, this.Element.PointSize.Height); if (scatterBounds.Contains(location.X, location.Y)) { return this.Element.DataPoints[i]; } } return null; } }
To reproduce: You need a RadChartView with some series. You need to add a new View - radChartView1.Views.AddNew("Bigger"); You also need to add a DrillDownController: DrillDownController drillcontrol = new DrillDownController(); radChartView1.Controllers.Add(drillcontrol); radChartView1.ShowDrillNavigation = true; On the Drill event of RadChartView you need to reload the chart. This must clear the axes on the current view (determined by the drill level) and add new ones. You will see that the legend will not update. Additional details can be found in the attached project. Workaround: Re-add the legend items manually: private void radChartView1_Drill(object sender, DrillEventArgs e) { if (e.Level == 0) BiggerView = false; else BiggerView = true; ReloadChart(); this.radChartView1.ChartElement.LegendElement.StackElement.Children.Clear(); ChartView currentView = this.radChartView1.Views[BiggerView ? 1 : 0]; foreach (ChartSeries series in currentView.Series) { LegendItem item = new LegendItem(series) { Title = series.Name }; LegendItemElement element = new LegendItemElement(item); this.radChartView1.ChartElement.LegendElement.StackElement.Children.Add(element); } }
With significant number of points in pie series and with very small values as data points, the default chart strategy for positioning smart labels overlaps the values. Note: the smart labels overlapping can be reproduced with DonutSeries as well.