Example #1
0
        public void BuildChart(int countS, int countE, DataTable dt, XRChart xrChart)
        {
            xrChart.Series.Clear();
            Series series = null;

            for (int i = countS; i < countE; i++)
            {
                if (series == null)
                {
                    series = new Series("servername", ViewType.Bar);
                    series.ArgumentDataMember = dt.Columns["servername"].ToString();
                    series.ArgumentScaleType  = ScaleType.Qualitative;
                    series.ValueScaleType     = ScaleType.Numerical;
                }
                if (series != null)
                {
                    //5/5/2016 Sowjanya modified for VSPLUS-2919
                    series.Points.Add(new SeriesPoint(dt.Rows[i]["servername"].ToString(), Convert.ToDouble(dt.Rows[i]["PercentUtilization"].ToString() == "" ? "0" : dt.Rows[i]["PercentUtilization"].ToString())));
                    xrChart.Series.Add(series);
                    series = null;
                }
            }
            if (countE != 0)
            {
                ((XYDiagram)xrChart1.Diagram).PaneLayoutDirection = PaneLayoutDirection.Horizontal;
                XYDiagram seriesXY = (XYDiagram)xrChart.Diagram;
                seriesXY.EnableAxisXScrolling = true;
                seriesXY.EnableAxisYScrolling = true;
                seriesXY.AxisX.Label.ResolveOverlappingOptions.AllowRotate = false;
                seriesXY.AxisX.Label.ResolveOverlappingOptions.AllowHide   = false;

                seriesXY.AxisY.Title.Text = "Percentage Of Server Utilization";



                seriesXY.AxisY.Title.Visible = true;
                seriesXY.AxisX.Title.Visible = false;
            }
            else
            {
                EmptyChartText myText = xrChart.EmptyChartText;

                myText.Antialiasing = true;
                myText.Text         = "There is no data to dispaly.";
                myText.TextColor    = Color.Black;
            }
            xrChart.DataSource = dt;
        }
Example #2
0
        public void BuildChart(int countS, int countE, DataTable dt, XRChart xrChart)
        {
            xrChart.Series.Clear();
            Series series = null;

            for (int i = countS; i < countE; i++)
            {
                if (series == null)
                {
                    series = new Series("Server", ViewType.Bar);
                    series.ArgumentDataMember = "DisplayName";
                    series.ArgumentScaleType  = ScaleType.Qualitative;
                    series.ValueScaleType     = ScaleType.Numerical;
                }
                if (series != null)
                {
                    series.Points.Add(new SeriesPoint(dt.Rows[i]["DisplayName"].ToString(), Convert.ToDouble(dt.Rows[i]["InActiveDaysCount"].ToString())));
                    xrChart.Series.Add(series);
                    series = null;
                }
            }
            // 3/24/2016 Durga Addded for VSPLUS-2702
            if (countE != 0)
            {
                ((XYDiagram)xrChart1.Diagram).PaneLayoutDirection = PaneLayoutDirection.Horizontal;
                XYDiagram seriesXY = (XYDiagram)xrChart.Diagram;
                seriesXY.EnableAxisXScrolling = true;
                seriesXY.EnableAxisYScrolling = true;
                seriesXY.AxisX.Label.ResolveOverlappingOptions.AllowRotate = false;
                seriesXY.AxisX.Label.ResolveOverlappingOptions.AllowHide   = false;
                seriesXY.AxisY.Title.Text    = "Days of Inactivity";
                seriesXY.AxisY.Title.Visible = true;
                seriesXY.AxisX.Title.Visible = false;
            }
            else
            {
                EmptyChartText myText = xrChart.EmptyChartText;

                myText.Antialiasing = true;
                myText.Text         = "There is no data to dispaly.";
                myText.TextColor    = Color.Black;
            }


            xrChart.DataSource = dt;
        }