Hi,
This may seem very complex but I will try to make it as simple as possible. I am trying to draw a composite chart where the top layer is a Gantt Chart and the bottom layer is a Line Chart. Both the charts need to share the same X Axis. However, the line chart has multiple Y Axis due to which the width of the X Axis reduces. It looks something like this,
I counted the number of Y axis in the Line chart and created equal number of Y axis for the Gantt Charts and made then invisible. That worked for until 2 Y axis but not after that the Gantt chart does not seem to shift. Is there any way in which I can coincide these axis? How many Y Axis can we add to a gantt chart.
Moreover, for the GanttDataSource, I have created a Gantt Series and every new line is a new Task added to that series. Can I make the color change for the bars on the same line? Can 2 TaskItems be added on a same line?
I worked with this datasource on a separate Gantt Chart and I could set the property ShowOwner = true to see the owners. However , after making it a composite chart I cannot see the owners even after setting the properties.
Can you please help?
Thanks,
Ketaki
I'm having a difficult time picturing this behavior and I've never heard of random points appearing in the line. Can you attach a screenshot and/or provide a sample project to reproduce this problem?
Keeping the last point in the line or any collection can be simply done by using a for loop instead of foreach. Something like (for int i=0; i<points.Length-1; i++). This will leave the last item alone.
I have one more problem coming up. I am observing that on one of the lines in my line chart, there are random points drawing in which have no value or tooltip. I surely dont have them in my dataset. I have heard that they can be eliminated using the fill scene graph. But is there any other way in which I can remove those null point. Doing them in the fill scene graph is messing up my ps.icons for different lines.
Here is how I am getting rid of them
foreach (DataPoint goodPoint in line.points)
{
if (goodPoint != null)
if (goodPoint.Value != null)
goodPoint.DataPoint.Label);
dp2[i] = goodPoint;
i++;
}
But then this is deleting the last point on that polyline which is actually point.
So I am writing the following code to get the last point of the line.
My different lines have different icons. This line is somehow taking the icon from other lines. I am trying to draw a character icon on this line. Here is the code where I am drawing the icons again (I have declared them when I am creating the respective layers itself.)
foreach (Primitive p1 in scene)
if (p1 is PointSet)
PointSet ps = p1 as PointSet;
bool bAllGood = true;
foreach (DataPoint dp in ps.points)
if (dp.Empty)
bAllGood = false;
bool resistance_point = false;
if (bAllGood)
resistance_point = ps.character.ToString().Contains("R");
if (resistance_point)
ps.icon = SymbolIcon.Character;
ps.character = 'R';
ps.font = new Font(FontFamily.GenericSansSerif, (float)13.0);
else
ps.icon = SymbolIcon.Circle;
Your help is deeply appreciated.
I was able to use the UltraTooltipManager for the tool tips. Thanks
Thanks a lot. That worked, but the text lines I am putting inside the tooltip are all centered. Can I have them formatted. I am wondering if I can add the UltraToolTipManager to the top chart. Can you please tell me how can I achieve this one? I have never worked with the UltratooltipManager
I am not understanding how I am supposed to add the UltratooltipManager in place of the default tooltips. Moreover How do I put my text for formatting in the UltratooltipManager.
The contents of the context hashtable are different for different data points, so the best way to see those contents is to place a break point in the ToString method and explore the hashtable through the debugger.
If you're using DataItemOver, you don't really need to use a label renderer. You can set the tooltip explicitly in that event:private void ultraChart1_DataItemOver(object sender, Infragistics.UltraChart.Shared.Events.ChartDataEventArgs e){ GanttItem item = e.Primitive.DataPoint as GanttItem; int index = (int) e.Primitive.Tags["TIME_ENTRY_INDEX"]; string tooltip = item.Times[index].Label; ultraChart1.Tooltips.FormatString = tooltip;}
It's also a good idea to reset the format string back to what it was in DataItemOut event, since you are changing the tooltip for the entire chart.