public void DisplayData()
    {
        DashboardProvider provider = null;

        try
        {
            // Create provider.
            provider            = new DashboardProvider();
            provider.AppManager = this.AppManager;

            // Get dashboard item command.
            SqlCommand itemCommand = provider.CreateItemCommand(DashboardProvider.USER_WORK_DURATION);
            // Assign parameters value.
            itemCommand.Parameters["@UserId"].Value = this.AppManager.LoginUser.Id;

            // Retrieve item data.
            DataSet   dataSet   = provider.RetrieveItemData(itemCommand);
            DataTable dataTable = dataSet.Tables[0];

            // Bind with chart.
            Series series = this.Chart1.Series["Default"];
            series.Points.DataBind(dataTable.DefaultView, "WorkDate", "WorkDuration1", "");

            // Label values shown angel
            series.LabelAngle              = -90;
            series.LabelFormat             = "N2";
            series.LabelForeColor          = System.Drawing.Color.DarkBlue;
            series.SmartLabelStyle.Enabled = false;


            int i = 0;

            foreach (var point in series.Points)
            {
                if (!string.IsNullOrEmpty(Convert.ToString(point.YValues[0])) && !Convert.ToString(point.YValues[0]).Equals("0"))
                {
                    point.ToolTip             = string.Concat("Hours ", Convert.ToString(dataTable.Rows[i]["WorkDuration1"]).Replace(".", ":"));
                    point.IsValueShownAsLabel = true;
                }

                i++;
            }
        }
        catch { throw; }
    }
    public void DisplayData()
    {
        DashboardProvider provider = null;

        try
        {
            // Create provider.
            provider            = new DashboardProvider();
            provider.AppManager = this.AppManager;

            // Get dashboard item command.
            SqlCommand itemCommand = provider.CreateItemCommand(DashboardProvider.USER_ACTIVITY_STATUS);
            // Assign parameters value.
            itemCommand.Parameters["@UserId"].Value = this.AppManager.LoginUser.Id;

            // Retrieve item data.
            DataSet   dataSet   = provider.RetrieveItemData(itemCommand);
            DataTable dataTable = dataSet.Tables[0];

            // Bind with chart.
            this.Chart1.Series.Clear();
            this.Chart1.DataBindCrossTable(dataTable.DefaultView, "Status", "ActivityDate", "ActivityCount", "");


            foreach (Series series in this.Chart1.Series)
            {
                if (series.Name.Equals("Waiting For Approval", StringComparison.InvariantCultureIgnoreCase))
                {
                    series.Color = System.Drawing.Color.FromArgb(236, 188, 67);
                }
                else if (series.Name.Equals("Approved Activity", StringComparison.InvariantCultureIgnoreCase))
                {
                    series.LegendText = "Approved";
                    series.Color      = System.Drawing.Color.FromArgb(67, 142, 83);
                }
                else if (series.Name.Equals("Rejected Activity", StringComparison.InvariantCultureIgnoreCase))
                {
                    series.LegendText = "Rejected";
                    series.Color      = System.Drawing.Color.FromArgb(236, 100, 74);
                }
                else if (series.Name.Equals("Resetted Activity", StringComparison.InvariantCultureIgnoreCase))
                {
                    series.LegendText = "Resetted";
                    series.Color      = System.Drawing.Color.FromArgb(85, 93, 131);
                }
                series.ChartType = SeriesChartType.StackedColumn;
                series.SetCustomProperty("PointWidth", "0.8");
                series.SetCustomProperty("DrawBySide", "false");

                // Label values shown angel
                series.LabelAngle              = -90;
                series.LabelForeColor          = System.Drawing.Color.Black;
                series.SmartLabelStyle.Enabled = false;

                foreach (var point in series.Points)
                {
                    if (!string.IsNullOrEmpty(Convert.ToString(point.YValues[0])) && !Convert.ToString(point.YValues[0]).Equals("0"))
                    {
                        point.ToolTip             = string.Concat("Activity Count : ", Convert.ToString(point.YValues[0]));
                        point.IsValueShownAsLabel = true;
                    }
                }
            }
        }
        catch { throw; }
    }