public ChartLineSeriesSerializerTests() { var chart = ChartTestHelper.CreateChart <SalesData>(); chart.DataSource = SalesDataBuilder.GetCollection(); series = new ChartLineSeries <SalesData, decimal>(chart, s => s.RepSales); }
public ChartLineSeriesBuilderTests() { var chart = ChartTestHelper.CreateChart <SalesData>(); series = new ChartLineSeries <SalesData, decimal>(chart, s => s.RepSales); builder = new ChartLineSeriesBuilder <SalesData>(series); }
/// <summary> /// Defines line series bound to inline data. /// </summary> /// <param name="data"> /// The data to bind to /// </param> public virtual ChartLineSeriesBuilder <TModel> Line(IEnumerable data) { ChartLineSeries <TModel, object> lineSeries = new ChartLineSeries <TModel, object>(data); Container.Series.Add(lineSeries); return(new ChartLineSeriesBuilder <TModel>(lineSeries)); }
/// <summary> /// Defines bound line series. /// </summary> /// <param name="expression"> /// The expression used to extract the series value from the chart model /// </param> public virtual ChartLineSeriesBuilder <TModel> Line <TValue>(Expression <Func <TModel, TValue> > expression) { var lineSeries = new ChartLineSeries <TModel, TValue>(expression); Container.Series.Add(lineSeries); return(new ChartLineSeriesBuilder <TModel>(lineSeries)); }
/// <summary> /// Defines line series bound to inline data. /// </summary> /// <param name="data"> /// The data to bind to /// </param> public virtual ChartLineSeriesBuilder <TModel> Line(IEnumerable data) { Guard.IsNotNull(data, "data"); ChartLineSeries <TModel, object> lineSeries = new ChartLineSeries <TModel, object>(Container, data); Container.Series.Add(lineSeries); return(new ChartLineSeriesBuilder <TModel>(lineSeries)); }
/// <summary> /// Defines bound line series. /// </summary> /// <param name="expression"> /// The expression used to extract the series value from the chart model /// </param> public virtual ChartLineSeriesBuilder <TModel> Line <TValue>(Expression <Func <TModel, TValue> > expression) { Guard.IsNotNull(expression, "expression"); ChartLineSeries <TModel, TValue> LineSeries = new ChartLineSeries <TModel, TValue>(Container, expression); Container.Series.Add(LineSeries); return(new ChartLineSeriesBuilder <TModel>(LineSeries)); }
/// <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); }
//------------------new ticket by it resource --------------------------// public void NewWeeklyByResource() { ChartResource.Width = Unit.Percentage(100); ChartResource.Height = Unit.Pixel(400); ChartResource.CssClass = "chart"; ChartResource.PrimaryHeader.Text = "New IT Tickets (Last 12 Weeks)"; ChartResource.TooltipSettings.AxisMarkers.Enabled = true; ChartResource.TooltipSettings.AxisMarkers.Mode = ChartXYMode.Y; ChartResource.TooltipSettings.AxisMarkers.Width = new Unit(1); ChartResource.TooltipSettings.AxisMarkers.ZIndex = 3; ChartResource.Font.Size = 12; ChartResource.Font.Bold = true; ChartAxisX axisX = new ChartAxisX(); axisX.CategoricalValuesField = "label"; // axisX.CategoricalValues = label.ToArray(); //axisX.CategoricalValues = monthLabels; ChartResource.Axes.Add(axisX); ChartAxisY axisY = new ChartAxisY(); axisY.Title.Text = "# of New Tickets"; ChartResource.Axes.Add(axisY); List <Tickets> datasource = new List <Tickets>(); ChartLineSeries splineSeriesNew = new ChartLineSeries(); splineSeriesNew.DataFieldY = "New"; splineSeriesNew.ID = "New Tickets"; splineSeriesNew.CollectionAlias = ddlResource.SelectedValue; ChartResource.DataSeries.Add(splineSeriesNew); List <int> newData = ScoreCardReports.Get12WeekNewByResource(ddlResource.SelectedValue); List <string> label = ScoreCardReports.Get12WeekLabels(); for (int i = 0; i < newData.Count; i++) { datasource.Add(new Tickets() { New = newData[i], label = label[i] }); } ChartResource.DataSource = datasource; //ChartResource.TakeDataSource += ChartResource_TakeDataSource; NewWeekly.DataBind(); NewWeekly.Controls.Add(ChartResource); }
/// <summary> /// Defines bound line series. /// </summary> /// <param name="expression"> /// The expression used to extract the value from the chart model. /// </param> /// <param name="categoryExpression"> /// The expression used to extract the category from the chart model. /// </param> /// <param name="noteTextExpression"> /// The expression used to extract the note text from the chart model. /// </param> public virtual ChartLineSeriesBuilder <TModel> Line <TValue, TCategory>( Expression <Func <TModel, TValue> > expression, Expression <Func <TModel, TCategory> > categoryExpression, Expression <Func <TModel, string> > noteTextExpression) { var lineSeries = new ChartLineSeries <TModel, TValue, TCategory>(expression, categoryExpression, noteTextExpression); Container.Series.Add(lineSeries); return(new ChartLineSeriesBuilder <TModel>(lineSeries)); }
/// <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>(); }
/// <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>(); }
public ChartLineSeriesSerializerTests() { var chart = ChartTestHelper.CreateChart<SalesData>(); chart.DataSource = SalesDataBuilder.GetCollection(); lineSeries = new ChartLineSeries<SalesData, decimal>(chart, s => s.RepSales); }
public ChartLineSeriesBuilderTests() { var chart = ChartTestHelper.CreateChart<SalesData>(); series = new ChartLineSeries<SalesData, decimal>(chart, s => s.RepSales); builder = new ChartLineSeriesBuilder<SalesData>(series); }
public void CreateAgingChart() { ChartAging.Width = Unit.Percentage(100); ChartAging.Height = Unit.Pixel(400); ChartAging.CssClass = "chart"; ChartAging.PrimaryHeader.Text = "IT Tickets: Aging >90 Days (Last 12 Weeks)"; ChartAging.TooltipSettings.AxisMarkers.Enabled = true; ChartAging.TooltipSettings.AxisMarkers.Mode = ChartXYMode.Y; ChartAging.TooltipSettings.AxisMarkers.Width = new Unit(1); ChartAging.TooltipSettings.AxisMarkers.ZIndex = 3; ChartAging.Font.Size = 12; ChartAging.Font.Bold = true; ChartAxisX axisX = new ChartAxisX(); /************************************************************************************************** * //***************************Dynamically Set X-Axis Labels***************************************** * /**************************************************************************************************/ System.Globalization.DateTimeFormatInfo mfi = new System.Globalization.DateTimeFormatInfo(); int selectedYear; int selectedMonth = DateTime.Today.Month - 1; if (selectedMonth < 1) { selectedMonth = 12; } int currentMonth = 0; if (selectedMonth == 12) { selectedYear = DateTime.Today.Year - 1; currentMonth = 1; } else { selectedYear = DateTime.Today.Year - 1; currentMonth = selectedMonth + 1; } double postion = 0.5; string[] monthLabels = new string[12]; int postionModifier = 1; int x = 0; do { monthLabels[x] = "";//mfi.GetMonthName(currentMonth).ToString() + @"-" + selectedYear.ToString(); postion += postionModifier; currentMonth++; if (currentMonth == 13) // Roll over the month { currentMonth = 1; //Jan selectedYear = selectedYear + 1; // Increase the year we are now in the previous year. } //comparisonChart.ChartAreas[0].AxisX.CustomLabels.Add(customLabel); x++; } while (currentMonth != selectedMonth); monthLabels[x] = "";// mfi.GetMonthName(currentMonth).ToString() + @"-" + selectedYear.ToString(); /*******************************************************************************************************/ axisX.CategoricalValuesField = "label"; axisX.AxisType = ChartAxisType.Datetime; //axisX.CategoricalValues = monthLabels; ChartAging.Axes.Add(axisX); ChartAxisY axisY = new ChartAxisY(); axisY.Title.Text = "Age of Tickets"; ChartAging.Axes.Add(axisY); ChartLineSeries splineSeriesAging = new ChartLineSeries(); splineSeriesAging.DataFieldY = "Aging"; splineSeriesAging.CollectionAlias = "Aging Tickets"; ChartAging.DataSeries.Add(splineSeriesAging); ChartAging.TakeDataSource += Chart12MthAging_TakeDataSource; AgingPanel.Controls.Add(ChartAging); }