Programmatically Lining up multiple barseries with DateTimeCategoricalAxis

9 posts, 0 answers
  1. Christian
    Christian avatar
    17 posts
    Member since:
    May 2016

    Posted 15 Jun Link to this post

    Hi,

    I'd like to replicate a graph which looks like the one you can see in the attached screenshot with min and max ranges written to the left side of each respective bar. Please note the number of bars and their values are determined at runtime. I know how to create the bar and lineseries programmatically, but not how to create such layout by code.

    Please help me in this matter.
  2. Petar Marchev
    Admin
    Petar Marchev avatar
    968 posts

    Posted 16 Jun Link to this post

    Hello Christian,

    In order for you to create synced charts, you need to use the same type of axis in each chart and each chart needs to have the same horizontal data, so that the axes end up with the same categories set.

    For example you cannot provide 2010, 2011 and 2012 for the first chart and 2011, 2012 and 2013 for the second chart, because the axes will end up with different categories and no alignment of data will be achieved. You need to supply both charts with 2010, 2011, 2012, 2013.

    After syncing the horizontal axis categories, almost full alignment will be achieved automatically. Small displacements may occur of you have the vertical axes visible and they have different ranges. In the image you attached, the axes are collapsed so this is not expected to happen.

    Let us know if you need more information.

    Regards,
    Petar Marchev
    Telerik
    Do you need help with upgrading your AJAX, WPF or WinForms project? Check the Telerik API Analyzer and share your thoughts.
  3. UI for WPF is Visual Studio 2017 Ready
  4. Christian
    Christian avatar
    17 posts
    Member since:
    May 2016

    Posted 16 Jun in reply to Petar Marchev Link to this post

    Thank you for the quick reply.

    How would your approach look like? I tried to follow the instructions from this link: http://docs.telerik.com/reporting/graphhowtocreateprogrammaticallygraph but I am getting ambiguous reference errors and am not sure which control should be used as a container. Is the above link the right one to follow?

  5. Petar Marchev
    Admin
    Petar Marchev avatar
    968 posts

    Posted 16 Jun Link to this post

    Hi Christian,

    This link is for the reporting components, and you have opened a ticket for the WPF chartview. If indeed you are using the WPF chartview, please look at this online help.

    Regards,
    Petar Marchev
    Telerik
    Do you need help with upgrading your AJAX, WPF or WinForms project? Check the Telerik API Analyzer and share your thoughts.
  6. Christian
    Christian avatar
    17 posts
    Member since:
    May 2016

    Posted 17 Jun in reply to Petar Marchev Link to this post

    Hi Petar,

    the only thing I found relating to this issue was multi axes, but I find it difficult to setup the vertical axes to get the desired result. Here is what I do:

    -Create a common horizonal axis

    -Loop through a list of barseries', create a vertical axis for each of them, set the label offset and minimum and maximum of the vertical axis, instantiate a lineseries if necessary, set the horizontal and vertical axes for both series' and add them to the chart

    The result is visualized in the attached picture.

    As you can see the result is quite far away from what I want to achieve.

    Regards,

    Christian

  7. Petar Marchev
    Admin
    Petar Marchev avatar
    968 posts

    Posted 20 Jun Link to this post

    Hi Christian,

    I think I already mentioned this in my first post -  you need 5 different charts and 5 different horizontal axes. Do you have 5? Then you need to sync the axes. You need to sync them so that you will later get properly aligned axes and series. You sync the axes by passing the same categories in the same order in each series (even if some of the items have to have a null for vertical value).

    While not exactly the same, this qsf example demonstrates a similar situation. So does this one. I suggest you invest some more time into getting to know the chartview features so that you can get to use the control in the best possible way. You can examine the sdk samples and the online documentation as well.

    Regards,
    Petar Marchev
    Telerik
    Do you need help with upgrading your AJAX, WPF or WinForms project? Check the Telerik API Analyzer and share your thoughts.
  8. Christian
    Christian avatar
    17 posts
    Member since:
    May 2016

    Posted 21 Jun Link to this post

    Hi Petar,

    thanks again. The program creates a chart for each series collection and adds them to a radgridview. This works mostly, but I encountered several problems:

    -Every radchart seems to change when I scroll in the list back and forth.

    -After I deselect a row the respective chart changes. Not sure why it happens, but more labels on top of the bars are added and the bars are compressed.

    -How can I hide these labels? I don't need them and they just clutter the chart.

    -How can I disable the column on the left which only shows an arrow pointing to the right on selection?

    -How can I disable row selection?

     

    Overall the direction is right, but some controls look like they need a lot more polish.

    Best regards.

  9. Petar Marchev
    Admin
    Petar Marchev avatar
    968 posts

    Posted 23 Jun Link to this post

    Hi,

    I was not able to reproduce any of the things you mention in your first three questions. I am attaching a small project, the one I tested with, and you can see that none of this happens. I suspect that you have some custom code that makes all of this happen, so I suggest you inspect what is going on on your side.

    You have also asked two questions about the gridview, to which I am sure that you will find answers either in our online documentation, our qsf examples and our skd samples. If you need further assistance about the gridview, I will ask that you open a new ticket with a product RadGridView, because we prefer to keep issues separated and not clutter one thread. Thank you for understanding.


    Regards,
    Petar Marchev
    Telerik
    Do you need help with upgrading your AJAX, WPF or WinForms project? Check the Telerik API Analyzer and share your thoughts.
  10. Christian
    Christian avatar
    17 posts
    Member since:
    May 2016

    Posted 27 Jun Link to this post

    Hi Petar,

    thanks for the package. Unfortunately the project immediately closes whenever I open it. Not sure why it happens. However I've solved it thanks to another post found on the forums.

    Best regards.

Back to Top
UI for WPF is Visual Studio 2017 Ready