While changing the width to 80% in the property window the width automatically became 0px
and this is what caused the error. So I have corrected it.
I can now see the chart OK with the Y Axis fine with increasing numbers and also the Series is OK.
But please help me in regards to the X axis text content.
It currently shows 1 in the center
I tried these lines of codes (one at a time) but seems to do nothing!
ChartProjects.PlotArea.XAxis.AddItem(projectCount)
ChartProjects.PlotArea.XAxis.AxisLabel.TextBlock.Text = dbRow(
"ProjectName").ToString.Substring(0, 2)
Can you help in this regards?
Thanks,
Sanjay

protected void Page_Load(object sender, EventArgs e) { ComboBoxLoadOnDemand cbx = new ComboBoxLoadOnDemand(); cbx.TableName = "ddl_report_collaborator"; cbx.DataTextField = "text_ddl"; cbx.DataValueField = "value_ddl"; cbx.Height = Unit.Pixel(250); cbx.Width = Unit.Pixel(200); cbx.NbItemsRequested = 50; cbx.AutoPostBack = true; cbx.ShowMoreResultsBox = true; this.form1.Controls.Add(cbx); cbx.SelectedIndexChanged += new Telerik.Web.UI.RadComboBoxSelectedIndexChangedEventHandler(cbx_SelectedIndexChanged); } void cbx_SelectedIndexChanged(object sender, Telerik.Web.UI.RadComboBoxSelectedIndexChangedEventArgs e) { ComboBoxLoadOnDemand cbx2 = new ComboBoxLoadOnDemand(); cbx2.TableName = "ddl_report_collaborator"; cbx2.DataTextField = "text_ddl"; cbx2.DataValueField = "value_ddl"; cbx2.Height = Unit.Pixel(250); cbx2.Width = Unit.Pixel(200); cbx2.NbItemsRequested = 50; cbx2.ShowMoreResultsBox = true; this.form1.Controls.Add(cbx2); }
protected void radScheduler_TimeSlotCreated(object sender, TimeSlotCreatedEventArgs e){ // Calculate total hours per day. if (radScheduler.SelectedView == SchedulerViewType.WeekView && e.TimeSlot.Duration.TotalDays == 1) { double totalHoursPerDay = 0; double totalOvertimeHoursPerDay = 0; bool weekend = false; if (e.TimeSlot.Start.DayOfWeek == DayOfWeek.Saturday || e.TimeSlot.Start.DayOfWeek == DayOfWeek.Sunday) { weekend = true; } foreach (Appointment a in radScheduler.Appointments.GetAppointmentsInRange(e.TimeSlot.Start, e.TimeSlot.End)) { // Check time of appointment and adding to hours or overtime accordingly. if (a.Start.TimeOfDay >= new TimeSpan(8, 0, 0) && a.End.TimeOfDay <= new TimeSpan(19, 0, 0) && weekend) { totalOvertimeHoursPerDay += a.Duration.TotalHours; } else if (a.Start.TimeOfDay >= new TimeSpan(8, 0, 0) && a.End.TimeOfDay <= newTimeSpan(17, 0, 0)) { totalHoursPerDay += a.Duration.TotalHours; } else if (a.Start.TimeOfDay > new TimeSpan(17, 0, 0) && a.End.TimeOfDay <= newTimeSpan(19, 0, 0)) { totalOvertimeHoursPerDay += a.Duration.TotalHours; } else if (a.Start.TimeOfDay >= new TimeSpan(8, 0, 0) && a.End.TimeOfDay <= newTimeSpan(19, 0, 0)) { double overtime = a.End.TimeOfDay.TotalHours - 17; totalOvertimeHoursPerDay += overtime; totalHoursPerDay += (a.Duration.TotalHours - overtime); } } Literal hoursLiteral = new Literal(); Literal overtimeLiteral = new Literal(); if (!weekend) { hoursLiteral.Text = "Hrs: " + totalHoursPerDay.ToString(); } overtimeLiteral.Text = " O/T: " + totalOvertimeHoursPerDay.ToString(); radScheduler.Controls.Add(hoursLiteral); radScheduler.Controls.Add(overtimeLiteral); e.TimeSlot.Control.Controls.Add(hoursLiteral); e.TimeSlot.Control.Controls.Add(overtimeLiteral); }}radScheduler.Controls.Add(hoursLiteral);
<
script type="text/javascript">
function mngRequestStartedEAE(ajaxManager, eventArgs) {
if (eventArgs.EventTarget.indexOf("exportCsv") != -1) {
eventArgs.EnableAjax =
false;
}
}
</
script>
<
telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" ClientEvents-OnRequestStart="mngRequestStartedEAE" >
<AjaxSettings> <telerik:AjaxSetting AjaxControlID="content"> <UpdatedControls> <telerik:AjaxUpdatedControl ControlID="content" LoadingPanelID="RadAjaxLoadingPanel1" /> </UpdatedControls> </telerik:AjaxSetting> </AjaxSettings> </telerik:RadAjaxManager>
<telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" Transparency="10" BackColor="#ffffff" CssClass="ajax_loader"> </telerik:RadAjaxLoadingPanel> <asp:Panel ID="content" runat="server" CssClass="MaxW">
<!-- some other controls -->
<asp:LinkButton ID="exportCsv" runat="server" OnClick="exportCsv_Click" Text="Exporter"></asp:LinkButton> <!-- grid declaration ... --></asp:Panel>