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

Gantt chart with multiple values per row

2 Answers 234 Views
Chart (obsolete as of Q1 2013)
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Scott
Top achievements
Rank 1
Scott asked on 08 Jun 2009, 12:13 PM
Good morning,

I'm new to the telerik radchart control. I'm looking to put multiple items per row in a gantt chart. For example, if I had the following data

Name            To                From
Person1        1/1/2009        1/10/2009
Person1        1/12/2009        1/14/2009
Person1        1/15/2009        1/18/2009
Person2        1/8/2009        1/10/2009
Person2        1/15/2009        1/18/2009

So you'd have dates along the X-axis, names along the Y-axis. There would be two rows on the Y-axis (Person1 and Person2) and the graph would contain 3 values for Person1 and 2 values for Person2.

I'm not sure how to structure the code and setup the databinding to accomplish this.

Thank you,
Scott Vercuski

2 Answers, 1 is accepted

Sort by
0
Accepted
Ves
Telerik team
answered on 10 Jun 2009, 10:31 AM
Hello Scott,

Please, find attached a small example showing this. Here is what you should have in mind:

While RadChart will not automatically align its items according to a string value ("Person1", "Person2" etc.), but this can be done for a numeric value. So, if you add a column PersonID you can use it to set XValue to ChartSeriesItems (when databinding this is done through the series'  ValuesXColumn property). This way two ChartSeriesItems with the same XValue will appear at the same position along the X axis. Note, that for horizontal charts the vertical axis becomes X axis, while the horizontal one becomes Y axis.

Second problem would be to show the names along the X axis. The DataLabelsColumn property would not fit here as RadChart will create a new axis item for each entry in the datasource and this would force the chart to create multiple items for the same name.One possible workaround would be to create the chart axis items manually.

All the best,
Ves
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Scott
Top achievements
Rank 1
answered on 10 Jun 2009, 12:35 PM
Thank you Ves ! this is exactly what I was looking for !
Tags
Chart (obsolete as of Q1 2013)
Asked by
Scott
Top achievements
Rank 1
Answers by
Ves
Telerik team
Scott
Top achievements
Rank 1
Share this question
or