Bar width for DateTimeScale bar chart with discrete DateTime values

5 posts, 2 answers
  1. Tristan
    Tristan avatar
    9 posts
    Member since:
    Aug 2015

    Posted 04 Jan Link to this post

    The data I'm using to generate a bar chart comes in at 30 minute intervals. This means that the X-axis coordinate system has to have a 'Minutes' Scale BaseUnit.

    The issue I'm having is that this means I get a series of very thin, very widely spaced bars (one very thin bar each 30 minutes) rather than bars which are '30 minutes wide'.

    I've seen reference to a DateTimeCategoricalAxis in other parts of Telerik documentation (which sounds very much like what I need), but I've been unable to find an equivalent in the standalone designer.

  2. Answer
    Katia
    Admin
    Katia avatar
    299 posts

    Posted 06 Jan Link to this post

    Hello Tristan,

    You can switch to Category Scale and set the CategoryGroup's Label property to an expression that will be applied when displaying the XAxis labels. For more details check How to: Change the Axis Scale.

    As the data interval is quite specific in your case, you might consider using Line Chart instead to display the data in a more readable format.

    Regards,
    Katia
    Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
  3. DevCraft banner
  4. Tristan
    Tristan avatar
    9 posts
    Member since:
    Aug 2015

    Posted 07 Jan Link to this post

    Hi Katia, thanks for getting back to me.

    This is closer, I do now have full bars, but the chart seems to be 'doubling up' the data; so with a day's 30 minute data, there's an entire 48 spaces on the left which are blank and that use the label formatting of the CategoryGroup. Then right of that there are 48 bars representing the actual data, these use the label formatting of the bar series (I've attached an image which makes it clear).

    Any idea how I can dispose of this extra section on the left?

  5. Answer
    Katia
    Admin
    Katia avatar
    299 posts

    Posted 07 Jan Link to this post

    Hello Tristan,

    As you are using Category Scale to display dates, you need to remove any values from Series --> X property of your Graph. Only Series --> Y should be populated in your case.

    Regards,
    Katia
    Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
  6. Tristan
    Tristan avatar
    9 posts
    Member since:
    Aug 2015

    Posted 07 Jan Link to this post

    Aha! Thanks again Katia, I wouldn't have figured that one on my own!
Back to Top
DevCraft banner