I want to set the X axis start date for my gantt chart to be a specific date. It seems to vary right now because of the percentage tick marks. I want to make the first date the first date of my date spread. How do I do that? Thanks.
I fixed this by using this code...
UltraChart1.Axis.X.RangeType = Infragistics.UltraChart.Shared.Styles.AxisRangeType.Custom;
UltraChart1.Axis.X.RangeMin = lastMonthFirstDate.Ticks;
UltraChart1.Axis.X.RangeMax = lastMonthLastDate.Ticks;
I am now wondering how to get ride to the expand/collapse buttons and just have the scroll bar.
Hello,
Thank you for using our community.
Could you please send me an isolated sample so I can see what properties are you using? By default, there shouldn’t be any collapse/expand buttons. I’ll be waiting for your sample.
Best Regards, Marina Stoyanova, Software Developer, Infragistics, Inc.
I have a few properties set in the .cs file and the rest in the html file. I have pastes both below. I got the code from a sample that someone here provided. Thank you.
private void Page_Load(object sender, System.EventArgs e)
{
UltraChart1.Axis.Y.Extent = 130;
UltraChart1.Axis.X.Extent = 75;
UltraChart1.BackColor = System.Drawing.Color.WhiteSmoke;
UltraChart1.Axis.Y.Labels.SeriesLabels.Font = new System.Drawing.Font("Verdana", 12, System.Drawing.FontStyle.Bold);
UltraChart1.Axis.X.Labels.ItemFormatString = "<ITEM_LABEL:MMM-dd-yy>";
UltraChart1.GanttChart.ItemSpacing = 1;
if (!Page.IsPostBack)
lastMonthLastDate = DateTime.Today.AddDays(0 - DateTime.Today.Day);
lastMonthFirstDate = lastMonthLastDate.AddDays(1 - lastMonthLastDate.Day);
wdpStartDate.Date = lastMonthFirstDate;
wdpEndDate.Date = lastMonthLastDate;
UltraChart1.TitleTop.Visible = true;
UltraChart1.TitleTop.Text = "Travel Between " + wdpStartDate.Date.ToShortDateString() + " and " + wdpEndDate.Date.ToShortDateString();
UltraChart1.TitleTop.HorizontalAlign = System.Drawing.StringAlignment.Center;
UltraChart1.TitleTop.Font = new System.Drawing.Font("Verdana", 15, System.Drawing.FontStyle.Bold);
UltraChart1.TitleTop.VerticalAlign = System.Drawing.StringAlignment.Center;
UltraChart1.TitleTop.Margins.Bottom = 0;
data = GetData(lastMonthFirstDate, lastMonthLastDate);
if(data.Rows.Count > 50)
UltraChart1.Axis.Y.Extent = 160;
UltraChart1.EnableScrollBar = true;
UltraChart1.Axis.Y.ScrollScale.Scale = 1;
UltraChart1.Axis.Y.ScrollScale.Scroll = 0;
UltraChart1.Axis.Y.ScrollScale.Visible = true;
//UltraChart1.Axis.Y.ScrollScale.Width = 15;
//UltraChart1.Axis.Y.ScrollScale.Height = 10;
}
if (data.Rows.Count > 0)
UltraChart1.DataSource = data;
UltraChart1.DataBind();
else
UltraChart1.EmptyChartText = "No Data";
DataTable dt = new DataTable();
dt.Columns.Add("Series", typeof(string));
dt.Columns.Add("TaskTitle", typeof(string));
dt.Columns.Add("GanttStart", typeof(DateTime));
dt.Columns.Add("GanttEnd", typeof(DateTime));
dt.Columns.Add("GanttID", typeof(int));
dt.Columns.Add("Traveler", typeof(string));
dt.Columns.Add("Status", typeof(System.String));
dt.Columns.Add("Frequency", typeof(System.Int32));
dt.Rows.Add(new object[] { "TRAVELER", "None Found", DateTime.MinValue,
DateTime.MinValue, 1, "Unknown" });
UltraChart1.DataSource = dt;
<igchart:UltraChart ID="UltraChart1" runat="server" EnableCrossHair="False" ChartType="GanttChart"
Width="1150px" Height="600px">
<Border CornerRadius="10" DrawStyle="Solid" Raised="False" Color="Black" Thickness="1">
</Border>
<GanttChart ItemSpacing="1"></GanttChart>
<ColorModel ColorBegin="DarkGoldenrod" ColorEnd="Navy" AlphaLevel="150" ModelStyle="CustomSkin"
Grayscale="False" Scaling="None">
<Skin ApplyRowWise="False">
<PEs>
<igchartprop:PaintElement FillGradientStyle="Vertical" FillOpacity="255" FillStopOpacity="255"
ElementType="Gradient" Fill="108, 162, 36" Hatch="None" Texture="LightGrain"
ImageFitStyle="StretchedFit" FillStopColor="148, 244, 17" StrokeOpacity="255"
ImagePath="" Stroke="Black" StrokeWidth="0" ImageWrapMode="Tile" TextureApplication="Normal">
</igchartprop:PaintElement>
ElementType="Gradient" Fill="7, 108, 176" Hatch="None" Texture="LightGrain" ImageFitStyle="StretchedFit"
FillStopColor="53, 200, 255" StrokeOpacity="255" ImagePath="" Stroke="Black"
StrokeWidth="0" ImageWrapMode="Tile" TextureApplication="Normal"></igchartprop:PaintElement>
ElementType="Gradient" Fill="230, 190, 2" Hatch="None" Texture="LightGrain" ImageFitStyle="StretchedFit"
FillStopColor="255, 255, 81" StrokeOpacity="255" ImagePath="" Stroke="Black"
ElementType="Gradient" Fill="215, 0, 5" Hatch="None" Texture="LightGrain" ImageFitStyle="StretchedFit"
FillStopColor="254, 117, 16" StrokeOpacity="255" ImagePath="" Stroke="Black"
ElementType="Gradient" Fill="252, 122, 10" Hatch="None" Texture="LightGrain"
ImageFitStyle="StretchedFit" FillStopColor="255, 108, 66" StrokeOpacity="255"
</PEs>
</Skin>
</ColorModel>
<TitleTop Font="Microsoft Sans Serif, 7.8pt" Visible="False" Text="" FontSizeBestFit="False"
Orientation="Horizontal" WrapText="False" Extent="33" FontColor="Black" HorizontalAlign="Near"
VerticalAlign="Center" Location="Top">
<Margins Bottom="5" Left="5" Top="5" Right="5"></Margins>
</TitleTop>
<GanttChart LinkLineColor="Black">
<LinkLineStyle MidPointAnchors="False" EndStyle="ArrowAnchor" DrawStyle="Solid" StartStyle="NoAnchor">
</LinkLineStyle>
<CompletePercentagesPE FillGradientStyle="None" FillOpacity="255" FillStopOpacity="255"
ElementType="SolidFill" Fill="Yellow" Hatch="None" Texture="LightGrain" ImageFitStyle="StretchedFit"
FillStopColor="Transparent" StrokeOpacity="255" ImagePath="" Stroke="Black" StrokeWidth="1"
ImageWrapMode="Tile" TextureApplication="Normal"></CompletePercentagesPE>
<OwnersLabelStyle Font="Microsoft Sans Serif, 7.8pt" Dy="0" HorizontalAlign="Center"
FontSizeBestFit="False" ClipText="False" Dx="0" RotationAngle="0" Orientation="Horizontal"
WrapText="False" Flip="False" FontColor="Black" VerticalAlign="Center"></OwnersLabelStyle>
<EmptyPercentagesPE FillGradientStyle="None" FillOpacity="255" FillStopOpacity="255"
ElementType="SolidFill" Fill="White" Hatch="None" Texture="LightGrain" ImageFitStyle="StretchedFit"
ImageWrapMode="Tile" TextureApplication="Normal"></EmptyPercentagesPE>
</GanttChart>
<Tooltips BorderThickness="0" Overflow="None" FormatString="<DATA_VALUE:00.##>"
EnableFadingEffect="False" Format="DataValue" FontColor="Black" BorderColor="Black"
Display="MouseMove" BackColor="AntiqueWhite" Padding="5"></Tooltips>
</igchart:UltraChart>
Thank you for providing me your code. The only buttons I see are the plus (+) and minus (-) signs. If those are the buttons, you mentioned – there is no way to remove them, they are part of the chart’s design.
In case you mean some other buttons please send me an image, so I can further investigate.
Thank you for using our products.
I am referring to the +/- buttons. If you go to the Infragistics documentation on axis scrollbars the buttons are not there. Why is that? I want my scrollbar to look the one in this documentation. How do I do that?
http://ko.infragistics.com/samples/aspnet/chart/axis-scrollbars
Hello,In order to achieve such a functionality, you should use only the X scroll bar , meaning that you need to use only EnableScrollBar option. The scroll bar of the Y coordinate goes with the two buttons.
If you have other questions, please let me know.
Regards,
Marina Stoyanova,
Software Engineer,
Infragistics, Inc.
Wow. I can't believe you are coping out by saying you only get just the scroll bar without the buttons on the X axis. The documentation shows the scroll bar without the buttons on BOTH the X and Y axis. I can't get either axis to show only the scroll bar (as indicated by your documentation). If you are going to answer questions, at least don't make up the answers to suit yourself. I have tried the EnableScrollbar option. Maybe you should ask the person that created the documentation.
Thank you for your reply. Glad you were able to resolve the issue. Please do not hesitate to contact me if you have any further questions regarding this matter.
OK. I finally go this to work! Yahoo. That ultrachart is very particular. Thank you for helping!
Hello Natalie,
I have send you an email, please let me know if you are still having troubles with the attached samples.
Software Developer,
Hi Marina. I did not get the attachments. A zip file won't get through. Can you send me the attachment at Natalie.powers@usfalcon.com?
Sorry. Thanks.
Thank you and sorry for the trouble.
I have attached the samples again "charts.zip" (You can find them in this post below my signature).
Please let me know if you still don't see/receive them.