Gantt chart with multiple values per row

3 posts, 1 answers
  1. Scott
    Scott avatar
    4 posts
    Member since:
    Sep 2008

    Posted 08 Jun 2009 Link to this post

    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. Answer
    Ves avatar
    2869 posts

    Posted 10 Jun 2009 Link to this post

    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,
    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.
  3. DevCraft R3 2016 release webinar banner
  4. Scott
    Scott avatar
    4 posts
    Member since:
    Sep 2008

    Posted 10 Jun 2009 Link to this post

    Thank you Ves ! this is exactly what I was looking for !
Back to Top