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
The space between the Y axis and the left edge of the chart area is controlled by the Extent property, not the number of axes you have, so lining up the axes on 2 chart areas is actually quite simple. Setting Extent property on your Y axis (it's 80 pixels by default) to something like 130 should give you a good result. You should be able to get perfect alignment with some trial and error. Remember to set Extent on the AxisItem instance in ChartArea.Axes collection, not on UltraWinChart.Axis.Y.
2 tasks cannot be added to the same line. However, each GanttItem has a Times collection. Each time entry in the times collection is placed on the same line and has a PE property, so it can be set to any color. Tasks also have a PE property and can also be set to any color.
Make sure you're setting ShowOwners on the chart appearance object instead of UltraWinChart.GanttChart. The former has no effect in composite charts. For example, this is how you can set ShowOwners in a composite chart:ChartLayerAppearance layer = new ChartLayerAppearance();layer.ChartType = ChartType.GanttChart;GanttChartAppearance appearance = new GanttChartAppearance();appearance.ShowOwners = true;layer.ChartTypeAppearance = appearance;
Thanks. It worked. I have one more problem. I need the dates on the Gantt Charts to be the same as the ones in the line chart below. Is there any way in which I can customize the dates to be the same. I tried to make the X Axis common but the datatype for the line charts in set to String and Gantt Charts only require Time. Is there a way in which I can change it from String to Time. What should I change to get the Axis datatype for the line charts to be Time? If I change the datatype to Time directly, the line graph does not show up.