Two category axis on Categorical chart (or workaround)

4 posts, 0 answers
  1. Andrei
    Andrei avatar
    10 posts
    Member since:
    Jul 2012

    Posted 07 Aug 2012 Link to this post

    Hello!

    Story:
    I want to compare two sets of data created for two periods of time (periods have same length).
    As I find out in the kendo doc I can create two X axis for scatter chart. This is the thread that inspire me
    The best result I could get is (you can try this here: http://jsfiddle.net/yXXCM/):
    https://www.dropbox.com/s/2qbdhz8ek5keh0j/day-large-no-hours.PNG (is it possible to inline the images into the post?)
    It is quite nice I would say. I is not perfect as labels are not match dots on the chart (that is because the label is not a day, it is a day + some hours: http://jsfiddle.net/RK26K/).
    ( You can notice labels' template for the second x axis (template: "#= kendo.toString(new Date(value + 1728000000), 'hh:mm dd MMM') #"). The "magic number" 1728000000 is a difference between periods calculated on the server. It is surely a hack, but it is the only way I found :) )

    But unfortunately this chart looks really nasty for small period of time and for week/month charts:
    https://www.dropbox.com/s/xqkcwr2l94tklr5/day-small.PNG
    https://www.dropbox.com/s/qamzyx3pqsix4jv/week.PNG
    https://www.dropbox.com/s/98lg7asn4b2tb3w/month.PNG
    Just look on 3 junes, 3 July and no August (the third dot) of months chart.


    Question:
    Actually, the problem is that X/Y chart is not the one that can help me.
    I definitely need a categorical chart. Category is a day or a week or a month in my case. But looks like categorical carts doesn't support two categories axis. Is that true?

    Could anyone help me with that %&^$^& cart? :)
    Probably there is a workaround for my problem.

    Thanks,
    Andrei.
  2. T. Tsonev
    Admin
    T. Tsonev avatar
    2815 posts

    Posted 09 Aug 2012 Link to this post

    Hi,

    There's no workaround for adding another category axis at the moment.

    We're working on providing built-in support for multiple category axes. Stay tuned.

    Regards,
    Tsvetomir Tsonev
    the Telerik team
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
  3. Andrei
    Andrei avatar
    10 posts
    Member since:
    Jul 2012

    Posted 09 Aug 2012 Link to this post

    :(
    Thanks for the answer Tsvetomir.


    I am just wondering if I can show two charts one on top of the other and then hide everything but the X axis of the first chart :)
    Something like "chart: {visible: false}, axis: {visible: true}"

    Is it possible?
    Thanks,
    Andrei.

  4. Andrei
    Andrei avatar
    10 posts
    Member since:
    Jul 2012

    Posted 09 Aug 2012 Link to this post

    Found a workaround!!!!!!!!!!!!


    Same idea as above but now I hide everything but the axis using "margin-top:-180px" on the first chart and "overflow: hidden" on the parent container.

    It is really a hack but it works for me :)
    Thanks guys for such a great chart library!

    Regards,
    Andrei.
Back to Top