RadChart with bars per month... Is this a good solution?

4 posts, 0 answers
  1. Pablo
    Pablo avatar
    38 posts
    Member since:
    Oct 2012

    Posted 23 Nov 2011 Link to this post

    Hi all,

    I've been trying to configure the radchart to show a bar chart where each bar is associated to a month in the year. The configuration I've been using is manual, this is, the XAxis AutoRange = false and then IsDateTime is set to true and minValue, maxValue, Step and LabelStep is configured manually.

    I've seen displaying problems in the line exposed in other posts and derived from the fact that the "Step" is not constant between months. Among these problems I can tell some bars displayed with an x-axis offset (not centered) or very thin bars (which is not correct as there is only one series and there is plenty space left blank). 

    My question is about the workaround I've used to make this work: Categorical charts. Instead of making the RadChart working directly with dates, I opted by this configuration:

    - XAxis AutoRange is set to TRUE
    - IsDateTime is set to FALSE
    - The ItemMapping in the XAxis is set to XCategory and linked to a property of my bussiness object that contains a string representing the month (Jan, Feb and so on).

    Using this configuration shows a chart where the bars are correctly aligned and the width is as expected (they use as much space as they can). I'd like to know if this is a good solution or there is any other more suitable. 

    In my opinion, RadChart management of sources where the XAxis is composed by "OADates" doesn't work as well as it could, and an example of this is the situation I just exposed. I wonder if you are working on solving this kind of issues or we should wait until the new ChartView control is available for production usage.

    Best regards,

    Pablo.
  2. Ves
    Admin
    Ves avatar
    2879 posts

    Posted 28 Nov 2011 Link to this post

    Hi Pablo,

    While reading the first part of your post I was thinking of a categorical chart. And then -- you are already on it. Indeed, this is the recommended approach in this case due to the different length of the months. We have not planned any updates on the DateTime management in RadChart as we believe it is capable of handling most of the cases (well, indeed, using categories if needed). As for RadChartView -- even still in beta, I would encourage you to give it a try. I am sure you will be satisfied by the product quality.

    Just a side note on the categorical RadChart -- you can remove the property with the string representation of the month. AxisX exposes a property -- DefaultLabelFormat for cases like this. So, set IsDateTime to true and provide the desired format in DefaultLabelFormat.

    Best regards,
    Ves
    the Telerik team

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

  3. UI for WPF is Visual Studio 2017 Ready
  4. Pablo
    Pablo avatar
    38 posts
    Member since:
    Oct 2012

    Posted 28 Nov 2011 Link to this post

    Hi Ves,

    Thanks for your response. I'm glad we took a good approach to the problem :-).  I'll take a look at your side note.

    Regarding RadChartView, we haven't tried it yet as it does not support zooming by now. I wonder if it supports crosshairs, another feature required in our developments. I guess that these features will be available in the next releases. Do you know when will this happen more or less?

    Thanks!

    Pablo.
  5. Ves
    Admin
    Ves avatar
    2879 posts

    Posted 30 Nov 2011 Link to this post

    Hi Pablo,

    RadChartView already supports zoom/scroll and crosshair. You can also check this example.

    Best regards,
    Ves
    the Telerik team

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

Back to Top