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

Variable width marked zones with date x-axis

3 Answers 53 Views
ChartView
This is a migrated thread and some comments may be shown as answers.
Tony
Top achievements
Rank 1
Tony asked on 03 May 2012, 01:54 PM
Hi,

I'm looking at creating a chart using marked zones to represent variable width vertical strips.

My x-axis will represent dates (i.e. ChartArea.AxisX IsDateTime = "True").

I need to be able to control the exact dates shown in the x-axis (ChartArea.AxisX AutoRange = "False").

For example:
Jan 1 2011
Feb 29 2011
May 31 2011
Aug 31 2011
Sep 30 2011
Dec 31 2011

I'm setting this in <telerik:ItemMapping DataPointMember="XValue" FieldName="Date" />

Vertical strips 1 and 5 will be more narrow than vertical strips 2, 3, 4 and 6

Some quesitons:
1. Are marked zones the best (only?) way to do this?
2. The dates don't seem to be getting represented correctly (i.e. the x-axis starting [date] value seem to be some arbitrary minimum datetime value).

Thanks,

Tony

3 Answers, 1 is accepted

Sort by
0
Yavor
Telerik team
answered on 08 May 2012, 09:10 AM
Hello Tony,

You can try using categories instead of XValues. Just  change your DataPointMember to XCategory, no auto range is required. More information is available in this topic in our online help system.

Kind regards,
Yavor
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

0
Tony
Top achievements
Rank 1
answered on 08 May 2012, 11:08 AM
Yavor,

We did try using categories already.  With categories, we can set the "date" values correctly but the step becomes 1 which then causes problems with being able to have variable width marked zones.

Are you able to please try to build a demo project on your end to see if you can simulate our requirements which are:

1. x-axis labels need to be:
Jan 1 2011
Feb 29 2011
May 31 2011
Aug 31 2011
Sep 30 2011
Dec 31 2011

2. Vertical strips 1 (Jan 1 2011 - Feb 29 2011) and 4 (Aug 31 2011 - Sep 30 2011) will be more narrow than vertical strips 2, 3, and 5 (Feb 29 2011 - May 31 2011, May 31 2011 - Aug 31 2011, Sep 30 2011 - Dec 31 2011)

Regards,

Tony
0
Yavor
Telerik team
answered on 11 May 2012, 09:26 AM
Hello Tony,

Unfortunately the functionality you are seeking is not supported by RadChart. We have created a new charting solution that works better in DateTime scenarios. You can find more information and comparison between RadChart and RadChartView in our help system here.

I have created a small application that demonstrates how you can use DateTimeContinuous axis in your scenario.

Hope this helps!

All the best,
Yavor
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

Tags
ChartView
Asked by
Tony
Top achievements
Rank 1
Answers by
Yavor
Telerik team
Tony
Top achievements
Rank 1
Share this question
or