Hello,
We are using Telerik RadControls for WPF Q2 2011 SP1. We're attempting to create a chart having two data series (viz. history and forecast) using two spline series. The data history series starts with values and ends with a series of nulls. The forecast starts with nulls (where the history has values) and ends with values (where history has nulls).
Now, the history series starts at the left and renders correctly. The problem is the forecast series that only starts further to the right. The initial line starts at a totally inappropriate angle and tends to do some looping effect. The further right, the worse it is. I guess this has to do with the spline initial control points, but as far as I can see I can't control those...
Below is a very simple example that should illustrate the problem. Also see the example images attached.
I have tried setting the EndPointBehaviour but it doesn't fix the problem (and we cannot use Zero since the data doesn't start from zero).
Any assistance would be greatly appreciated.
thanks
We are using Telerik RadControls for WPF Q2 2011 SP1. We're attempting to create a chart having two data series (viz. history and forecast) using two spline series. The data history series starts with values and ends with a series of nulls. The forecast starts with nulls (where the history has values) and ends with values (where history has nulls).
Now, the history series starts at the left and renders correctly. The problem is the forecast series that only starts further to the right. The initial line starts at a totally inappropriate angle and tends to do some looping effect. The further right, the worse it is. I guess this has to do with the spline initial control points, but as far as I can see I can't control those...
Below is a very simple example that should illustrate the problem. Also see the example images attached.
I have tried setting the EndPointBehaviour but it doesn't fix the problem (and we cannot use Zero since the data doesn't start from zero).
Any assistance would be greatly appreciated.
thanks
public
MainWindow()
{
InitializeComponent();
var data =
new
DataTable();
data.Columns.Add(
new
DataColumn { ColumnName =
"X"
, DataType =
typeof
(
int
) });
data.Columns.Add(
new
DataColumn { ColumnName =
"Y"
, DataType =
typeof
(
double
) });
var rnd =
new
Random();
for
(var i = 0; i < 40; i++)
{
var row = data.NewRow();
row[0] = i;
row[1] = (i < 30) ? (
object
)DBNull.Value : (
double
)rnd.Next(500);
data.Rows.Add(row);
}
chart.ItemsSource = data;
var seriesDefinition =
new
SplineSeriesDefinition();
seriesDefinition.ShowPointMarks =
false
;
seriesDefinition.ShowItemLabels =
false
;
seriesDefinition.EmptyPointBehavior = EmptyPointBehavior.Gap;
// Gap, Drop, Zero
var mapping =
new
SeriesMapping();
mapping.SeriesDefinition = seriesDefinition;
mapping.SeriesDefinition.Appearance.Stroke =
new
SolidColorBrush(Colors.Red);
mapping.ItemMappings.Add(
new
ItemMapping(data.Columns[0].ColumnName, DataPointMember.XCategory) { FieldType = data.Columns[0].DataType });
mapping.ItemMappings.Add(
new
ItemMapping(data.Columns[1].ColumnName, DataPointMember.YValue) { FieldType = data.Columns[1].DataType });
chart.SeriesMappings.Add(mapping);
}