Hi,
We are using Infra version 6.3. We use GanttChart to display Day\Week\Month wise tasks with in a ASP.Net page.
Problem: Tasks within the chart is not exactly aligned to the corresponding Start and End days (in X2 axis). Tasks are overlapping the Days grid lines and sometimes tasks stop before reaching the End date Grid line.Also last grid line is not drawn.
Steps to reproduce the issue: 1. Create a DB table as required for Gantt Chart2. Drag a Ultra chart to the design and paste the below source in Code behind page to set the properties of the Chart Control.
Please look into the below Source and help me out of this issue.
Thanks,Anandhev
-------------------------------------------------------------------------------------- ----------
private void SetProperties()
{
UltraChart1.ChartType = ChartType.GanttChart;
//-- Show X2 axis and hide X axisUltraChart1.Axis.X.Visible = false;UltraChart1.Axis.X2.Visible = true;
//-- Show the Percentage of completion in ChartUltraChart1.GanttChart.ShowCompletePercentages = true;UltraChart1.Axis.Y.Extent = 130;UltraChart1.Axis.X.Extent = 110;
//-- Hide the Series label in Y axis UltraChart1.Axis.Y.Labels.SeriesLabels.Visible = false;
//-- Percentage of Completion ColorUltraChart1.GanttChart.CompletePercentagesPE.Fill = Color.Green;UltraChart1.GanttChart.CompletePercentagesPE.StrokeOpacity = 0;
UltraChart1.GanttChart.EmptyPercentagesPE.Fill = Color.Transparent; UltraChart1.GanttChart.EmptyPercentagesPE.StrokeOpacity = 0;
//-- Task ColorUltraChart1.Effects.Enabled = false;
//-- No Gradient or any effectsUltraChart1.ColorModel.AlphaLevel = 0;
//-- No ColorModel's Style effectUltraChart1.ColorModel.ModelStyle = ColorModels.CustomSkin;PaintElement pe = new PaintElement();pe.ElementType = PaintElementType.SolidFill;pe.Fill = Color.CornflowerBlue;pe.StrokeOpacity = 255;pe.StrokeWidth = 1;UltraChart1.ColorModel.Skin.PEs.Add(pe);
//-- Remove Grid lines of X2 and Y axisUltraChart1.Axis.X2.MajorGridLines.Visible = false;UltraChart1.Axis.X2.MinorGridLines.Visible = false;UltraChart1.Axis.Y.MajorGridLines.Visible = false;UltraChart1.Axis.Y.MinorGridLines.Visible = false;
//-- X2 axis label formatUltraChart1.Axis.X2.Labels.ItemFormat = AxisItemLabelFormat.Custom;UltraChart1.Axis.X2.Labels.ItemFormatString = "<ITEM_LABEL:ddd, dd-MMM-yy>";
//-- Tooltip formatUltraChart1.Tooltips.Font.Name = "Verdana";UltraChart1.Tooltips.Font.Size = FontUnit.Small;UltraChart1.Tooltips.Format = TooltipStyle.Custom;UltraChart1.Tooltips.FormatString = "<START_TIME:dd-MMM-yy>....<END_TIME:dd-MMM-yy>";
//-- Data Interval Type ==> Days/Weeks/MonthsUltraChart1.Axis.X2.TickmarkStyle = AxisTickStyle.DataInterval;UltraChart1.Axis.X2.TickmarkIntervalType = AxisIntervalType.Days;UltraChart1.Axis.X2.TickmarkInterval = 1;
UltraChart1.Axis.X2.Labels.HorizontalAlign = StringAlignment.Near;UltraChart1.Axis.X2.Labels.VerticalAlign = StringAlignment.Near;UltraChart1.Axis.X2.MajorGridLines.Visible = true;UltraChart1.Axis.X2.MinorGridLines.Visible = true;
UltraChart1.Width = 1500;
}
Unfortunately, GanttChart is aligned to the x-axis. If you want to align to x2-axis, you can try using composite chart.