public ChartBarSeriesSerializerTests()
        {
            var chart = ChartTestHelper.CreateChart <SalesData>();

            chart.DataSource = SalesDataBuilder.GetCollection();
            barSeries        = new ChartBarSeries <SalesData, decimal>(chart, s => s.RepSales);
        }
Пример #2
0
        public ChartBarSeriesBuilderTests()
        {
            var chart = ChartTestHelper.CreateChart <SalesData>();

            series  = new ChartBarSeries <SalesData, decimal>(chart, s => s.RepSales);
            builder = new ChartBarSeriesBuilder <SalesData>(series);
        }
    //------------------------------------------------------------------------------------------

    public void CreateBacklog()
    {
        DropDownList ddlbweek = (DropDownList)FindControl("ddlBacklogWeek");


        ChartBacklog.Width              = Unit.Percentage(100);
        ChartBacklog.Height             = Unit.Pixel(400);
        ChartBacklog.CssClass           = "chart";
        ChartBacklog.PrimaryHeader.Text = "IT Tickets Backlog (Week: " + ddlBacklogWeek.SelectedItem.Text + " of " + ddlBacklogYear.SelectedItem.Text + ")";
        ChartBacklog.TooltipSettings.AxisMarkers.Enabled = true;
        ChartBacklog.TooltipSettings.AxisMarkers.Mode    = ChartXYMode.Y;
        ChartBacklog.TooltipSettings.AxisMarkers.Width   = new Unit(1);
        ChartBacklog.TooltipSettings.AxisMarkers.ZIndex  = 3;

        ChartBacklog.Font.Size = 12;
        ChartBacklog.Font.Bold = true;

        ChartAxisX axisX = new ChartAxisX();

        axisX.CategoricalValuesField = "label";
        //axisX.CategoricalValues = label.ToArray();
        //axisX.CategoricalValues = monthLabels;

        ChartBacklog.Axes.Add(axisX);
        ChartAxisY axisY = new ChartAxisY();

        axisY.Title.Text = "Hours";
        ChartBacklog.Axes.Add(axisY);


        List <Backlog> datasource = new List <Backlog>();


        ChartBarSeries splineSeriesNew = new ChartBarSeries();

        splineSeriesNew.DataFieldY      = "BacklogHour";
        splineSeriesNew.ID              = "BacklogHour";
        splineSeriesNew.CollectionAlias = "Backlog";
        ChartBacklog.DataSeries.Add(splineSeriesNew);

        List <double> newData = ScoreCardReports.GetBacklog_Hours(Convert.ToInt32(ddlBacklogWeek.SelectedValue), Convert.ToInt32(ddlBacklogYear.SelectedValue));
        List <string> name    = ScoreCardReports.GetBacklog_Names(Convert.ToInt32(ddlBacklogWeek.SelectedValue), Convert.ToInt32(ddlBacklogYear.SelectedValue));

        if (newData.Count > 0)
        {
            for (int i = 0; i < newData.Count; i++)
            {
                datasource.Add(new Backlog()
                {
                    BacklogHour = newData[i], label = name[i]
                });
            }

            ChartBacklog.DataSource = datasource;
            //ChartResource.TakeDataSource += ChartResource_TakeDataSource;
            BacklogPanel.DataBind();
            BacklogPanel.Controls.Add(ChartBacklog);
        }
    }
Пример #4
0
        /// <summary>
        /// Defines bar series bound to inline data.
        /// </summary>
        /// <param name="data">
        /// The data to bind to.
        /// </param>
        public virtual ChartBarSeriesBuilder <TModel> Bar(IEnumerable data)
        {
            ChartBarSeries <TModel, object> barSeries = new ChartBarSeries <TModel, object>(data);

            Container.Series.Add(barSeries);

            return(new ChartBarSeriesBuilder <TModel>(barSeries));
        }
Пример #5
0
        /// <summary>
        /// Defines bound bar series.
        /// </summary>
        /// <param name="valueExpression">
        /// The expression used to extract the point value from the chart model
        /// </param>
        /// <param name="colorExpression">
        /// The expression used to extract the point color from the chart model
        /// </param>
        public virtual ChartBarSeriesBuilder <TModel> Bar <TValue>(Expression <Func <TModel, TValue> > valueExpression, Expression <Func <TModel, string> > colorExpression = null)
        {
            ChartBarSeries <TModel, TValue> barSeries = new ChartBarSeries <TModel, TValue>(valueExpression, colorExpression);

            Container.Series.Add(barSeries);

            return(new ChartBarSeriesBuilder <TModel>(barSeries));
        }
 /// <summary>
 /// Initializes a new instance of the <see cref="ChartSeriesDefaults{T}" /> class.
 /// </summary>
 /// <param name="chart">The chart.</param>
 public ChartSeriesDefaults(Chart <T> chart)
     : base(chart)
 {
     Bar         = new ChartBarSeries <T, object>(chart);
     Column      = new ChartBarSeries <T, object>(chart);
     Line        = new ChartLineSeries <T, object>(chart);
     Pie         = new ChartPieSeries <T, object>(chart);
     Scatter     = new ChartScatterSeries <T, object>(chart);
     ScatterLine = new ChartScatterLineSeries <T, object>(chart);
 }
Пример #7
0
        /// <summary>
        /// Defines bound bar series.
        /// </summary>
        /// <param name="expression">
        /// The expression used to extract the series value from the chart model
        /// </param>
        public virtual ChartBarSeriesBuilder <TModel> Bar <TValue>(Expression <Func <TModel, TValue> > expression)
        {
            Guard.IsNotNull(expression, "expression");

            ChartBarSeries <TModel, TValue> barSeries = new ChartBarSeries <TModel, TValue>(Container, expression);

            Container.Series.Add(barSeries);

            return(new ChartBarSeriesBuilder <TModel>(barSeries));
        }
Пример #8
0
        /// <summary>
        /// Defines bar series bound to inline data.
        /// </summary>
        /// <param name="data">
        /// The data to bind to
        /// </param>
        public virtual ChartBarSeriesBuilder <TModel> Column(IEnumerable data)
        {
            ChartBarSeries <TModel, object> barSeries = new ChartBarSeries <TModel, object>(data);

            barSeries.Orientation = ChartSeriesOrientation.Vertical;

            Container.Series.Add(barSeries);

            return(new ChartBarSeriesBuilder <TModel>(barSeries));
        }
Пример #9
0
        /// <summary>
        /// Defines bar series bound to inline data.
        /// </summary>
        /// <param name="data">
        /// The data to bind to.
        /// </param>
        public virtual ChartBarSeriesBuilder <TModel> Bar(IEnumerable data)
        {
            Guard.IsNotNull(data, "data");

            ChartBarSeries <TModel, object> barSeries = new ChartBarSeries <TModel, object>(Container, data);

            Container.Series.Add(barSeries);

            return(new ChartBarSeriesBuilder <TModel>(barSeries));
        }
Пример #10
0
        /// <summary>
        /// Defines bound bar series.
        /// </summary>
        /// <param name="valueExpression">
        /// The expression used to extract the point value from the chart model
        /// </param>
        /// <param name="colorExpression">
        /// The expression used to extract the point color from the chart model
        /// </param>
        /// <param name="categoryExpression">
        /// The expression used to extract the point category from the chart model
        /// </param>
        public virtual ChartBarSeriesBuilder <TModel> Bar <TValue, TCategory>(
            Expression <Func <TModel, TValue> > valueExpression,
            Expression <Func <TModel, string> > colorExpression       = null,
            Expression <Func <TModel, TCategory> > categoryExpression = null,
            Expression <Func <TModel, string> > noteTextExpression    = null)
        {
            var barSeries = new ChartBarSeries <TModel, TValue, TCategory>(valueExpression, colorExpression, categoryExpression, noteTextExpression);

            Container.Series.Add(barSeries);

            return(new ChartBarSeriesBuilder <TModel>(barSeries));
        }
Пример #11
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ChartSeriesDefaults{T}" /> class.
 /// </summary>
 public ChartSeriesDefaults()
 {
     Bar          = new ChartBarSeries <T, object>();
     Column       = new ChartBarSeries <T, object>();
     Line         = new ChartLineSeries <T, object>();
     VerticalLine = new ChartLineSeries <T, object>();
     Pie          = new ChartPieSeries <T, object>();
     Scatter      = new ChartScatterSeries <T, object, object>();
     ScatterLine  = new ChartScatterLineSeries <T, object, object>();
     Area         = new ChartAreaSeries <T, object>();
     VerticalArea = new ChartAreaSeries <T, object>();
     OHLC         = new ChartOHLCSeries <T, object>();
 }
Пример #12
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ChartSeriesDefaults{T}" /> class.
 /// </summary>
 public ChartSeriesDefaults()
 {
     Bar            = new ChartBarSeries <T, object>();
     Column         = new ChartBarSeries <T, object>();
     Line           = new ChartLineSeries <T, object>();
     VerticalLine   = new ChartLineSeries <T, object>();
     Pie            = new ChartPieSeries <T, object>();
     Donut          = new ChartDonutSeries <T, object>();
     Scatter        = new ChartScatterSeries <T, object, object>();
     ScatterLine    = new ChartScatterLineSeries <T, object, object>();
     Area           = new ChartAreaSeries <T, object>();
     VerticalArea   = new ChartAreaSeries <T, object>();
     OHLC           = new ChartOHLCSeries <T, object, string>();
     Bullet         = new ChartBulletSeries <T, object, string>();
     VerticalBullet = new ChartBulletSeries <T, object, string>();
     RadarArea      = new ChartRadarAreaSeries <T, object>();
     RadarColumn    = new ChartRadarColumnSeries <T, object>();
     RadarLine      = new ChartRadarLineSeries <T, object>();
     PolarArea      = new ChartPolarAreaSeries <T, object, object>();
     PolarLine      = new ChartPolarLineSeries <T, object, object>();
     PolarScatter   = new ChartPolarScatterSeries <T, object, object>();
 }
    /// <summary>
    /// new weekly
    /// </summary>
    public void CreateWeeklyChart()
    {
        WeeklyChart.Width              = Unit.Percentage(100);
        WeeklyChart.Height             = Unit.Pixel(400);
        WeeklyChart.CssClass           = "chart";
        WeeklyChart.PrimaryHeader.Text = "Weekly Statistics";
        WeeklyChart.TooltipSettings.AxisMarkers.Enabled = true;
        WeeklyChart.TooltipSettings.AxisMarkers.Mode    = ChartXYMode.Y;
        WeeklyChart.TooltipSettings.AxisMarkers.Width   = new Unit(1);
        WeeklyChart.TooltipSettings.AxisMarkers.ZIndex  = 3;

        WeeklyChart.Font.Size = 12;
        WeeklyChart.Font.Bold = true;

        ChartAxisX axisX = new ChartAxisX();

        axisX.CategoricalValuesField = "label";
        axisX.AxisType = ChartAxisType.Datetime;



        WeeklyChart.Axes.Add(axisX);
        ChartAxisY axisY = new ChartAxisY();

        axisY.Title.Text = "# of Tickets";

        WeeklyChart.Axes.Add(axisY);

        ChartBarSeries splineSeriesOpen = new ChartBarSeries();

        splineSeriesOpen.DataFieldY      = "Open";
        splineSeriesOpen.CollectionAlias = "Open Tickets";
        WeeklyChart.DataSeries.Add(splineSeriesOpen);
        //splineSeriesOpen.Settings.StackMode = ChartStackMode.Normal;

        ChartBarSeries splineSeriesNew = new ChartBarSeries();

        splineSeriesNew.DataFieldY      = "New";
        splineSeriesNew.CollectionAlias = "New Tickets";
        WeeklyChart.DataSeries.Add(splineSeriesNew);
        //splineSeriesB.Settings.StackMode = ChartStackMode.Normal;

        ChartBarSeries splineSeriesClosed = new ChartBarSeries();

        splineSeriesClosed.DataFieldY      = "Closed";
        splineSeriesClosed.CollectionAlias = "Closed Tickets";
        WeeklyChart.DataSeries.Add(splineSeriesClosed);
        //splineSeriesC.Settings.StackMode = ChartStackMode.Normal;

        /*
         * ChartLineSeries splineSeriesTarget = new ChartLineSeries();
         * splineSeriesTarget.DataFieldY = "ShiftTarget";
         * splineSeriesTarget.CollectionAlias = "Shift Target";
         * WeeklyChart.DataSeries.Add(splineSeriesTarget);
         */

        WeeklyChart.TakeDataSource += WeeklyChart_TakeDataSource;



        WeeklyChart.DataBind();
    }
 public ChartBarSeriesSerializerTests()
 {
     var chart = ChartTestHelper.CreateChart<SalesData>();
     chart.DataSource = SalesDataBuilder.GetCollection();
     barSeries = new ChartBarSeries<SalesData, decimal>(chart, s => s.RepSales);
 }
    //-------------Monthly Drill Graph ------------------------//


    public void CreateMonthlyIssuesDrillDown()
    {
        MonthPanel.Width              = Unit.Percentage(100);
        MonthPanel.Height             = Unit.Pixel(400);
        MonthPanel.CssClass           = "chart";
        MonthPanel.PrimaryHeader.Text = "Month " + ddlMth.SelectedValue + ": Class Level View";
        MonthPanel.TooltipSettings.AxisMarkers.Enabled = true;
        MonthPanel.TooltipSettings.AxisMarkers.Mode    = ChartXYMode.Y;
        MonthPanel.TooltipSettings.AxisMarkers.Width   = new Unit(2);
        MonthPanel.TooltipSettings.AxisMarkers.ZIndex  = 3;

        MonthPanel.Font.Size = 12;
        MonthPanel.Font.Bold = true;

        ChartAxisX axisX = new ChartAxisX();

        axisX.CategoricalValuesField = "label";


        MonthPanel.Axes.Add(axisX);
        ChartAxisY axisY = new ChartAxisY();

        axisY.Title.Text = "# of Hours ";
        MonthPanel.Axes.Add(axisY);

        ChartBarSeries splineSeriesNone = new ChartBarSeries();

        splineSeriesNone.DataFieldY      = "Unassigned";
        splineSeriesNone.ID              = "Unassigned";
        splineSeriesNone.CollectionAlias = "Unassigned";
        MonthPanel.DataSeries.Add(splineSeriesNone);

        ChartBarSeries splineSeriesFault = new ChartBarSeries();

        splineSeriesFault.DataFieldY      = "Fault";
        splineSeriesFault.ID              = "Fault/Failure";
        splineSeriesFault.CollectionAlias = "Fault/Failure";
        MonthPanel.DataSeries.Add(splineSeriesFault);

        ChartBarSeries splineSeriesService = new ChartBarSeries();

        splineSeriesService.DataFieldY      = "Service";
        splineSeriesService.ID              = "Service Request";
        splineSeriesService.CollectionAlias = "Service Request";
        MonthPanel.DataSeries.Add(splineSeriesService);

        ChartBarSeries splineSeriesAssistance = new ChartBarSeries();

        splineSeriesAssistance.DataFieldY      = "Assistance";
        splineSeriesAssistance.CollectionAlias = "Assistance/Inquiry";
        splineSeriesAssistance.ID = "Assistance/Inquiry";
        MonthPanel.DataSeries.Add(splineSeriesAssistance);



        //if(!IsPostBack)
        //{

        mthClassLevelDrill();
        //   }

        MonthPanel.DataBind();


        //TypePanel.Controls.Add(WeekTypeChart);
    }
    protected void MonthPanel_SeriesClick(object sender, ChartSeriesClickEventArgs e)
    {
        btnRes.Visible = true;

        MonthPanel.AutoPostBack = false;


        object clickedITName = e.Name;
        object clickedSeries = e.Series.ID;


        String itName    = clickedITName.ToString();
        String className = clickedSeries.ToString();

        MonthPanel.DataSeries.Clear();
        mthdrillDownDatasource.Clear();
        //drillDownDatasource = new List<Issues>();
        MonthPanel.Axes.Clear();
        MonthPanel.PrimaryHeader.Text = "Month " + ddlMth.SelectedValue + ": Category Level View";

        ChartAxisX axisX = new ChartAxisX();

        axisX.CategoricalValuesField = "label";


        MonthPanel.Axes.Add(axisX);
        ChartAxisY axisY = new ChartAxisY();

        axisY.Title.Text = "# of Hours ";
        MonthPanel.Axes.Add(axisY);

        ChartBarSeries splineSeriesNone = new ChartBarSeries();

        splineSeriesNone.DataFieldY      = "Unassigned";
        splineSeriesNone.ID              = "Unassigned";
        splineSeriesNone.CollectionAlias = "Unassigned";
        MonthPanel.DataSeries.Add(splineSeriesNone);

        ChartBarSeries splineSeriesHardware = new ChartBarSeries();

        splineSeriesHardware.DataFieldY      = "Hardware";
        splineSeriesHardware.ID              = "Hardware";
        splineSeriesHardware.CollectionAlias = "Hardware";
        MonthPanel.DataSeries.Add(splineSeriesHardware);

        ChartBarSeries splineSeriesSoftware = new ChartBarSeries();

        splineSeriesSoftware.DataFieldY      = "Software";
        splineSeriesSoftware.ID              = "Software";
        splineSeriesSoftware.CollectionAlias = "Software";
        MonthPanel.DataSeries.Add(splineSeriesSoftware);

        ChartBarSeries splineSeriesNetwork = new ChartBarSeries();

        splineSeriesNetwork.DataFieldY      = "Network";
        splineSeriesNetwork.CollectionAlias = "Network";
        splineSeriesNetwork.ID = "Network";
        MonthPanel.DataSeries.Add(splineSeriesNetwork);

        ChartBarSeries splineSeriesPeople = new ChartBarSeries();

        splineSeriesPeople.DataFieldY      = "People";
        splineSeriesPeople.ID              = "People/Accomodation";
        splineSeriesPeople.CollectionAlias = "People/Accomodation";
        MonthPanel.DataSeries.Add(splineSeriesPeople);

        ChartBarSeries splineSeriesProcess = new ChartBarSeries();

        splineSeriesProcess.DataFieldY      = "Process";
        splineSeriesProcess.ID              = "Process";
        splineSeriesProcess.CollectionAlias = "Process";
        MonthPanel.DataSeries.Add(splineSeriesProcess);

        ChartBarSeries splineSeriesDocumentation = new ChartBarSeries();

        splineSeriesDocumentation.DataFieldY      = "Documentation";
        splineSeriesDocumentation.CollectionAlias = "Documentation";
        splineSeriesDocumentation.ID = "Documentation";
        MonthPanel.DataSeries.Add(splineSeriesDocumentation);


        mthCategoryLevelDrill(itName, className);

        WeeklyChart.Axes.Clear();
        WeeklyChart.DataSeries.Clear();
        CreateWeeklyChart();

        TypePanel.DataSeries.Clear();
        TypePanel.Axes.Clear();
        drillDownDatasource.Clear();
        CreateWeeklyIssuesDrillDown();
    }
 public ChartBarSeriesBuilderTests()
 {
     var chart = ChartTestHelper.CreateChart<SalesData>();
     series = new ChartBarSeries<SalesData, decimal>(chart, s => s.RepSales);
     builder = new ChartBarSeriesBuilder<SalesData>(series);
 }