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

Drawing multiple series incorrectly

4 Answers 119 Views
Chart
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Shane
Top achievements
Rank 1
Shane asked on 06 Jan 2012, 12:51 PM

Hi

I have a RadChart to display multiple series of items
These series are not symetrical, i.e. there are X values in some series which are not in others.

My issue is that, when the series are drawn, the X axis is not sorted correctly. It seems that X values are added for the first series and any values which occur in the second series, but not the first, are added to the end of the X axis.

Please see attached image for details

Can you help me with this issue?

Cheers
Shane

4 Answers, 1 is accepted

Sort by
0
Petar Marchev
Telerik team
answered on 11 Jan 2012, 09:01 AM
Hi,

It seems that you are actually using XCategory and not XValue. If you use XValue no such issue should arise.

If you insist on using XCategory then a small work around would be to insert all possible categories in the first series source (with null values) .

Hope this helps.

Kind regards,
Petar Marchev
the Telerik team
Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>
0
Shane
Top achievements
Rank 1
answered on 11 Jan 2012, 06:16 PM
Hi Petar,

Thank you for the reply.
I am now using XValue instead of XCategory, however this is bringing a new problem.
The chart now draws an extra x axis point at the end of the chart, which I do not want.

In the attached image this is Q4 - 2011.
Is there something I can set to remove this empty space?

Extra info:
Chart X values are DateTime objects.
The x axis labels are derived from these objects by overriding the "AxisLabel2D" style in xaml

Thank you for your help
Shane
0
Accepted
Petar Marchev
Telerik team
answered on 16 Jan 2012, 02:43 PM
Hello Shane,

As I have none of your code and none of your input data - I will again have to do some guessing, so please do excuse me if I make some wrongful assumptions.

The label that says "Q3 - 2011" probably represents a day in July. Let's say it represents the 15th of July. The data item in the chart's items source also represents some day, apparently very close to 15th of July but seems that is some day after this. So the label is there to mark the 15th but the input data is for the 16th. So the chart does not want to clip your data and this is why it seems that it is showing an extra quarter.

I think now the problem is obvious to you, too. To solve this you need to somehow synchronize the input data and the axis' step.

I have to guess your next question, too - "How do I do that?" - Well, there is no easy way - because of the nature of the axis(ticks need to be evenly distributed). You can try to manipulate your input data to fit the axis, but this would be a cumbersome workaround.

If this empty space at the end is not a huge problem I suggest you leave it as it is. If you insist on removing it - my suggestion to you would be to get back to "XCategory" and use the simple work-around that I suggested in my previous response.

Hope this helps.

Kind regards,
Petar Marchev
the Telerik team
Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>
0
Shane
Top achievements
Rank 1
answered on 16 Jan 2012, 05:16 PM
Hi Petar,

Thanks for the feedback.

In the end I used a combination of two solutions:
The first was to alter my data source to ensure that the 16th of July would not occur. This was not an issue as we use quarterly increments.
The second was to force draw the X axis I wanted using "AxisX.AddRange(...)".

Thanks for your help on this matter, (especially as you were going at it blindly), it certainly helped my project along.

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