This is a migrated thread and some comments may be shown as answers.

Programmatically Lining up multiple barseries with DateTimeCategoricalAxis

8 Answers 128 Views
ChartView
This is a migrated thread and some comments may be shown as answers.
Christian
Top achievements
Rank 1
Christian asked on 15 Jun 2016, 07:21 AM

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.

8 Answers, 1 is accepted

Sort by
0
Petar Marchev
Telerik team
answered on 16 Jun 2016, 08:26 AM
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.
0
Christian
Top achievements
Rank 1
answered on 16 Jun 2016, 02:04 PM

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?

0
Petar Marchev
Telerik team
answered on 16 Jun 2016, 03:44 PM
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.
0
Christian
Top achievements
Rank 1
answered on 17 Jun 2016, 07:32 AM

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

0
Petar Marchev
Telerik team
answered on 20 Jun 2016, 08:29 AM
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.
0
Christian
Top achievements
Rank 1
answered on 21 Jun 2016, 08:18 AM

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.

0
Petar Marchev
Telerik team
answered on 23 Jun 2016, 07:45 AM
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.
0
Christian
Top achievements
Rank 1
answered on 27 Jun 2016, 08:37 AM

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.

Tags
ChartView
Asked by
Christian
Top achievements
Rank 1
Answers by
Petar Marchev
Telerik team
Christian
Top achievements
Rank 1
Share this question
or