Variable width marked zones with date x-axis

4 posts, 0 answers
  1. Tony
    Tony avatar
    21 posts
    Member since:
    Oct 2011

    Posted 03 May 2012 Link to this post

    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
  2. Yavor
    Admin
    Yavor avatar
    401 posts

    Posted 08 May 2012 Link to this post

    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 >>

  3. DevCraft banner
  4. Tony
    Tony avatar
    21 posts
    Member since:
    Oct 2011

    Posted 08 May 2012 Link to this post

    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
  5. Yavor
    Admin
    Yavor avatar
    401 posts

    Posted 11 May 2012 Link to this post

    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 >>

Back to Top