This is a migrated thread and some comments may be shown as answers.

Using enumerable index as x coordinate in RadCartesianChart

3 Answers 39 Views
Chart
This is a migrated thread and some comments may be shown as answers.
Alexander
Top achievements
Rank 1
Alexander asked on 09 Apr 2014, 01:06 PM
Hello,

I am binding the ItemsSource of a ScatterLineSeries to some Linq Enumerable.
Is it possible to use the index (and not some property inside of the item) as x-coordinate?

Additionally, is it possible to specify a dot-separated path inside the XValueBinding (e.g. XValueBinding="Parent.X1")?

Thank you in advance!

Alex

3 Answers, 1 is accepted

Sort by
0
Accepted
Petar Marchev
Telerik team
answered on 10 Apr 2014, 07:46 AM
Hi Alexander,

1. Is it possible to use the index (and not some property inside of the item) as x-coordinate?
If you are in a scatter mode, this is not possible (scatter mode is when you are using two linear axes and scatter series). If you are using a categorical series (and at least one categorical axis) you will achieve the desired effect by only setting the ValueBinding and not setting the CategoryBinding property at all.

2. is it possible to specify a dot-separated path inside the XValueBinding
You can use a GenericDataPointBinding:
series1.ValueBinding = new GenericDataPointBinding<YourBusinessObject, double>
{
  ValueSelector = dataItem => dataItem.Smth.Val
};

Regards,
Petar Marchev
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
0
Alexander
Top achievements
Rank 1
answered on 10 Apr 2014, 07:59 AM
Thank you. I think that will help me.
Just one other question: Is it possible to specify an offset for the Categorical axis? So that it does not start with 1, but with any other number?

Alex
0
Accepted
Petar Marchev
Telerik team
answered on 10 Apr 2014, 08:40 AM
Hi Alexander,

1. Is it possible to specify an offset
When not setting a CategoryBinding, the chart internally assigns the Category of the DataPoint to be an index. Starts from 1. You cannot change this internal logic, but if you need, you can assign the CategoryBinding property and the axis will show what you need.

Regards,
Petar Marchev
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
Tags
Chart
Asked by
Alexander
Top achievements
Rank 1
Answers by
Petar Marchev
Telerik team
Alexander
Top achievements
Rank 1
Share this question
or