RadChart: Reference line not visible for 1 bar on x-axis

Thread is closed for posting
8 posts, 0 answers
  1. Priyanka
    Priyanka avatar
    4 posts
    Member since:
    Jul 2011

    Posted 29 Aug 2011 Link to this post

    Hi,

    I am using two series on a single radchart:
    Series 1: Bar
    Series 2: Line (for reference)

    Code:
    /// <summary>
        /// This function creates the refernce line series of RadChart
        /// </summary>
        /// <param name="averageDailyMtdGoal">Average of Daily Goals of the date</param>
        private void CreateReferenceLine(double y)
        {
            // Setting properties of refernce line series
            ChartSeries referenceSeries = radChart.Series[1];
            referenceSeries.Appearance.LineSeriesAppearance.PenStyle = System.Drawing.Drawing2D.DashStyle.Dash;
            referenceSeries.Appearance.LineSeriesAppearance.Width = 1;
            referenceSeries.Items.Add(new ChartSeriesItem(0, y));
            referenceSeries.Items.Add(new ChartSeriesItem(radChart.Series[0].Items.Count + 0.5, y));
            referenceSeries.DefaultLabelValue = averageDailyMtdGoal.ToString() + "%";
            referenceSeries.Appearance.LabelAppearance.Visible = true;
            referenceSeries.Appearance.FillStyle.MainColor = Color.Red;
        }

    PFA snapshots of two cases:
    Case 1: Snapshot ReferenceLine_Visible.png: when there are more than one bars, the reference line is visible, which is an expected functionality.
    Case 2: Snapshot Reference line_Not visible.png: shows the case when there is only one bar on the x-axis. It does not show the reference line.

    I want to show the reference line in both the cases. Please help.

    Thanks & Regards,
    Priyanka Sethi

  2. Evgenia
    Admin
    Evgenia avatar
    1407 posts

    Posted 01 Sep 2011 Link to this post

    Hello Priyanka,

    It is hard for me to determine the cause of the issue you are facing. Can you send us the full source code so that we can inspect it and get back to you with our findings?

    All the best,
    Evgenia
    the Telerik team

    Thank you for being the most amazing .NET community! Your unfailing support is what helps us charge forward! We'd appreciate your vote for Telerik in this year's DevProConnections Awards. We are competing in mind-blowing 20 categories and every vote counts! VOTE for Telerik NOW >>

  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Priyanka
    Priyanka avatar
    4 posts
    Member since:
    Jul 2011

    Posted 02 Sep 2011 Link to this post

    Hi Evgenia,

    Thanks for your reply.

    I tried to attach the .cs file & .aspx file but I guess these are not supported types of attachment. Please find below, the code of those files. These files have many usercontrols so I am sorry for the trouble. But it has all the details of how I have implemented the radchart. Please let me know if there is something wrong I am doing with the reference line I am trying to draw.

    DailyMtdGoal.aspx
    <%@ Page Title="" Language="C#" MasterPageFile="~/MasterPages/UserMaster.master"
        AutoEventWireup="true" CodeFile="DailyMTDGoal.aspx.cs" Inherits="Dashboard_DailyMTDGoal" %>

    <%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
    <%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Charting" TagPrefix="telerik" %>

    <asp:Content ID="Content2" ContentPlaceHolderID="PageContent" runat="Server">
        <asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Always">
            <ContentTemplate>
                <script type="text/javascript">
                    function ClearErrorMessagePanel(objFocus, lblErrorMessage, validatePage) {
                        if (document.getElementById(lblErrorMessage) != null) {
                            document.getElementById(lblErrorMessage).style.display = "none";
                        }
                        if (validatePage) {
                            Page_ClientValidate();
                        }
                        document.getElementById(objFocus).focus();
                        return true;
                    }
                </script>
                <div class="contentarea" id="dashboard" runat="server">
                    <!-- InstanceBeginEditable name="contentarea" -->
                    <table width="100%" border="0" cellspacing="0" cellpadding="0">
                        <tr>
                            <td width="20">
                                &nbsp;
                            </td>
                            <td>
                                <table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
                                    <tr>
                                        <td>
                                            <table width="346" border="0" cellpadding="0" cellspacing="0">
                                                <tr>
                                                    <td width="127" valign="bottom">
                                                        <APEX:ThemedImageButton ID="thmImgBtnAvgMTDGoal" runat="server" ImageUrl="Images/tab_AverageMTDGoal.png"
                                                            meta:resourcekey="thmImgBtnAvgMTDGoal" />
                                                    </td>
                                                    <td width="101" valign="bottom">
                                                        <APEX:ThemedImageButton ID="thmImgBtnMonthlyMTDGoal" runat="server" ImageUrl="Images/tabD_Dashboard3.png"
                                                            meta:resourcekey="thmImgBtnMonthlyMTDGoal" />
                                                    </td>
                                                    <td width="118" align="center" valign="bottom">
                                                        <APEX:ThemedImageButton ID="thmImgBtnUnassignedVolume" runat="server" ImageUrl="Images/tabD_FacilityVolume.png"
                                                            meta:resourcekey="thmImgBtnUnassignedVolume" />
                                                    </td>
                                                </tr>
                                            </table>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>
                                            &nbsp;
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>
                                            <APEX:ThemedImage ID="thmImgHeadDashboard" runat="server" ImageUrl="Images/Heading_Dashboard.png"
                                                meta:resourcekey="thmImgHeadDashboard" />
                                        </td>
                                    </tr>
                                    <tr id="rowMessagePanel" runat="server">
                                        <td>
                                            <APEXMessagePanel:APEXMessagePanel ID="messagePanel" runat="server" />
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>
                                            <asp:ValidationSummary ID="vldSmrViewDate" runat="server" CssClass="errormessageband"
                                                Visible="true" DisplayMode="List" ValidationGroup="vgViewDate" />
                                            <asp:ValidationSummary ID="vldSmrCalculate" runat="server" CssClass="errormessageband"
                                                Visible="true" DisplayMode="List" ValidationGroup="vgCalculate" />
                                            <asp:ValidationSummary ID="vldSmrPageNumber" runat="server" CssClass="errormessageband"
                                                Visible="true" DisplayMode="List" ValidationGroup="vgPageNumber" />
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>
                                            <table width="100%" border="0" cellspacing="0" cellpadding="0">
                                                <tr>
                                                    <td width="20" valign="top" id="dashboardtopleft">
                                                        &nbsp;
                                                    </td>
                                                    <td valign="top" id="dashboardtopmid" colspan="2">
                                                        <table width="100%" border="0" cellspacing="0" cellpadding="0">
                                                            <tr>
                                                                <td align="left" valign="middle">
                                                                    <table width="350" border="0" cellspacing="0" cellpadding="2">
                                                                        <tr>
                                                                            <td>
                                                                                <APEX:ExtendedLabel ID="lblSelectDate" runat="server" meta:resourcekey="lblSelectDate"></APEX:ExtendedLabel>
                                                                            </td>
                                                                            <td>
                                                                                <ucCal:UserControls_Calendar runat="server" ID="calDate" AutoPostBack="false" IsRequired="false"
                                                                                    TextBoxWidth="100" TabOrder="0" EnableTheming="false" ErrorMessage="Invalid Date"
                                                                                    ValidationGroup="vgViewDate" />
                                                                            </td>
                                                                            <td>
                                                                                <APEX:ThemedImageButton ID="thmImgBtnView" runat="server" ImageUrl="Images/view.png"
                                                                                    OnClick="thmImgBtnView_Click" TabIndex="1" meta:resourcekey="thmImgBtnView" ValidationGroup="vgViewDate" />
                                                                            </td>
                                                                        </tr>
                                                                    </table>
                                                                </td>
                                                                <td width="175" align="right">
                                                                    <APEX:ExtendedLabel ID="lblAvgMtdGoal" runat="server" meta:resourcekey="lblAvgMtdGoal"></APEX:ExtendedLabel>
                                                                    &nbsp;
                                                                </td>
                                                                <td width="100">
                                                                    <APEX:ExtendedTextBox ID="txtAvgMTDGoal" runat="server" CssClass="formtxtbox" TabIndex="2"
                                                                        MaxLength="3" ValidationGroup="vgCalculate"></APEX:ExtendedTextBox>
                                                                </td>
                                                                <td>
                                                                    &nbsp;
                                                                    <asp:RangeValidator ID="rvCalculateAvgMTD" runat="server" meta:resourcekey="rvCalculateAvgMTD"
                                                                        ControlToValidate="txtAvgMTDGoal" SetFocusOnError="true" Display="Dynamic" ForeColor="Red"
                                                                        ValidationGroup="vgCalculate"></asp:RangeValidator>
                                                                </td>
                                                                <td width="90" align="right">
                                                                    <APEX:ThemedImageButton ID="thmImgBtnRecalculate" runat="server" ImageUrl="Images/btn_recalculate.png"
                                                                        meta:resourcekey="thmImgBtnRecalculate" TabIndex="3" OnClick="thmImgBtnRecalculate_Click"
                                                                        ValidationGroup="vgCalculate" />
                                                                </td>
                                                            </tr>
                                                        </table>
                                                    </td>
                                                    <td width="20" valign="top" id="dashboardtopright">
                                                        &nbsp;
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td height="42" valign="top" id="squareareamidleft">
                                                        &nbsp;
                                                    </td>
                                                    <td height="52" valign="middle" bgcolor="#FFFFFF" colspan="2">
                                                        <table border="0" cellspacing="5" cellpadding="0" width="100%">
                                                            <tr>
                                                                <td width="40">
                                                                    &nbsp;
                                                                </td>
                                                                <td>
                                                                    <APEX:ExtendedLabel ID="lblView" runat="server" meta:resourcekey="lblView"></APEX:ExtendedLabel>
                                                                </td>
                                                                <td>
                                                                    <asp:DropDownList ID="ddlView" runat="server" OnSelectedIndexChanged="ddlView_SelectedIndexChanged"
                                                                        AutoPostBack="True" TabIndex="4">
                                                                    </asp:DropDownList>
                                                                </td>
                                                                <td>
                                                                    <APEX:ExtendedLabel ID="lblSortBy" runat="server" meta:resourcekey="lblSortBy"></APEX:ExtendedLabel>
                                                                </td>
                                                                <td>
                                                                    <asp:DropDownList ID="ddlSortOrder" runat="server" OnSelectedIndexChanged="ddlSortOrder_SelectedIndexChanged"
                                                                        AutoPostBack="True" TabIndex="5">
                                                                    </asp:DropDownList>
                                                                </td>
                                                                <td>
                                                                    <asp:CheckBox ID="cbOverriddenOnTop" runat="server"
                                                                        meta:resourcekey="cbOverriddenOnTop" AutoPostBack="True"
                                                                        oncheckedchanged="cbOverriddenOnTop_CheckedChanged" />
                                                                </td>
                                                                <td align="right" width="*">
                                                                    <div>
                                                                        <APEX:ThemedImageButton ID="thmImgBtnFirst" runat="server" ImageUrl="Images/pgfirst.jpg"
                                                                            meta:resourcekey="thmImgBtnFirst" TabIndex="6" OnClick="thmImgBtnFirst_Click" />&nbsp;
                                                                        <APEX:ThemedImageButton ID="thmImgBtnPrevious" runat="server" ImageUrl="Images/pgback.jpg"
                                                                            meta:resourcekey="thmImgBtnPrevious" TabIndex="7" OnClick="thmImgBtnPrevious_Click" />&nbsp;                                                                   
                                                                        <APEX:ExtendedLabel ID="lblPageCounter" runat="server" CssClass="label-facility-counter"
                                                                            meta:resourcekey="lblPageCounter" ></APEX:ExtendedLabel>&nbsp;
                                                                        <APEX:ExtendedTextBox ID="txtPageNo" runat="server" CssClass="txtboxPageNumber" Width="17px"
                                                                            Height="13px" meta:resourcekey="txtPageNo" TabIndex="8" OnTextChanged="txtPageNo_TextChanged"
                                                                            AutoPostBack="True" ValidationGroup="vgPageNumber"></APEX:ExtendedTextBox>
                                                                        <asp:RequiredFieldValidator ID="rfvPageNumber" runat="server" meta:resourcekey="rfvPageNumber"
                                                                            ControlToValidate="txtPageNo" SetFocusOnError="true" Display="Dynamic" ForeColor="Red"
                                                                            ValidationGroup="vgPageNumber"></asp:RequiredFieldValidator>
                                                                        <asp:RangeValidator ID="rvPageNo" runat="server" meta:resourcekey="rvPageNo" ControlToValidate="txtPageNo"
                                                                            SetFocusOnError="true" Display="Dynamic" ForeColor="Red"
                                                                            ValidationGroup="vgPageNumber"></asp:RangeValidator>
                                                                        <APEX:ExtendedLabel ID="lblTotalPages" runat="server" CssClass="label-facility-counter"
                                                                            meta:resourcekey="lblTotalPages" ></APEX:ExtendedLabel>&nbsp;
                                                                        <APEX:ThemedImageButton ID="thmImgBtnNext" runat="server" ImageUrl="Images/pgnext.jpg"
                                                                            meta:resourcekey="thmImgBtnNext" TabIndex="9" OnClick="thmImgBtnNext_Click" />&nbsp;
                                                                        <APEX:ThemedImageButton ID="thmImgBtnLast" runat="server" ImageUrl="Images/pglast.jpg"
                                                                            meta:resourcekey="thmImgBtnLast" TabIndex="10" OnClick="thmImgBtnLast_Click" />
                                                                    </div>
                                                                </td>
                                                            </tr>
                                                        </table>
                                                    </td>
                                                    <td valign="top" id="squareareamidright">
                                                        &nbsp;
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td valign="top" id="squareareamidleft">
                                                        &nbsp;
                                                    </td>
                                                    <td>
                                                        <table width="100%">
                                                            <tr>
                                                                <td>
                                                                    <div style="width: 100%">
                                                                        <asp:UpdatePanel ID="updNoDataMessage" runat="server">
                                                                            <ContentTemplate>                                                                           
                                                                                <asp:Panel runat="server" EnableViewState="False" Visible="False" ID="pnlNoDataErrorMessage">
                                                                                    <table style="border-collapse: collapse;" width="100%" cellpadding="2" cellspacing="1">
                                                                                        <tr align="center">
                                                                                            <td class="errormessageband">
                                                                                                &nbsp;<asp:Label runat="server" ID="lblNoDataErrorMessage" EnableViewState="False"></asp:Label>
                                                                                            </td>
                                                                                        </tr>
                                                                                    </table>
                                                                                </asp:Panel>
                                                                            </ContentTemplate>
                                                                        </asp:UpdatePanel>
                                                                    </div>
                                                                </td>
                                                            </tr>
                                                        </table>
                                                    </td>
                                                    <td valign="top" id="squareareamidright">
                                                        &nbsp;
                                                    </td>
                                                </tr>
                                                <tr id="rowRadChart" runat="server">
                                                    <td valign="top" id="squareareamidleft">
                                                        &nbsp;
                                                    </td>
                                                    <td height="400" valign="top" bgcolor="#FFFFFF" colspan="2">
                                                        <p>
                                                            <telerik:RadChart ID="radChart" runat="server" Width="980px" Skin="Gray" SeriesOrientation="Horizontal"
                                                                OnItemDataBound="radChart_ItemDataBound" Height="700px">
                                                                <Legend Visible="true">
                                                                    <Appearance Dimensions-Margins="17.6%, 3%, 1px, 1px" Dimensions-Paddings="2px, 8px, 6px, 3px"
                                                                        Position-AlignedPosition="TopRight" Visible="False">
                                                                        <ItemTextAppearance TextProperties-Color="DimGray">
                                                                        </ItemTextAppearance>
                                                                        <ItemMarkerAppearance Figure="Square">
                                                                            <Border Width="0" />
                                                                            <Border Width="0"></Border>
                                                                        </ItemMarkerAppearance>
                                                                        <FillStyle MainColor="">
                                                                        </FillStyle>
                                                                        <Border Color="DimGray" Width="0"></Border>
                                                                    </Appearance>
                                                                </Legend>
                                                                <PlotArea>
                                                                    <XAxis>
                                                                        <Appearance Color="182, 182, 182" MajorTick-Color="216, 216, 216">
                                                                            <MajorGridLines Width="1" Color="Silver" PenStyle="Solid" Visible="false"></MajorGridLines>
                                                                            <TextAppearance TextProperties-Color="51, 51, 51">
                                                                            </TextAppearance>
                                                                        </Appearance>
                                                                        <AxisLabel>
                                                                            <Appearance RotationAngle="270">
                                                                            </Appearance>
                                                                            <TextBlock>
                                                                                <Appearance TextProperties-Font="Verdana, 9.75pt, style=Bold" TextProperties-Color="51, 51, 51">
                                                                                </Appearance>
                                                                            </TextBlock>
                                                                        </AxisLabel>
                                                                    </XAxis>
                                                                    <YAxis>
                                                                        <ScaleBreaks Line-Visible="False">
                                                                        </ScaleBreaks>
                                                                        <Appearance Color="182, 182, 182" MajorTick-Color="216, 216, 216" MinorTick-Color="223, 223, 223">
                                                                            <MajorGridLines Color="DimGray" Visible="False"></MajorGridLines>
                                                                            <MinorGridLines Color="223, 223, 223" Visible="False" />
                                                                            <MinorGridLines Color="223, 223, 223"></MinorGridLines>
                                                                            <TextAppearance TextProperties-Color="51, 51, 51">
                                                                            </TextAppearance>
                                                                        </Appearance>
                                                                        <AxisLabel>
                                                                            <Appearance RotationAngle="0">
                                                                            </Appearance>
                                                                            <TextBlock>
                                                                                <Appearance TextProperties-Font="Verdana, 9.75pt, style=Bold" TextProperties-Color="51, 51, 51">
                                                                                </Appearance>
                                                                            </TextBlock>
                                                                        </AxisLabel>
                                                                    </YAxis>
                                                                    <YAxis2>
                                                                        <ScaleBreaks Line-Visible="False">
                                                                        </ScaleBreaks>
                                                                        <AxisLabel>
                                                                            <Appearance RotationAngle="0">
                                                                            </Appearance>
                                                                            <TextBlock>
                                                                                <Appearance TextProperties-Font="Verdana, 9.75pt, style=Bold">
                                                                                </Appearance>
                                                                            </TextBlock>
                                                                        </AxisLabel>
                                                                    </YAxis2>
                                                                    <Appearance Dimensions-Margins="3%, 0px, 11%, 8%" Corners="Round, Round, Round, Round, 3">
                                                                        <FillStyle MainColor="White" FillType="Solid">
                                                                        </FillStyle>
                                                                        <Border Color="DimGray"></Border>
                                                                    </Appearance>
                                                                </PlotArea>
                                                                <ChartTitle Visible="False">
                                                                    <Appearance Visible="False">
                                                                        <FillStyle MainColor="224, 224, 224" GammaCorrection="False">
                                                                        </FillStyle>
                                                                        <Border Color="DimGray"></Border>
                                                                    </Appearance>
                                                                    <TextBlock>
                                                                        <Appearance TextProperties-Font="Verdana, 11.25pt" TextProperties-Color="102, 102, 102">
                                                                        </Appearance>
                                                                    </TextBlock>
                                                                </ChartTitle>
                                                                <Appearance Corners="Round, Round, Round, Round, 7">
                                                                    <Border Visible="False" />
                                                                    <FillStyle FillType="ComplexGradient">
                                                                        <FillSettings GradientMode="Horizontal">
                                                                            <ComplexGradient>
                                                                                <telerik:GradientElement Color="236, 236, 236" />
                                                                                <telerik:GradientElement Color="248, 248, 248" Position="0.5" />
                                                                                <telerik:GradientElement Color="236, 236, 236" Position="1" />
                                                                            </ComplexGradient>
                                                                        </FillSettings>
                                                                    </FillStyle>
                                                                    <Border Visible="False" Color="130, 130, 130"></Border>
                                                                </Appearance>
                                                                <Series>
                                                                    <telerik:ChartSeries Name="Series1" Type="Bar">
                                                                        <Appearance>
                                                                            <FillStyle MainColor="255, 206, 38" SecondColor="255, 247, 221">
                                                                            </FillStyle>
                                                                            <TextAppearance TextProperties-Font="Arial, 8pt">
                                                                            </TextAppearance>
                                                                            <Border Color="DimGray"></Border>
                                                                        </Appearance>
                                                                    </telerik:ChartSeries>
                                                                    <telerik:ChartSeries Name="Series2" Type="Point" ActiveRegionToolTip="#Y%" DefaultLabelValue="#Y%"
                                                                        Appearance-ShowLabelConnectors="False">
                                                                        <Appearance>
                                                                            <LabelAppearance LabelLocation="Outside">
                                                                            </LabelAppearance>
                                                                            <FillStyle MainColor="99, 99, 99" SecondColor="231, 231, 231">
                                                                            </FillStyle>
                                                                            <TextAppearance TextProperties-Font="Arial, 7pt, style=Bold">
                                                                            </TextAppearance>
                                                                            <Border Color="DimGray"></Border>
                                                                        </Appearance>
                                                                    </telerik:ChartSeries>
                                                                    <telerik:ChartSeries Name="Series3" Type="Line">
                                                                        <Appearance>
                                                                            <FillStyle>
                                                                                <FillSettings>
                                                                                    <ComplexGradient>
                                                                                        <telerik:GradientElement Color="234, 234, 234" />
                                                                                        <telerik:GradientElement Color="222, 222, 222" Position="0.5" />
                                                                                        <telerik:GradientElement Color="197, 197, 197" Position="1" />
                                                                                    </ComplexGradient>
                                                                                </FillSettings>
                                                                            </FillStyle>
                                                                            <TextAppearance TextProperties-Font="Arial, 8pt">
                                                                            </TextAppearance>
                                                                            <Border></Border>
                                                                        </Appearance>
                                                                    </telerik:ChartSeries>
                                                                </Series>
                                                            </telerik:RadChart>
                                                            <telerik:RadSkinManager ID="RadSkinManager1" runat="server">
                                                            </telerik:RadSkinManager>
                                                        </p>
                                                    </td>
                                                    <td valign="top" id="squareareamidright">
                                                        &nbsp;
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td valign="top" id="squareareabottomleft">
                                                    </td>
                                                    <td valign="top" id="squareareabottommid" colspan="2">
                                                    </td>
                                                    <td valign="top" id="squareareabottomright">
                                                    </td>
                                                </tr>
                                            </table>
                                        </td>
                                    </tr>
                                </table>
                            </td>
                        </tr>
                    </table>
                    </td> </tr> </table> </td>
                    <td width="20">
                        &nbsp;
                    </td>
                    </tr> </table>
                    <!-- InstanceEndEditable -->
                </div>
            </ContentTemplate>
        </asp:UpdatePanel>
    </asp:Content>
    ____________________________________________________________________

    DailyMtdGoal.aspx.cs
    using System;
    using System.Collections.Generic;
    using System.Drawing;
    using System.Web.UI;
    using Telerik.Charting;
    using System.Diagnostics;
    using System.Web.UI.WebControls;

    public partial class Dashboard_DailyMTDGoal : PageBase
    {
        #region Private Constants

        private const string CLASSNAME = "Dashboard_DailyMTDGoal ";
        private const string REFERENCE_LINE = "Reference line";
        private const string DEFAULT_CALENDARDATE = "1/1/0001 12:00:00 AM";
        private const string PAGEINDEX = "pageIndex";
        private const string CHARTDATE = "chartDate";
        private const string TOTALNUMBEROFPAGES = "totalNoOfPages";

        #endregion

        #region Private Members

        private double averageDailyMtdGoal;

        /// <summary>
        /// Gets Page Permission
        /// </summary>
        private string PagePermission
        {
            get
            {
                return Resources.PermissionSet.ViewDailyMTDGoalDashboard;
            }
        }

        /// <summary>
        /// This Function set up Default Attributes
        /// </summary>
        private void SetDefault()
        {
            //Set Default focus and Default Button
            Page.Form.DefaultFocus = calDate.TextBoxClientID;
            Page.Form.DefaultButton = thmImgBtnView.UniqueID;
        }
        #endregion

        #region Protected Members

        /// <summary>
        /// Page Load Handler
        /// </summary>
        /// <param name="sender">Sender of the event</param>
        /// <param name="e">Event arguments</param>
        protected void Page_Load(object sender, EventArgs e)
        {
            this.Page.ClientScript.RegisterClientScriptInclude(this.GetType(), "Javascript", this.ResolveClientUrl("~/Javascript/APEXScript.js"));

            // Add key press event with page textbox
            txtPageNo.Attributes["onkeypress"] = "javascript:PageChange_Click('" + txtPageNo.ClientID + "');";

            // View        
            thmImgBtnView.Attributes["onclick"] = "javascript:ClearErrorMessagePanel('" + calDate.TextBoxClientID + "','" + messagePanel.FindControl(PageConstants.LABEL_ERRORMESSAGE).ClientID + "','True');";

            //Check is the user has permission to view the page
            CheckUserPermission();

            if (!Page.IsPostBack)
            {
                // Set Title
                SetTitle(GetLocalResourceObject("Page.Title").ToString());

                // Load Controls
                LoadControls();

                // Set Default Date
                calDate.Value = System.DateTime.Now.Date;
                ViewState[CHARTDATE] = calDate.Value;

                // Load RadChart with today's data
                GetFacilityDetailsForDailyGoalDashboard(PageConstants.PAGE_ONE);

            }       

            // Set Default values
            SetDefault();

            //Permission Based Control
            PermissionBasedControl();

            object msg = Context.Items["message"];
            if (msg != null)
            {
                PageMessageType msgType = (PageMessageType)Context.Items["messageType"];
                SetMessage(msg.ToString(), msgType);
                if (msgType == PageMessageType.ErrorMessage)
                    return;
            }
            messagePanel.YesBtnClicked += new EventHandler(MessagePanel_UpdateAvgMTDGoal);
            messagePanel.NoBtnClicked += new EventHandler(MessagePanel_CancelUpdateAvgMTDGoal);
        }

        /// <summary>
        /// Handles selection done in View DropDownlist
        /// </summary>
        /// <param name="sender">Sender of the event</param>
        /// <param name="e">Event arguments</param>
        protected void ddlView_SelectedIndexChanged(object sender, EventArgs e)
        {
            GetFacilityDetailsForDailyGoalDashboard(PageConstants.PAGE_ONE);
        }

        /// <summary>
        /// Handles selection done in SortOrder DropDownlist
        /// </summary>
        /// <param name="sender">Sender of the event</param>
        /// <param name="e">Event arguments</param>
        protected void ddlSortOrder_SelectedIndexChanged(object sender, EventArgs e)
        {
            GetFacilityDetailsForDailyGoalDashboard(PageConstants.PAGE_ONE);
        }

        /// <summary>
        /// Handles click event of View themed button
        /// </summary>
        /// <param name="sender">Sender of the event</param>
        /// <param name="e">Event arguments</param>
        protected void thmImgBtnView_Click(object sender, ImageClickEventArgs e)
        {
            if (calDate.Value != Convert.ToDateTime(DEFAULT_CALENDARDATE))
            {
                ViewState[CHARTDATE] = calDate.Value.Date;
            }
            GetFacilityDetailsForDailyGoalDashboard(PageConstants.PAGE_ONE);
        }

        /// <summary>
        /// Sets bar color on the basis of TodayGoalToDate value
        /// </summary>
        /// <param name="sender">Sender of the event</param>
        /// <param name="e">Event arguments</param>
        protected void radChart_ItemDataBound(object sender, ChartItemDataBoundEventArgs e)
        {
            Color color = new Color();

            /* Green: Above Refernce Line
                * Yellow: Within 25% less than refernce line
                * Red: Below 25% less than reference line
                */

            foreach (ChartSeriesItem item in radChart.Series[0].Items)
            {
                // Red
                if (item.YValue >= 0 && item.YValue < (PageConstants.CHART_RANGE_PARAMETER * averageDailyMtdGoal))
                {
                    color = Color.FromArgb(243, 92, 83);
                }
                // Yellow
                else if (item.YValue >= (averageDailyMtdGoal * PageConstants.CHART_RANGE_PARAMETER) && item.YValue < averageDailyMtdGoal)
                {
                    color = Color.FromArgb(250, 233, 125);
                }
                // Green
                else if (item.YValue >= averageDailyMtdGoal)
                {
                    color = Color.FromArgb(162, 204, 18);
                }
                item.Appearance.FillStyle.MainColor = color;
                item.Appearance.Border.Color = color;
                item.Appearance.FillStyle.FillType = Telerik.Charting.Styles.FillType.Solid;
                item.Appearance.Corners.TopRight = Telerik.Charting.Styles.CornerType.Round;
                item.Appearance.Corners.BottomRight = Telerik.Charting.Styles.CornerType.Round;
            }
        }

        /// <summary>
        /// Displays facilities of first page in radchart
        /// </summary>
        /// <param name="sender">Sender of the event</param>
        /// <param name="e">Event arguments</param>
        protected void thmImgBtnFirst_Click(object sender, ImageClickEventArgs e)
        {
            GetFacilityDetailsForDailyGoalDashboard(PageConstants.PAGE_ONE);
        }

        /// <summary>
        /// Displays facilities of previous page in radchart
        /// </summary>
        /// <param name="sender">Sender of the event</param>
        /// <param name="e">Event arguments</param>
        protected void thmImgBtnPrevious_Click(object sender, ImageClickEventArgs e)
        {
            if (Convert.ToInt16(txtPageNo.Text) > PageConstants.PAGE_ONE && Convert.ToInt16(txtPageNo.Text) <= Convert.ToInt16(ViewState[TOTALNUMBEROFPAGES]))
            {
                GetFacilityDetailsForDailyGoalDashboard((short)(Convert.ToInt16(ViewState[PAGEINDEX]) - 1));
            }
        }

        /// <summary>
        /// Displays facilities of next page in radchart
        /// </summary>
        /// <param name="sender">Sender of the event</param>
        /// <param name="e">Event arguments</param>
        protected void thmImgBtnNext_Click(object sender, ImageClickEventArgs e)
        {
            if (Convert.ToInt16(txtPageNo.Text) >= PageConstants.PAGE_ONE && Convert.ToInt16(txtPageNo.Text) < Convert.ToInt16(ViewState[TOTALNUMBEROFPAGES]))
            {
                GetFacilityDetailsForDailyGoalDashboard((short)(Convert.ToInt16(ViewState[PAGEINDEX]) + 1));
            }
        }

        /// <summary>
        /// Displays facilities of last page in radchart
        /// </summary>
        /// <param name="sender">Sender of the event</param>
        /// <param name="e">Event arguments</param>
        protected void thmImgBtnLast_Click(object sender, ImageClickEventArgs e)
        {
            GetFacilityDetailsForDailyGoalDashboard(Convert.ToInt16(ViewState[TOTALNUMBEROFPAGES]));
        }

        /// <summary>
        /// Handles Override facilities on top checked box event
        /// </summary>
        /// <param name="sender">Sender of the event</param>
        /// <param name="e">Event arguments</param>
        protected void cbOverriddenOnTop_CheckedChanged(object sender, EventArgs e)
        {
            GetFacilityDetailsForDailyGoalDashboard((short)(Convert.ToInt16(ViewState[PAGEINDEX])));
        }

        /// <summary>
        /// Handles manual page change of radchart
        /// </summary>
        /// <param name="sender">Sender of the event</param>
        /// <param name="e">Event arguments</param>
        protected void txtPageNo_TextChanged(object sender, EventArgs e)
        {
            if (String.IsNullOrEmpty(txtPageNo.Text))
            {
                rfvPageNumber.IsValid = false;
                //SetMessage(Resources.ErrorMessagesResource.ResourceManager.GetString(ExceptionCodeConstants.INVALID_PAGE.ToString()), PageMessageType.ErrorMessage);
            }
            else if (Convert.ToInt16(txtPageNo.Text) >= PageConstants.PAGE_ONE && Convert.ToInt16(txtPageNo.Text) <= Convert.ToInt16(ViewState[TOTALNUMBEROFPAGES]))
            {
                GetFacilityDetailsForDailyGoalDashboard(Convert.ToInt16(txtPageNo.Text));
            }
            else
            {
                rvPageNo.ErrorMessage = rvPageNo.ErrorMessage + PageConstants.SPACE + ViewState[TOTALNUMBEROFPAGES].ToString();
                rvPageNo.IsValid = false;
                txtPageNo.Text = ViewState[PAGEINDEX].ToString();
                //SetMessage(Resources.ErrorMessagesResource.ResourceManager.GetString(ExceptionCodeConstants.INVALID_PAGE.ToString()), PageMessageType.ErrorMessage);
            }
        }

        /// <summary>
        /// Handles Recalculation Average MTD Goal event
        /// </summary>
        /// <param name="sender">Sender of the event</param>
        /// <param name="e">Event arguments</param>
        protected void thmImgBtnRecalculate_Click(object sender, ImageClickEventArgs e)
        {
            SetChartLegend();
            if (!String.IsNullOrEmpty(txtAvgMTDGoal.Text))
            {
                txtAvgMTDGoal.Enabled = false;
                thmImgBtnRecalculate.Enabled = false;
                SetMessage(Resources.ErrorMessagesResource.ResourceManager.GetString(ExceptionCodeConstants.CHANGE_AVGMTDGOAL.ToString()), PageMessageType.WarningMessage);
            }
            else
            {
                SetMessage(Resources.ErrorMessagesResource.ResourceManager.GetString(ExceptionCodeConstants.MANDATORY_AVGMTDGOAL.ToString()), PageMessageType.ErrorMessage);
            }
            return;
        }
        #endregion

        # region Private Functions

        /// <summary>
        /// Delegate to update Average MTD Goal
        /// </summary>
        /// <param name="sender">Sender of the event</param>
        /// <param name="e">Event arguments</param>
        private void MessagePanel_UpdateAvgMTDGoal(object sender, EventArgs e)
        {
            short statusCode = 0;
           
            FacilityController dailyFacilityController = new FacilityController();
            string activeFacilitiesXml = string.Empty;
            string pendingVerificationXml = string.Empty;
            string pendingCoderXml = string.Empty;

            try
            {
                activeFacilitiesXml = dailyFacilityController.GetActiveFacilitiesForDailyGoal();
                pendingVerificationXml = dailyFacilityController.GetOnBasePendingChartsForDailyGoal(CacheHelper.OnBaseQueryTimeOut, activeFacilitiesXml, CacheHelper.OnBaseVerificationLCVerifierWorkingQueue, CacheHelper.OnBaseDeletionStatusId, CacheHelper.OnBaseFacilityCodeKeywordId, CacheHelper.OnBasePatientChartDocTypeId);
                pendingCoderXml = dailyFacilityController.GetOnBasePendingChartsForDailyGoal(CacheHelper.OnBaseQueryTimeOut, activeFacilitiesXml, CacheHelper.OnBaseCodingLCCodingWorkingQueue, CacheHelper.OnBaseDeletionStatusId, CacheHelper.OnBaseFacilityCodeKeywordId, CacheHelper.OnBasePatientChartDocTypeId);
                statusCode = dailyFacilityController.UpdateFacilityAvgMtdGoalAndCatchUp(DateTime.Now.Date, Convert.ToDecimal(txtAvgMTDGoal.Text),pendingVerificationXml,pendingCoderXml,  SessionHelper.UserCustomPrincipal.UserIdentity.UserId, DateTime.Now);

                if (statusCode == PageConstants.ZERO)
                {
                    GetFacilityDetailsForDailyGoalDashboard(PageConstants.PAGE_ONE);
                    txtAvgMTDGoal.Text = string.Empty;
                    txtAvgMTDGoal.Enabled = true;
                    thmImgBtnRecalculate.Enabled = true;               
                    SetMessage(Resources.ErrorMessagesResource.ResourceManager.GetString(ExceptionCodeConstants.AVGMTDGOAL_CHANGED.ToString()), PageMessageType.SuccessMessage);
                }

            }       
            catch (BaseException ex)
            {
                SetMessage(Resources.ErrorMessagesResource.ResourceManager.GetString(ex.ExceptionCode.ToString()), PageMessageType.ErrorMessage);
            }
            catch (Exception ex)
            {
                SetMessage(Resources.ErrorMessagesResource.ResourceManager.GetString(ExceptionCodeConstants.GENERIC_EXCEPTION_CODE.ToString()), PageMessageType.ErrorMessage);

                LogCategory[] logCategory = { LogCategory.Error };
                WebLogHelper.WebLogMessage(UtilityMethods.FormatLogMessage(CLASSNAME, "thmImgBtnRecalculate_Click", ex.Message), Convert.ToInt32(Priority.High), TraceEventType.Error, Source.ApexWeb, DateTime.Now, logCategory, Environment.MachineName);
            }  
        }

        /// <summary>
        /// Delegate to process cancellation of update Average MTD Goal
        /// </summary>
        /// <param name="sender">Sender of the event</param>
        /// <param name="e">Event arguments</param>
        private void MessagePanel_CancelUpdateAvgMTDGoal(object sender, EventArgs e)
        {
            txtAvgMTDGoal.Enabled = true;
            thmImgBtnRecalculate.Enabled = true;
            txtAvgMTDGoal.Text = string.Empty;
        }

        /// <summary>
        /// Binds Radchart with Facilities Details
        /// </summary>
        private void GetFacilityDetailsForDailyGoalDashboard(Int16 pageIndex)
        {
            Int16 totalRecords = 0;
            bool tableHasRecords = false;
            DateTime chartDate = new DateTime();
            BaseFilter dailyChartFilter = new BaseFilter();
            FacilityController dailyFacilityController = new FacilityController();
            List<FacilityDashboard> dailyFacilityList = new List<FacilityDashboard>();
            try
            {
                if (ViewState[CHARTDATE] != null)
                {
                    chartDate = Convert.ToDateTime(ViewState[CHARTDATE]);
                }
                if (chartDate.Date < System.DateTime.Now.Date)
                {
                    SetEnablePropertyOfControls(true, true);
                    txtAvgMTDGoal.Text = string.Empty;
                    txtAvgMTDGoal.Enabled = false;
                    thmImgBtnRecalculate.Enabled = false;
                }
                else if (chartDate.Date > System.DateTime.Now.Date)
                {
                    txtAvgMTDGoal.Text = string.Empty;
                    SetPagingControlsWhenRadChartIsEmpty(tableHasRecords);
                    return;
                }
                else
                {
                    SetEnablePropertyOfControls(true, true);
                }
                calDate.Value = Convert.ToDateTime(ViewState[CHARTDATE]).Date;
                dailyChartFilter.FilterDate = chartDate;
                dailyChartFilter.PageIndex = pageIndex;
                dailyChartFilter.PageSize = SessionHelper.UserCustomPrincipal.PageSize;
                dailyChartFilter.ViewBy = Convert.ToInt16(ddlView.SelectedItem.Value);
                dailyChartFilter.SortBy = Convert.ToInt16(ddlSortOrder.SelectedItem.Value);
                dailyFacilityList = dailyFacilityController.GetDashboardFacilityDailyGoal(dailyChartFilter, cbOverriddenOnTop.Checked, ref tableHasRecords, ref totalRecords, ref averageDailyMtdGoal);

                // Checks if there is any data in the series
                if (totalRecords == PageConstants.ZERO)
                {
                    SetPagingControlsWhenRadChartIsEmpty(tableHasRecords);
                    return;
                }
                else
                {
                    pnlNoDataErrorMessage.Visible = false;
                }

                radChart.DataSource = dailyFacilityList;
                radChart.PlotArea.XAxis.DataLabelsColumn = DatabaseConstants.FACILITY_CODE;           
                radChart.Series[0].DataYColumn = DatabaseConstants.TODAY_GOALTODATE;
                radChart.Series[0].DataLabelsColumn = DatabaseConstants.CATCHUP_LABEL;
                radChart.Series[1].DataYColumn = DatabaseConstants.YESTERDAY_GOALTODATE;
                radChart.DataBind();

                // Adding Refernce line
                CreateReferenceLine(averageDailyMtdGoal);           

                ViewState[PAGEINDEX] = pageIndex;
                ViewState[TOTALNUMBEROFPAGES] = (Int16)Math.Ceiling(((double)totalRecords / SessionHelper.UserCustomPrincipal.PageSize));

                SetPageNavigationControls();

                // Sets chart display properties
                SetChartDisplayProperties();

            }
            catch (BaseException ex)
            {
                SetMessage(Resources.ErrorMessagesResource.ResourceManager.GetString(ex.ExceptionCode.ToString()), PageMessageType.ErrorMessage);
            }
            catch (Exception ex)
            {
                SetMessage(Resources.ErrorMessagesResource.ResourceManager.GetString(ExceptionCodeConstants.GENERIC_EXCEPTION_CODE.ToString()), PageMessageType.ErrorMessage);

                LogCategory[] logCategory = { LogCategory.Error };
                WebLogHelper.WebLogMessage(UtilityMethods.FormatLogMessage(CLASSNAME, "GetFacilityDetailsForDailyGoalDashboard", ex.Message), Convert.ToInt32(Priority.High), TraceEventType.Error, Source.ApexWeb, DateTime.Now, logCategory, Environment.MachineName);
            }
        }

        /// <summary>
        /// Enables/Disables the page navigation buttons
        /// </summary>
        private void SetPageNavigationControls()
        {
            // Setting Page Navigation Buttons On the basis of PageIndex
            if (Convert.ToInt16(ViewState[PAGEINDEX]) == PageConstants.PAGE_ONE)
            {
                thmImgBtnFirst.Enabled = false;
                thmImgBtnPrevious.Enabled = false;
            }
            else
            {
                thmImgBtnFirst.Enabled = true;
                thmImgBtnPrevious.Enabled = true;
            }
            if (Convert.ToInt16(ViewState[PAGEINDEX]) == Convert.ToInt16(ViewState[TOTALNUMBEROFPAGES]))
            {
                thmImgBtnNext.Enabled = false;
                thmImgBtnLast.Enabled = false;
            }
            else
            {
                thmImgBtnNext.Enabled = true;
                thmImgBtnLast.Enabled = true;
            }
            SetNavigationTextboxAndLabel(true);
        }

        /// <summary>
        /// Sets the properties of paging controls when there is no data in radchart
        /// </summary>
        private void SetPagingControlsWhenRadChartIsEmpty(bool tableHasRecords)
        {
            ViewState[PAGEINDEX] = PageConstants.ZERO;
            ViewState[TOTALNUMBEROFPAGES] = PageConstants.ZERO;
            SetNavigationTextboxAndLabel(false);
            SetEnablePropertyOfControls(false, tableHasRecords);
            lblNoDataErrorMessage.Text = Resources.ErrorMessagesResource.ResourceManager.GetString(ExceptionCodeConstants.NO_RESULTS_FOUND.ToString());
            pnlNoDataErrorMessage.Visible = true;
            //SetMessage(Resources.ErrorMessagesResource.ResourceManager.GetString(ExceptionCodeConstants.NO_RESULTS_FOUND.ToString()), PageMessageType.ErrorMessage);
        }

        /// <summary>
        /// Sets the navigation textbox text & label of total number of pages of paging control
        /// </summary>
        /// <param name="hasRecords">Checks Records</param>
        private void SetNavigationTextboxAndLabel(bool hasRecords)
        {
            lblTotalPages.Text = PageConstants.SPACE + GetLocalResourceObject("OF").ToString() + PageConstants.SPACE + ViewState[TOTALNUMBEROFPAGES].ToString();       
            txtPageNo.Text = ViewState[PAGEINDEX].ToString();
            if (hasRecords == true)
            {
                rvPageNo.MinimumValue = PageConstants.ONE.ToString();
            }
            else
            {
                rvPageNo.MinimumValue = PageConstants.ZERO.ToString();
            }
            rvPageNo.MaximumValue = ViewState[TOTALNUMBEROFPAGES].ToString();
        }
        /// <summary>
        /// Sets the color of bar, legends of the radchart
        /// </summary>
        private void SetChartDisplayProperties()
        {
            // Setting Autolayout to true to display facilities with long facility code on x-axis
            radChart.AutoLayout = true;

            // Sets text color of series of chart
            radChart.Series[0].Appearance.TextAppearance.TextProperties.Color = Color.FromArgb(57, 135, 221);
            radChart.Series[1].Appearance.TextAppearance.TextProperties.Color = Color.Gray;

            // Gridlines
            radChart.PlotArea.XAxis.Appearance.MajorGridLines.Color = Color.FromArgb(245, 245, 245);
            radChart.PlotArea.XAxis.Appearance.MajorGridLines.PenStyle = System.Drawing.Drawing2D.DashStyle.Dash;
            radChart.PlotArea.XAxis.Appearance.MajorGridLines.Visible = true;
            radChart.PlotArea.YAxis.Appearance.MajorGridLines.Visible = false;
            radChart.PlotArea.YAxis.Appearance.MinorGridLines.Visible = false;

            radChart.SeriesOrientation = Telerik.Charting.ChartSeriesOrientation.Horizontal;
            SetChartLegend();
        }

        /// <summary>
        /// Set the enable property of controls
        /// </summary>
        /// <param name="enabled">true, if controls are to be enabled else false</param>
        private void SetEnablePropertyOfControls(bool enable, bool tableHasRecords)
        {
            rowRadChart.Visible = enable;
            txtAvgMTDGoal.Enabled = enable;
            thmImgBtnRecalculate.Enabled = enable;
            ddlView.Enabled = tableHasRecords;
            ddlSortOrder.Enabled = enable;
            thmImgBtnFirst.Enabled = enable;
            thmImgBtnPrevious.Enabled = enable;
            txtPageNo.Enabled = enable;
            thmImgBtnNext.Enabled = enable;
            thmImgBtnLast.Enabled = enable;
        }

        /// <summary>
        /// Checks UserPermission and performs Default Settings
        /// </summary>
        private void CheckUserPermission()
        {
            //Check User Permission
            if (!AuthorizeUserPermission(PagePermission))
            {
                SessionHelper.DeleteUserSession();
                Response.Redirect(PageConstants.UNAUTHORIZE_PAGE, true);
            }
        }

        /// <summary>
        /// Function to make controls visible/enable depending on the user permissions
        /// </summary>
        private void PermissionBasedControl()
        {
            dashboard.Visible = AuthorizationHelper.HasUserPermission(Resources.PermissionSet.ViewDailyMTDGoalDashboard);
            thmImgBtnAvgMTDGoal.Visible = AuthorizationHelper.HasUserPermission(Resources.PermissionSet.ViewDailyMtdGoal);
            thmImgBtnAvgMTDGoal.Enabled = AuthorizationHelper.HasUserPermission(Resources.PermissionSet.ViewDailyMtdGoal);
            thmImgBtnMonthlyMTDGoal.Visible = AuthorizationHelper.HasUserPermission(Resources.PermissionSet.ViewMonthlyMtdGoal);
            thmImgBtnMonthlyMTDGoal.Enabled = AuthorizationHelper.HasUserPermission(Resources.PermissionSet.ViewMonthlyMtdGoal);
            thmImgBtnUnassignedVolume.Visible = AuthorizationHelper.HasUserPermission(Resources.PermissionSet.ViewUnassignedVolume);
            thmImgBtnUnassignedVolume.Enabled = AuthorizationHelper.HasUserPermission(Resources.PermissionSet.ViewUnassignedVolume);
            txtAvgMTDGoal.Enabled = AuthorizationHelper.HasUserAllPermissions(Resources.PermissionSet.ChangeAVGMTDGoal);
            thmImgBtnRecalculate.Enabled = AuthorizationHelper.HasUserAllPermissions(Resources.PermissionSet.ChangeAVGMTDGoal);
        }

        /// <summary>
        /// This function creates the refernce line series of RadChart
        /// </summary>
        /// <param name="averageDailyMtdGoal">Average of Daily Goals of the date</param>
        private void CreateReferenceLine(double averageDailyMtdGoal)
        {
            // Setting properties of refernce line series
            ChartSeries referenceSeries = radChart.Series[2];
            referenceSeries.Appearance.LineSeriesAppearance.PenStyle = System.Drawing.Drawing2D.DashStyle.Dash;
            referenceSeries.Appearance.LineSeriesAppearance.Width = 1;
            referenceSeries.Items.Add(new ChartSeriesItem(0, averageDailyMtdGoal));
            referenceSeries.Items.Add(new ChartSeriesItem(radChart.Series[0].Items.Count + 0.5, averageDailyMtdGoal));
            referenceSeries.DefaultLabelValue = averageDailyMtdGoal.ToString() + "%";
            referenceSeries.Appearance.LabelAppearance.Visible = true;
            referenceSeries.Appearance.FillStyle.MainColor = Color.Red;
        }

        /// <summary>
        /// Set the chart legends
        /// </summary>
        private void SetChartLegend()
        {
            // Setting DisplayAutoLegend of all the series to None
            radChart.Series[0].Appearance.LegendDisplayMode = ChartSeriesLegendDisplayMode.Nothing;
            radChart.Series[1].Appearance.LegendDisplayMode = ChartSeriesLegendDisplayMode.Nothing;
            radChart.Series[2].Appearance.LegendDisplayMode = ChartSeriesLegendDisplayMode.Nothing;

            // Removing existing labels, if any, from chart legend
            radChart.Legend.Clear();

            // Creating legend
            AddLegendItem(TypeOfLegend.TodayGoalToDate, Color.FromArgb(243, 92, 83), GetLocalResourceObject("BelowRefOutsideRange").ToString(), string.Empty);
            AddLegendItem(TypeOfLegend.TodayGoalToDate, Color.FromArgb(250, 233, 125), GetLocalResourceObject("BelowRefWithinRange").ToString(), string.Empty);
            AddLegendItem(TypeOfLegend.TodayGoalToDate, Color.FromArgb(162, 204, 18), GetLocalResourceObject("AboveReference").ToString(), string.Empty);
            AddLegendItem(TypeOfLegend.TodayGoalToDate, Color.FromArgb(47, 125, 217), GetLocalResourceObject("TodayGoalToDateAndCatchUp").ToString(), string.Empty);
            AddLegendItem(TypeOfLegend.TodayGoalToDate, Color.FromArgb(161, 161, 161), GetLocalResourceObject("YesterdayGoalToDate").ToString(), string.Empty);
            AddLegendItem(TypeOfLegend.TodayGoalToDate, Color.Red, GetLocalResourceObject("Reference").ToString(), string.Empty);
            AddLegendItem(TypeOfLegend.Facility, Color.Transparent, GetLocalResourceObject("InactiveFacility").ToString(), GetLocalResourceObject("InactiveFacilityImageURL").ToString());
            AddLegendItem(TypeOfLegend.Facility, Color.Transparent, GetLocalResourceObject("OverriddenFacility").ToString(), GetLocalResourceObject("OverriddenFacilityImageURL").ToString());
            if (Convert.ToDateTime(ViewState[CHARTDATE]).Date < System.DateTime.Now.Date)
            {
                AddLegendItem(TypeOfLegend.Facility, Color.Transparent, GetLocalResourceObject("PastInactiveFacilitity").ToString(), GetLocalResourceObject("PastInactiveFacilityImageURL").ToString());
            }
            radChart.Legend.Appearance.Position.AlignedPosition = Telerik.Charting.Styles.AlignedPositions.Bottom;
            radChart.Legend.Appearance.Overflow = Telerik.Charting.Styles.Overflow.Row;
            radChart.Legend.Visible = true;
        }

        /// <summary>
        /// Add item to the Chart Legend
        /// </summary>
        /// <param name="markerColor">Color of the label</param>
        /// <param name="text">Text of the label</param>
        private void AddLegendItem(TypeOfLegend typeOfLegend, Color markerColor, string text, string imageURL)
        {
            LabelItem lblItem = new LabelItem();
            lblItem.TextBlock.Text = text;
            if (typeOfLegend == TypeOfLegend.TodayGoalToDate)
            {
                lblItem.Marker.Appearance.FillStyle.MainColor = markerColor;
                lblItem.Marker.Appearance.FillStyle.FillType = Telerik.Charting.Styles.FillType.Solid;
            }
            else if (typeOfLegend == TypeOfLegend.Facility)
            {
                lblItem.Marker.Appearance.FillStyle.FillType = Telerik.Charting.Styles.FillType.Image;
                lblItem.Marker.Appearance.FillStyle.FillSettings.BackgroundImage = imageURL;
                lblItem.Marker.Appearance.Border.Visible = false;
            }
            radChart.Legend.Items.Add(lblItem);
        }

        /// <summary>
        /// Load Controls
        /// </summary>
        private void LoadControls()
        {
            try
            {
                // Bind View by Dropdown
                List<Dropdown> viewbyDropdown = CacheHelper.DailyMTDGoalDashboardViewBy;

                foreach (Dropdown objDrpdown in viewbyDropdown)
                {

                    ddlView.Items.Add(new ListItem(objDrpdown.DropdownText, objDrpdown.DropdownValue));
                    if (objDrpdown.IsSelected)
                    {
                        ddlView.Items.FindByValue(objDrpdown.DropdownValue).Selected = true;
                    }
                }

                // Bind Sort by Dropdown
                List<Dropdown> sortByDropdown = CacheHelper.DailyMTDGoalDashboardSortBy;

                foreach (Dropdown objDrpdown in sortByDropdown)
                {

                    ddlSortOrder.Items.Add(new ListItem(objDrpdown.DropdownText, objDrpdown.DropdownValue));
                    if (objDrpdown.IsSelected)
                    {
                        ddlSortOrder.Items.FindByValue(objDrpdown.DropdownValue).Selected = true;
                    }
                }

            }
            catch (BaseException ex)
            {
                SetMessage(Resources.ErrorMessagesResource.ResourceManager.GetString(ex.ExceptionCode.ToString()), PageMessageType.ErrorMessage);
            }
            catch (Exception ex)
            {
                SetMessage(Resources.ErrorMessagesResource.ResourceManager.GetString(ExceptionCodeConstants.GENERIC_EXCEPTION_CODE.ToString()), PageMessageType.ErrorMessage);

                LogCategory[] logCategory = { LogCategory.Error };
                WebLogHelper.WebLogMessage(UtilityMethods.FormatLogMessage(CLASSNAME, "LoadControls", ex.Message), Convert.ToInt32(Priority.High), TraceEventType.Error, Source.ApexWeb, DateTime.Now, logCategory, Environment.MachineName);
            }

        }

        #endregion   
    }
    ____________________________________________________________________________

    The problem is stated in the first post. Please guide us through.

    Thanks & Regards,
    Priyanka Sethi

  5. Evgenia
    Admin
    Evgenia avatar
    1407 posts

    Posted 02 Sep 2011 Link to this post

    Hello Priyanka,

    I believe you understand that reproducing your project from this sample code is time consumming. Could you please open a new formal support thread and send us your attached runnable project? As another suggestion - you can upload your project in an online storage like http://www.megaupload.com/ for example and provide us a link to download it.

    Best wishes,
    Evgenia
    the Telerik team

    Thank you for being the most amazing .NET community! Your unfailing support is what helps us charge forward! We'd appreciate your vote for Telerik in this year's DevProConnections Awards. We are competing in mind-blowing 20 categories and every vote counts! VOTE for Telerik NOW >>

  6. Priyanka
    Priyanka avatar
    4 posts
    Member since:
    Jul 2011

    Posted 06 Sep 2011 Link to this post

    Hi Evgenia,

    Thanks for your reply. I understand the fact that it's difficult to reproduce the project with one file.

    To keep things simpler,I just want to ask if it is, at all,possible to have a Single Bar (in series-1) with a straight Reference Line
    (in series 2).

    For reference, I am attaching two images,
    1) Image 1 - reference line appearing with multiple bars on x axis
    2) Image 2 - reference line not appearing with single bar on x-axis

    If it is possible then, Could you please provide me the code so that I may be able to analyze what I am missing. If possible, please attach the image of your graph being created so I could tell you if that is what I wanted.

    Thanks & Regards,
    Priyanka Sethi
  7. Ves
    Admin
    Ves avatar
    2879 posts

    Posted 09 Sep 2011 Link to this post

    Hi Priyanka,

    A line is defined by at least two points. If there is only one point, the maximum that can be shown is the pointmark. Still, RadChart provides means to meet your requirements in this case. You can drop the line series and switch to using a marked zone instead.

    Best regards,
    Ves
    the Telerik team

    Thank you for being the most amazing .NET community! Your unfailing support is what helps us charge forward! We'd appreciate your vote for Telerik in this year's DevProConnections Awards. We are competing in mind-blowing 20 categories and every vote counts! VOTE for Telerik NOW >>

  8. Priyanka
    Priyanka avatar
    4 posts
    Member since:
    Jul 2011

    Posted 10 Sep 2011 Link to this post

    Hi Ves,

    Thanks for your reply. I could understand the problem of one point & tried implementing the line using Marked zones but I was not able to bring the marked zone in front so I dropped that approach. PFA snapshot for reference. Please let me know if there is a way to bring the marked zone on top of the bars, that will solve my purpose or a work around to have two points for one bar so the line becomes visible. I know it sounds absurd but you never know, you might have solution.. :) Thanks for your help.

    Regards,
    Priyanka Sethi
  9. Evgenia
    Admin
    Evgenia avatar
    1407 posts

    Posted 14 Sep 2011 Link to this post

    Hi Priyanka,

    Unfortunately customizing the z-index is not supported for the marked zone and it is practically not possible to position it over the Bar series. I still suggest that you get back to Line Series.

    All the best,
    Evgenia
    the Telerik team
    Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017