Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
80
How do you get GanttChart Data???
posted

This is my first time using Infragistics.  I literally have only a couple of days experience yet have a tight timeline to get this resolved.

I have an existing piece of code that loads up a GanttChart.  The chart itself is a visual of how many detailed items we may hvae for a given year.  So, the gantt chart will ONLY be one row with many "columns"  What I fail to see

is how the ChartDataEventArgs has NO data.  Given I will have one "row" of data the ONLY data item that comes back is the "row" index the user clicked on which is always ZERO.  Basically the chart looks like a multi-colored bar where the color changes when we have new data.  I need to know which color was clicked on.  For example you will see two months of red, followed by 3 months of green, followed by 4 months of blue (the X axis has months of the year).  I need to know which of the 3 "columns" was clicked so I know what detailed data to show.  I wanted to find some way of adding data to the ChartDataEventArgs so I know what was clicked.

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

UltraChart1.Series.Clear();

 

 

Stack<int

> approvedColors = UltraChart1.SetTimelineColors();

 

 

GanttSeries series = new GanttSeries

();

 

 

IEnumerable<DateTime> dateStrings = (from Rate r in

value

 

 

select

r.EffectiveDate).Distinct();

 

 

GanttItem product = new

GanttItem

{

Label =

 

Convert.ToString("Rates"

)

};

 

 

foreach (DateTime date in

dateStrings)

{

 

 

 

 

var rate = (from Rate r in value where  r.EffectiveDate == date select  r).FirstOrDefault();

 

 

 

 

GanttTimeEntry t1 = UltraChart1.CreateTimeEntry(Convert

.ToString(rate.ID), rate.EffectiveDate, rate.ExpirationDate,

 

 

Color

.FromArgb(approvedColors.Pop()), rate.ID);

 

 

product.Times.Add(t1);

 

 

 

 

 

}

 

series.Items.Add(product);

UltraChart1.Series.Add(series);

UltraChart1.SetDefaultXAxis(UltraChart1,

 

new DateTime((ddlBenefitRange.SelectedValue == string.Empty ? DateTime.Now.Year : Convert

.ToInt32(ddlBenefitRange.SelectedValue)), 01, 01));