Get Info from Gantt serie to display with ToolCursor
Posted: Thu Mar 26, 2015 2:38 pm
Dear Sir,
I'm using Tchart 2015 WPF, how can get the task name from a Gantt Serie when the CurorTool is moving on the task.
The gantt series are created in this way.
Gantt gantt = new Gantt();
gantt.Marks.Visible = true;
gantt.Add(DateTime.Now.AddDays(-4), DateTime.Now.AddDays(-2), 2, "P1");
gantt.Add(DateTime.Now.AddDays(0), DateTime.Now.AddDays(1), 2, "P2");
Gantt gantt1 = new Gantt();
gantt1.Marks.Visible = true;
gantt1.Add(DateTime.Now.AddDays(-6), DateTime.Now.AddDays(-4), 5, "P3");
gantt1.Add(DateTime.Now.AddDays(-2), DateTime.Now.AddDays(0), 5, "P4");
tChart.Axes.Left.Labels.Style = AxisLabelStyle.Value;
//tChart.Series.Add(serie1);
//tChart.Series.Add(serie2);
tChart.Series.Add(gantt);
tChart.Series.Add(gantt1);
In the CursorChange Event I get the current date of the cursor with :
_currentCursorPositionDate = DateTime.FromOADate(tChart.Series[0].XScreenToValue(e.x));
How Get the Task Name of the series at this datetime ?
Thank you
Regards,
Philippe
I'm using Tchart 2015 WPF, how can get the task name from a Gantt Serie when the CurorTool is moving on the task.
The gantt series are created in this way.
Gantt gantt = new Gantt();
gantt.Marks.Visible = true;
gantt.Add(DateTime.Now.AddDays(-4), DateTime.Now.AddDays(-2), 2, "P1");
gantt.Add(DateTime.Now.AddDays(0), DateTime.Now.AddDays(1), 2, "P2");
Gantt gantt1 = new Gantt();
gantt1.Marks.Visible = true;
gantt1.Add(DateTime.Now.AddDays(-6), DateTime.Now.AddDays(-4), 5, "P3");
gantt1.Add(DateTime.Now.AddDays(-2), DateTime.Now.AddDays(0), 5, "P4");
tChart.Axes.Left.Labels.Style = AxisLabelStyle.Value;
//tChart.Series.Add(serie1);
//tChart.Series.Add(serie2);
tChart.Series.Add(gantt);
tChart.Series.Add(gantt1);
In the CursorChange Event I get the current date of the cursor with :
_currentCursorPositionDate = DateTime.FromOADate(tChart.Series[0].XScreenToValue(e.x));
How Get the Task Name of the series at this datetime ?
Thank you
Regards,
Philippe