The new functionality should allow a display similar to the one in the WPF pie series: http://docs.telerik.com/devtools/wpf/controls/radchartview/features/labels/smart-labels#using-smart-labels-in-radpiechart
Hello Telerik Support,
after taking my first steps with RangeSelector and ChartView controls I found an issue with a simple bar chart. The length of some bars in the chart of the RangeSelector doesn't match with the bars in the ChartView. The relation is wrong.I provided a screenshot and marked the bars. I could provide a sample application, but I can't attach a zip file, so here's the code of the main form:
using
System;
using
System.Collections.Generic;
using
System.ComponentModel;
using
System.Data;
using
System.Drawing;
using
System.Linq;
using
System.Text;
using
System.Windows.Forms;
using
Telerik.WinControls;
using
Telerik.WinControls.UI;
namespace
TelerikChartView
{
public
partial
class
MainForm : Telerik.WinControls.UI.RadForm
{
private
List<Kapazitaetspunkt> _BackListPunkte;
private
BindingList<Kapazitaetspunkt> Punkte;
public
MainForm()
{
InitializeComponent();
}
private
void
MainForm_Load(
object
sender, EventArgs e)
{
_BackListPunkte =
new
List<Kapazitaetspunkt>();
Punkte =
new
BindingList<Kapazitaetspunkt>(_BackListPunkte);
//Punkte = new BindingList<Kapazitaetspunkt>();
rngTimeSelector.AssociatedControl = cvChart;
rngTimeSelector.RangeSelectorElement.ScrollSelectorElement.Visibility = ElementVisibility.Collapsed;
BarSeries bars =
new
BarSeries();
bars.DataSource = Punkte;
bars.ValueMember = nameof(Kapazitaetspunkt.Percentage);
bars.CategoryMember = nameof(Kapazitaetspunkt.Date);
cvChart.Series.Add(bars);
}
private
void
GenerateTestData(
int
addMonths = 0)
{
Punkte.Clear();
const
int
count = 25;
const
int
step = 4;
var von = DateTime.Today.AddMonths(addMonths);
var bis = von.AddDays(count);
double
percentage = 0;
//_BackListPunkte.Add(new Kapazitaetspunkt(von.AddDays(-1), null));
Punkte.Add(
new
Kapazitaetspunkt(von.AddDays(-1),
null
));
while
(von < bis)
{
//_BackListPunkte.Add(new Kapazitaetspunkt(von, percentage));
Punkte.Add(
new
Kapazitaetspunkt(von, percentage));
percentage += step;
von = von.AddDays(1);
}
//_BackListPunkte.Add(new Kapazitaetspunkt(von.AddDays(1), null));
Punkte.Add(
new
Kapazitaetspunkt(von.AddDays(1),
null
));
}
private
void
btnGenerateData_Click(
object
sender, EventArgs e)
{
GenerateTestData();
rngTimeSelector.RangeSelectorElement.InitializeElements();
rngTimeSelector.RangeSelectorElement.ResetLayout(
true
);
}
private
void
btnGenerateData2_Click(
object
sender, EventArgs e)
{
GenerateTestData(2);
rngTimeSelector.RangeSelectorElement.InitializeElements();
rngTimeSelector.RangeSelectorElement.ResetLayout(
true
);
}
private
void
rngTimeSelector_ScaleInitializing(
object
sender, ScaleInitializingEventArgs e)
{
e.Cancel =
true
;
}
}
public
class
Kapazitaetspunkt : INotifyPropertyChanged
{
private
DateTime _Date;
public
DateTime Date
{
get
=> _Date;
set
{
if
(value != Date)
{
_Date = value;
OnPropertyChanged();
}
}
}
public
double
? _Percentage;
public
double
? Percentage
{
get
=> _Percentage;
set
{
if
(value != Percentage)
{
_Percentage = value;
OnPropertyChanged();
}
}
}
public
Kapazitaetspunkt(DateTime date,
double
? percentage)
{
Date = date;
Percentage = percentage;
}
public
event
PropertyChangedEventHandler PropertyChanged;
protected
virtual
void
OnPropertyChanged([CallerMemberName]
string
propertyName =
null
)
{
PropertyChanged?.Invoke(
this
,
new
PropertyChangedEventArgs(propertyName));
}
}
}
Regards,
Stephan
ChartLegendElement is not able to wrap the LegendItems
Add RightToLeft support in DrillDownNavigator.
The Line Series cannot be clicked/selected and cannot be used in DrillDown scenarios.
Steps to reproduce: 1. Create an instance of any chart series 2. Set the Palette property to a new/existing PaletteEntry instance with any colors Run the project and you will see an exception.
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.
Add Scatter area series support for RadChartView.
Currently only axes labels can be rotated. There should be a way to rotate series labels as well. Resolution: Set the LabelRotationAngle property of the series to preferred angle.
We should add a way for users to bind a property in the data source that will be used as a legend title for pie data points. Resolution: Set the LegendTitleMember property to bind legend title of PieSeries.
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}
Introduce mechanism that will allow the vertical axis to appear at a certain position regardless of the size of its labels. For reference see Stock Series \ Indicators example.
Add Scatter Line Series Support to RadChartView
Add Bubble series support for RadChartView
A localization provider should be created in order to allow customization of the strings (context menu, etc)
To reproduce: Add Series and Axes to a RadChartView and a ChartPanZoomController. Zoom and pan a little, then clear all the series and axes and add new ones. Try to pan now.
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(); }
How to reproduce: create a drill down chart with different area types on the different levels. The issue seems to be related to some series not implementing the ILegendInfoProvider interface. Workaround: A similar result as having a drill-down chart with series having different area types can be achieved manually using the ChartSelectionController. Please check the attached project and video file.
When combining scalebreaks and series stacking, the rendered chart does not match the data. See attached solution: The bar of the category "1/2016" has a length of 105 (as indicated by the tooltips) -- but the corresponding axis labeling shows a value of 37. The scalebreak is off too (probably matching the wrong axis).