protected override Image DoCreateChartImage() { var chart = new UltraChart {ChartType = ChartType.LineChart}; var sc1 = new NumericSeries(); foreach (var valuePair in Parameters.SeriaData) { sc1.Points.Add(new NumericDataPoint(valuePair.Key, valuePair.Value.ToString(), false)); } chart.Series.Add(sc1); chart.Height = Parameters.ChartHeight; chart.Width = Parameters.ChartWidth; using (var stream = new MemoryStream()) { chart.SaveTo(stream, ImageFormat.Png); return new Bitmap(stream); } }
private void generateHistogramUI(double[] arrayOfRatios, double[] arrayOfOriginalRatios, int numberOfBins) { try { UltraChart HistogramChart1 = new UltraChart(); this.HistogramChart1.ChartType = Infragistics.UltraChart.Shared.Styles.ChartType.HistogramChart; this.HistogramChart1.HistogramChart.ColumnAppearance.StringAxis = false; this.HistogramChart1.HistogramChart.ColumnAppearance.ShowInLegend = true; this.HistogramChart1.Axis.X.NumericAxisType = Infragistics.UltraChart.Shared.Styles.NumericAxisType.Linear; this.HistogramChart1.Axis.X.RangeMin = arrayOfRatios.Min(); this.HistogramChart1.Axis.X.RangeMax = arrayOfRatios.Max(); this.HistogramChart1.Axis.X.RangeType = AxisRangeType.Custom; this.HistogramChart1.Axis.X.TickmarkStyle = Infragistics.UltraChart.Shared.Styles.AxisTickStyle.DataInterval; //this.ultraChart2.Axis.X.TickmarkStyle = Infragistics.UltraChart.Shared.Styles.AxisTickStyle.Percentage; this.HistogramChart1.Axis.X.TickmarkInterval = (arrayOfRatios.Max() - arrayOfRatios.Min()) / numberOfBins; ;// Infragistics.UltraChart.Shared.Styles.AxisTickStyle.Smart; //this.ultraChart2.Axis.X.LogBase = 2.71; this.HistogramChart1.HistogramChart.ColumnAppearance.ColumnSpacing = .1; //this.ultraChart2.Axis.Y.NumericAxisType = Infragistics.UltraChart.Shared.Styles.NumericAxisType.Logarithmic; this.HistogramChart1.Axis.Y2.Visible = false; this.HistogramChart1.Axis.X.Labels.ItemFormat = AxisItemLabelFormat.Custom; this.HistogramChart1.Axis.X.Labels.VerticalAlign = System.Drawing.StringAlignment.Center; this.HistogramChart1.Axis.X.Labels.SeriesLabels.Visible = false; //this.ultraChart2.Axis.X.Labels.ItemFormatString = "Math.Pow(2.71,<DATA_VALUE:00.##>)"; //this.ultraChart2.Axis.X.Labels.SeriesLabels.Format = Infragistics.UltraChart.Shared.Styles.AxisSeriesLabelFormat.Custom; //this.ultraChart2.Axis.X.Labels.SeriesLabels.FormatString = "Math.Pow(<ITEM_LABEL>,2.71)";//<DATA_VALUE:0#> this.HistogramChart1.Axis.X.Labels.HorizontalAlign = System.Drawing.StringAlignment.Near; this.HistogramChart1.Axis.X.Labels.ItemFormatString = "<ITEM_LABEL>"; this.HistogramChart1.Axis.X.Labels.Layout.Behavior = Infragistics.UltraChart.Shared.Styles.AxisLabelLayoutBehaviors.Auto; this.HistogramChart1.Axis.X.Labels.Orientation = Infragistics.UltraChart.Shared.Styles.TextOrientation.VerticalLeftFacing; this.HistogramChart1.Axis.X.Labels.SeriesLabels.Font = new System.Drawing.Font("Verdana", 7F); this.HistogramChart1.Axis.X.Labels.SeriesLabels.FontColor = System.Drawing.Color.Black; this.HistogramChart1.Axis.X.Labels.SeriesLabels.FormatString = ""; this.HistogramChart1.Axis.X.Labels.SeriesLabels.HorizontalAlign = System.Drawing.StringAlignment.Near; this.HistogramChart1.Axis.X.Labels.SeriesLabels.Layout.Behavior = Infragistics.UltraChart.Shared.Styles.AxisLabelLayoutBehaviors.Auto; this.HistogramChart1.Axis.X.Labels.SeriesLabels.Orientation = Infragistics.UltraChart.Shared.Styles.TextOrientation.VerticalLeftFacing; this.HistogramChart1.Axis.X.Labels.SeriesLabels.VerticalAlign = System.Drawing.StringAlignment.Center; this.HistogramChart1.Axis.X.Labels.Orientation = TextOrientation.VerticalLeftFacing; this.HistogramChart1.Legend.Visible = true; this.HistogramChart1.Legend.BackgroundColor = System.Drawing.Color.Transparent; this.HistogramChart1.Legend.BorderColor = System.Drawing.Color.Black; this.HistogramChart1.Legend.Margins.Bottom = 50; this.HistogramChart1.Legend.Margins.Left = 2; this.HistogramChart1.Legend.Margins.Right = 2; this.HistogramChart1.Legend.Margins.Top = 2; this.HistogramChart1.Legend.Visible = false; //new int[] { 1, 2, 4, 5, 6, 7, 8, 9, 9, 9, 12, 13, 14, 15, 16 }; this.HistogramChart1.Visible = true; //this.ultraChart2.Axis.X.ScrollScale.Visible = true; //this.ultraChart2.Axis.Y.ScrollScale.Visible = true; this.HistogramChart1.HistogramChart.LineAppearance.Visible = false; this.HistogramChart1.ColorModel.AlphaLevel = 255; this.HistogramChart1.ColorModel.Grayscale = false; this.HistogramChart1.Data.DataSource = arrayOfRatios; this.HistogramChart1.Data.DataBind(); this.HistogramChart1.Refresh(); UltraChart HistogramChart2 = new UltraChart(); this.HistogramChart2.ChartType = Infragistics.UltraChart.Shared.Styles.ChartType.HistogramChart; this.HistogramChart2.HistogramChart.ColumnAppearance.StringAxis = false; this.HistogramChart2.HistogramChart.ColumnAppearance.ShowInLegend = true; this.HistogramChart2.Axis.X.NumericAxisType = Infragistics.UltraChart.Shared.Styles.NumericAxisType.Linear; this.HistogramChart2.Axis.X.RangeMin = arrayOfOriginalRatios.Min(); this.HistogramChart2.Axis.X.RangeMax = arrayOfOriginalRatios.Max(); this.HistogramChart2.Axis.X.RangeType = AxisRangeType.Custom; this.HistogramChart2.Axis.X.TickmarkStyle = Infragistics.UltraChart.Shared.Styles.AxisTickStyle.DataInterval; //this.ultraChart2.Axis.X.TickmarkStyle = Infragistics.UltraChart.Shared.Styles.AxisTickStyle.Percentage; this.HistogramChart2.Axis.X.TickmarkInterval = (arrayOfOriginalRatios.Max() - arrayOfOriginalRatios.Min()) / numberOfBins;// Infragistics.UltraChart.Shared.Styles.AxisTickStyle.Smart; //this.ultraChart2.Axis.X.LogBase = 2.71; this.HistogramChart2.HistogramChart.ColumnAppearance.ColumnSpacing = .1; //this.ultraChart2.Axis.Y.NumericAxisType = Infragistics.UltraChart.Shared.Styles.NumericAxisType.Logarithmic; this.HistogramChart2.Axis.Y2.Visible = false; this.HistogramChart2.Axis.X.Labels.ItemFormat = AxisItemLabelFormat.Custom; this.HistogramChart2.Axis.X.Labels.VerticalAlign = System.Drawing.StringAlignment.Center; this.HistogramChart2.Axis.X.Labels.SeriesLabels.Visible = false; //this.ultraChart2.Axis.X.Labels.ItemFormatString = "Math.Pow(2.71,<DATA_VALUE:00.##>)"; //this.ultraChart2.Axis.X.Labels.SeriesLabels.Format = Infragistics.UltraChart.Shared.Styles.AxisSeriesLabelFormat.Custom; //this.ultraChart2.Axis.X.Labels.SeriesLabels.FormatString = "Math.Pow(<ITEM_LABEL>,2.71)";//<DATA_VALUE:0#> this.HistogramChart2.Axis.X.Labels.HorizontalAlign = System.Drawing.StringAlignment.Near; this.HistogramChart2.Axis.X.Labels.ItemFormatString = "<ITEM_LABEL>"; this.HistogramChart2.Axis.X.Labels.Layout.Behavior = Infragistics.UltraChart.Shared.Styles.AxisLabelLayoutBehaviors.Auto; this.HistogramChart2.Axis.X.Labels.Orientation = Infragistics.UltraChart.Shared.Styles.TextOrientation.VerticalLeftFacing; this.HistogramChart2.Axis.X.Labels.SeriesLabels.Font = new System.Drawing.Font("Verdana", 7F); this.HistogramChart2.Axis.X.Labels.SeriesLabels.FontColor = System.Drawing.Color.Black; this.HistogramChart2.Axis.X.Labels.SeriesLabels.FormatString = ""; this.HistogramChart2.Axis.X.Labels.SeriesLabels.HorizontalAlign = System.Drawing.StringAlignment.Near; this.HistogramChart2.Axis.X.Labels.SeriesLabels.Layout.Behavior = Infragistics.UltraChart.Shared.Styles.AxisLabelLayoutBehaviors.Auto; this.HistogramChart2.Axis.X.Labels.SeriesLabels.Orientation = Infragistics.UltraChart.Shared.Styles.TextOrientation.VerticalLeftFacing; this.HistogramChart2.Axis.X.Labels.SeriesLabels.VerticalAlign = System.Drawing.StringAlignment.Center; this.HistogramChart2.Axis.X.Labels.Orientation = TextOrientation.VerticalLeftFacing; this.HistogramChart2.Legend.Visible = true; this.HistogramChart2.Legend.BackgroundColor = System.Drawing.Color.Transparent; this.HistogramChart2.Legend.BorderColor = System.Drawing.Color.Black; this.HistogramChart2.Legend.Margins.Bottom = 50; this.HistogramChart2.Legend.Margins.Left = 2; this.HistogramChart2.Legend.Margins.Right = 2; this.HistogramChart2.Legend.Margins.Top = 2; this.HistogramChart2.Legend.Visible = false; //new int[] { 1, 2, 4, 5, 6, 7, 8, 9, 9, 9, 12, 13, 14, 15, 16 }; this.HistogramChart2.Visible = true; //this.ultraChart2.Axis.X.ScrollScale.Visible = true; //this.ultraChart2.Axis.Y.ScrollScale.Visible = true; this.HistogramChart2.HistogramChart.LineAppearance.Visible = false; this.HistogramChart2.ColorModel.AlphaLevel = 255; this.HistogramChart2.ColorModel.Grayscale = false; this.HistogramChart2.Data.DataSource = arrayOfOriginalRatios; this.HistogramChart2.Data.DataBind(); this.HistogramChart2.Refresh(); } catch (Exception e) { PetrelLogger.InfoBox(e.Message + "\n" + e.StackTrace); } }
public static void DeMarkSetupForChart(UltraChart chart, ConstructGen<double> candleData_, bool isDateChart, int openIndex_=0, int highIndex_=1, int lowIndex_=2, int closeIndex_=3, int setupLength_=9, int countdownLength_=13) { var closes = candleData_.GetColumnValuesAsDDC(closeIndex_); var range = closes.Data.Max() - closes.Data.Min(); var cellHeight = range / 10d; var setupStarts = Analysis.GetSetups(candleData_, openIndex_, highIndex_, lowIndex_, closeIndex_, setupLength_); Analysis.AddCountdowns(candleData_, setupStarts, openIndex_, highIndex_, lowIndex_, closeIndex_, setupLength_, countdownLength_); for (int i = 0; i < candleData_.Dates.Count; ++i) { var date = candleData_.Dates[i]; var arr = candleData_.GetValues(date); //dt.LoadDataRow(new object[] //{ // date, // arr[openIndex_], // arr[highIndex_], // arr[lowIndex_], // arr[closeIndex_], // 0d //}, true); foreach (var mark in setupStarts) { addAnnotations(chart, date, mark, i, cellHeight, arr, openIndex_, highIndex_, lowIndex_, closeIndex_); } } }
public static UltraChart GetDrinkChartControl(int drinkID) { // Get ingredient data from cache DataView dataView = CacheManager.GetItem(CacheManager.Cache_GetDrinks, "GetDrinks", "Drink_pk", null); DataRow dr = dataView.Table.Rows.Find(drinkID); UltraChart chart = new UltraChart(); chart.ID = "_chart"; chart.ChartType = Infragistics.UltraChart.Shared.Styles.ChartType.DoughnutChart3D; chart.JavaScriptEnabled = false; chart.Height = Unit.Pixel(300); chart.Width = Unit.Pixel(300); chart.BackColor = Color.White; chart.Transform3D.Perspective = 50; chart.Transform3D.ZRotation = 0; chart.Transform3D.Scale = 75; chart.Transform3D.XRotation = 45; chart.Transform3D.YRotation = -28; chart.Border.CornerRadius = 4; chart.Border.DrawStyle = Infragistics.UltraChart.Shared.Styles.LineDrawStyle.Solid; chart.Border.Color = Color.FromArgb(0xcc, 0xcc, 0xcc); chart.Border.Thickness = 1; chart.Tooltips.Display = Infragistics.UltraChart.Shared.Styles.TooltipDisplay.Never; chart.Effects.Effects.Add(new Infragistics.UltraChart.Resources.Appearance.GradientEffect()); chart.ColorModel.AlphaLevel = 100; chart.ColorModel.CustomPalette = AppUtility.Constant.ChartPalette; chart.ColorModel.ModelStyle = Infragistics.UltraChart.Shared.Styles.ColorModels.CustomLinear; chart.DoughnutChart3D.OthersCategoryPercent = 5; chart.DoughnutChart3D.OthersCategoryText = "Other ingredients"; chart.DoughnutChart3D.Labels.Font = new Font("Verdana", 8); //chart.DoughnutChart3D.Labels.FontColor = Color.FromArgb(0x33, 0x33, 0x33); chart.DoughnutChart3D.Labels.FormatString = "<ITEM_LABEL>"; chart.Section508Compliant = true; chart.Section508.ChartImage.AltFormatString = (string)dr["Name"] + " ingredients"; // Get ingredient data from cache DataView ingredientsView = CacheManager.GetItem(CacheManager.Cache_GetDrinkIngredientsAll, "GetDrinkIngredientsAll", "Drink_pk,Ingredient_pk", null); ingredientsView.RowFilter = "Drink_pk = " + Convert.ToString(drinkID); ingredientsView.Sort = "Sort ASC"; DataTable dtIngredientProfile = new DataTable(); dtIngredientProfile.Columns.Add("Amount", typeof(decimal)); dtIngredientProfile.Columns.Add("Name", typeof(string)); foreach (DataRowView row in ingredientsView) { dtIngredientProfile.Rows.Add(new object[] { row["AmountWeighted"], row["IngredientName"] }); } chart.DeploymentScenario.FilePath = "desktopmodules/charlesthompson/charlesthompson.liquoranddrink.dnn.drink/chartimages"; chart.DeploymentScenario.ImageURL = ConfigurationManager.AppSettings["SiteUrl"] + "desktopmodules/charlesthompson/charlesthompson.liquoranddrink.dnn.drink/chartimages/DrinkIngredients_#SEQNUM(100).png"; chart.DataSource = dtIngredientProfile; chart.DataBind(); return chart; }
public static void addAnnotations(UltraChart chart, DateTime date_, DeMarkMarker mark, int i, double cellHeight, double[] arr, int openIndex_, int highIndex_, int lowIndex_, int closeIndex_) { if (mark.Disabled.HasValue) return; if (mark.Date == date_) { switch (mark.EventType) { case DeMarkEventType.BuySetupStart: { //var annotation = createAnnotation("BuySetup", i + 0.5d, arr[lowIndex_] - (2 * cellHeight), // Color.LightGreen); //chart.Annotations.Add(annotation); } { var annotation = createHorizontalLineAnnotation(i + 0.5d, i + 50.5d, arr[highIndex_], Color.Red); chart.Annotations.Add(annotation); } break; case DeMarkEventType.BuySetupIndex: { var annotation = createAnnotation(mark.SeriesIndex.ToString(), i + 0.5d, arr[lowIndex_] - (cellHeight / 5d), mark.SeriesIndex == mark.SetupSeriesLength, Color.LimeGreen); chart.Annotations.Add(annotation); } break; case DeMarkEventType.ReducingCountDown: { var annotation = createAnnotation(mark.SeriesIndex.ToString(), i + 0.5d, arr[lowIndex_] - (cellHeight / 2.5d), mark.SeriesIndex == mark.CountDownLength, Color.Red); chart.Annotations.Add(annotation); } break; case DeMarkEventType.SellSetupStart: { //var annotatio = createAnnotation("SellSetup", i + 0.5d, arr[highIndex_] + (2 * cellHeight), // Color.Red); //chart.Annotations.Add(annotatio); } { var annotation = createHorizontalLineAnnotation(i + 0.5d, i + 50.5d, arr[lowIndex_], Color.LimeGreen); chart.Annotations.Add(annotation); } break; case DeMarkEventType.SellSetupIndex: { var annotation = createAnnotation(mark.SeriesIndex.ToString(), i + 0.5d, arr[highIndex_] + (cellHeight / 5d), mark.SeriesIndex == mark.SetupSeriesLength, Color.LimeGreen); chart.Annotations.Add(annotation); } break; case DeMarkEventType.IncreasingCountDown: { var annotation = createAnnotation(mark.SeriesIndex.ToString(), i + 0.5d, arr[highIndex_] + (cellHeight / 2.5d), mark.SeriesIndex == mark.CountDownLength, Color.Red); chart.Annotations.Add(annotation); } break; //case DeMarkEventType.CountDownStop: // { // var annotation = createHorizontalLineAnnotation(i + 0.5d, i + 50.5d, arr[highIndex_], Color.BlanchedAlmond); // chart.Annotations.Add(annotation); // } // break; case DeMarkEventType.PerfectedSellSetup: { var annotation = createArrowAnnotation(i + 0.5d, arr[highIndex_] + (cellHeight / 1.39d), arr[highIndex_] + (cellHeight / 1.9d), Color.Red); chart.Annotations.Add(annotation); } break; case DeMarkEventType.PerfectedBuySetup: { var annotation = createArrowAnnotation(i + 0.5d, arr[lowIndex_] - (cellHeight / 1.39d), arr[lowIndex_] - (cellHeight / 1.9d), Color.LimeGreen); chart.Annotations.Add(annotation); } break; } } if(mark.HasChildren) foreach (var m in mark.Children) addAnnotations(chart, date_, m, i, cellHeight, arr, openIndex_, highIndex_, lowIndex_, closeIndex_); }
private void RefreshComplianceChart() { UltraChart ultraChart2 = null; if (cbDashboardReportType1.SelectedIndex == 0) { ultraChart2 = CreateNewColumnChart(ultraChart1); lbChartTitle.Text = "Overall Software Compliance"; } else if (cbDashboardReportType1.SelectedIndex == 1) { ultraChart2 = CreateNewStackColumnChart("Over-Licensed Applications"); lbChartTitle.Text = "Over-Licensed Applications"; } else if (cbDashboardReportType1.SelectedIndex == 2) { ultraChart2 = CreateNewStackColumnChart("Under-Licensed Applications"); lbChartTitle.Text = "Under-Licensed Applications"; } this.splitContainer1.Panel2.Controls.Clear(); this.splitContainer1.Panel2.Controls.Add(ultraChart2); _selectedReport = cbDashboardReportType1.SelectedItem.ToString(); }
private static void FillGraph(UltraChart ucControl, DataTable dtSource, string sLabel) { XYSeries series1 = new XYSeries(); series1.Label = sLabel; foreach (DataRow r in dtSource.Rows) { series1.Points.Add(new XYDataPoint(Convert.ToDouble(r[0].ToString()), Convert.ToDouble(r[1].ToString()), "", false)); } ucControl.Series.Add(series1); }
private UltraChart GetChartFromControls() { UltraChart currentChart = null; foreach (Control control in _currentTab.Controls) { if (control.GetType() == typeof(UltraChart)) { currentChart = (UltraChart)control; break; } } return(currentChart); }
public ServerDataWidget() { InitializeComponent(); _statisticsDAO = new StatisticsDAO(); cbServers.DataSource = _statisticsDAO.GetServers(); cbServers.DisplayMember = "_NAME"; cbServers.ValueMember = "_ASSETID"; lStackColumnChart = CreateNewStackColumnChart(); splitContainer1.Panel2.Controls.Add(lStackColumnChart); if (cbServers.SelectedValue != null) { lStackColumnChart.DataSource = PopulateChartData((int)cbServers.SelectedValue); } this.ContextMenu = new ContextMenu(); }
private void RedrawPieChart() { _rootLevel = true; string lTabName = _currentTab.Text; UltraChart currentChart = GetChartFromControls(); if (currentChart != null && comboBoxLocations.SelectedValue != null && comboBoxLocations.SelectedValue is int) { currentChart.DataSource = PopulatePieChart(lTabName, (int)comboBoxLocations.SelectedValue); currentChart.Visible = true; _resultsGrid.Visible = false; } if (comboBoxLocations.Text == "System.Data.DataRowView") { comboBoxLocations.Text = "All Locations"; } lbDisplayInfo.Text = String.Format("Displaying {0} by Type in '{1}'", lTabName.ToUpper(), comboBoxLocations.Text); }
void inventoryChart_ChartDataClicked(object sender, Infragistics.UltraChart.Shared.Events.ChartDataEventArgs e) { UltraChart currentChart = GetChartFromControls(); if (_rootLevel) { if (currentChart != null) { currentChart.DataSource = lStatisticsDAO.GetDashboardInventoryItems(e.RowLabel, (int)comboBoxLocations.SelectedValue); } _lastAssetType = e.RowLabel; _rootLevel = false; _resultsGrid.Visible = false; lbDisplayInfo.Text = String.Format("Displaying {0} -> {1} by manufacturer in '{2}'", tabControl1.SelectedTab.Text, e.RowLabel, comboBoxLocations.Text); } else { // user clicked on second level so need to display assets which have this manufacturer DataTable assetTable = lStatisticsDAO.GetDashboardInventoryAssets(e.RowLabel, _lastAssetType, tabControl1.SelectedTab.Text, (int)comboBoxLocations.SelectedValue); _resultsGrid.Visible = true; _resultsGrid.DataSource = assetTable; _resultsGrid.Dock = DockStyle.Fill; currentChart.Visible = false; tabControl1.SelectedTab.Controls.Add(_resultsGrid); _resultsGrid.DisplayLayout.Bands[0].Columns[0].CellAppearance.TextTrimming = Infragistics.Win.TextTrimming.EllipsisWord; _resultsGrid.DisplayLayout.Bands[0].Columns[0].CellMultiLine = Infragistics.Win.DefaultableBoolean.True; _resultsGrid.DisplayLayout.Bands[0].Columns[1].CellAppearance.TextTrimming = Infragistics.Win.TextTrimming.EllipsisWord; _resultsGrid.DisplayLayout.Bands[0].Columns[1].CellMultiLine = Infragistics.Win.DefaultableBoolean.True; _resultsGrid.DisplayLayout.Bands[0].Columns[2].CellAppearance.TextTrimming = Infragistics.Win.TextTrimming.EllipsisWord; _resultsGrid.DisplayLayout.Bands[0].Columns[2].CellMultiLine = Infragistics.Win.DefaultableBoolean.True; lbDisplayInfo.Text = String.Format ("{0} asset(s) of Type '{1}' in '{2}' with manufacturer of '{3}'", _resultsGrid.Rows.Count, _lastAssetType, comboBoxLocations.Text, e.RowLabel); } }
/// <summary> /// 父项条形图两端显示倒三角形 /// </summary> /// <param name="chart"></param> /// <param name="tb"></param> /// <param name="StartField"></param> /// <param name="EndField"></param> /// <param name="RowField"></param> /// <param name="ColumnField"></param> private void SetChartParentBar(UltraChart chart, DataTable tb, string StartField, string EndField, string RowField, string ColumnField) { try { foreach (DataRow dr in tb.Rows) { Infragistics.UltraChart.Resources.Appearance.BoxAnnotation ann = new Infragistics.UltraChart.Resources.Appearance.BoxAnnotation(); int row = (int)dr[RowField]; int col = (int)dr[ColumnField]; ann.FillColor = Color.Transparent; ann.Text = " "; ann.Width = 20; ann.Height = 20; // ann.PE.fi /* * int x = 195; * int y = 26; * ann.Location.Type = Infragistics.UltraChart.Shared.Styles.LocationType.Pixels; * ann.Location.LocationX = x; * ann.Location.LocationY = y; */; ann.Location.Type = Infragistics.UltraChart.Shared.Styles.LocationType.RowColumn; ann.Location.Row = row; ann.Location.Column = col; chart.Annotations.Add(ann); } } catch (Exception ex) { throw ex; } }
private UltraChart CreateChart() { UltraChart inventoryChart = new UltraChart(); Infragistics.UltraChart.Resources.Appearance.PaintElement paintElement1 = new Infragistics.UltraChart.Resources.Appearance.PaintElement(); Infragistics.UltraChart.Resources.Appearance.GradientEffect gradientEffect1 = new Infragistics.UltraChart.Resources.Appearance.GradientEffect(); Infragistics.UltraChart.Resources.Appearance.PieChartAppearance pieChartAppearance1 = new Infragistics.UltraChart.Resources.Appearance.PieChartAppearance(); inventoryChart.Tooltips.Overflow = TooltipOverflow.ChartArea; inventoryChart.ChartType = ChartType.PieChart; // // ultraChart1 // inventoryChart.Axis.BackColor = Color.FromArgb(255, 248, 220); paintElement1.ElementType = PaintElementType.None; paintElement1.Fill = Color.FromArgb(255, 248, 220); inventoryChart.Axis.PE = paintElement1; inventoryChart.Axis.X.Labels.Font = new Font("Verdana", 7F); inventoryChart.Axis.X.Labels.FontColor = Color.DimGray; inventoryChart.Axis.X.Labels.HorizontalAlign = StringAlignment.Near; inventoryChart.Axis.X.Labels.ItemFormatString = "<ITEM_LABEL>"; inventoryChart.Axis.X.Labels.Layout.Behavior = AxisLabelLayoutBehaviors.Auto; inventoryChart.Axis.X.Labels.Orientation = TextOrientation.Horizontal; inventoryChart.Axis.X.Labels.SeriesLabels.Font = new Font("Verdana", 7F); inventoryChart.Axis.X.Labels.SeriesLabels.FontColor = Color.DimGray; inventoryChart.Axis.X.Labels.SeriesLabels.FormatString = ""; inventoryChart.Axis.X.Labels.SeriesLabels.HorizontalAlign = StringAlignment.Near; inventoryChart.Axis.X.Labels.SeriesLabels.Layout.Behavior = AxisLabelLayoutBehaviors.Auto; inventoryChart.Axis.X.Labels.SeriesLabels.Orientation = TextOrientation.Horizontal; inventoryChart.Axis.X.Labels.SeriesLabels.VerticalAlign = StringAlignment.Center; inventoryChart.Axis.X.Labels.VerticalAlign = StringAlignment.Center; inventoryChart.Axis.X.LineThickness = 1; inventoryChart.Axis.X.MajorGridLines.AlphaLevel = 255; inventoryChart.Axis.X.MajorGridLines.Color = Color.Gainsboro; inventoryChart.Axis.X.MajorGridLines.DrawStyle = LineDrawStyle.Dot; inventoryChart.Axis.X.MajorGridLines.Visible = true; inventoryChart.Axis.X.MinorGridLines.AlphaLevel = 255; inventoryChart.Axis.X.MinorGridLines.Color = Color.LightGray; inventoryChart.Axis.X.MinorGridLines.DrawStyle = LineDrawStyle.Dot; inventoryChart.Axis.X.MinorGridLines.Visible = false; inventoryChart.Axis.X.TickmarkStyle = AxisTickStyle.Smart; inventoryChart.Axis.X.Visible = true; inventoryChart.Axis.X2.Labels.Font = new Font("Verdana", 7F); inventoryChart.Axis.X2.Labels.FontColor = Color.Gray; inventoryChart.Axis.X2.Labels.HorizontalAlign = StringAlignment.Near; inventoryChart.Axis.X2.Labels.ItemFormatString = ""; inventoryChart.Axis.X2.Labels.Layout.Behavior = AxisLabelLayoutBehaviors.Auto; inventoryChart.Axis.X2.Labels.Orientation = TextOrientation.Horizontal; inventoryChart.Axis.X2.Labels.SeriesLabels.Font = new Font("Verdana", 7F); inventoryChart.Axis.X2.Labels.SeriesLabels.FontColor = Color.Gray; inventoryChart.Axis.X2.Labels.SeriesLabels.FormatString = ""; inventoryChart.Axis.X2.Labels.SeriesLabels.HorizontalAlign = StringAlignment.Near; inventoryChart.Axis.X2.Labels.SeriesLabels.Layout.Behavior = AxisLabelLayoutBehaviors.Auto; inventoryChart.Axis.X2.Labels.SeriesLabels.Orientation = TextOrientation.Horizontal; inventoryChart.Axis.X2.Labels.SeriesLabels.VerticalAlign = StringAlignment.Center; inventoryChart.Axis.X2.Labels.VerticalAlign = StringAlignment.Center; inventoryChart.Axis.X2.Labels.Visible = false; inventoryChart.Axis.X2.LineThickness = 1; inventoryChart.Axis.X2.MajorGridLines.AlphaLevel = 255; inventoryChart.Axis.X2.MajorGridLines.Color = Color.Gainsboro; inventoryChart.Axis.X2.MajorGridLines.DrawStyle = LineDrawStyle.Dot; inventoryChart.Axis.X2.MajorGridLines.Visible = true; inventoryChart.Axis.X2.MinorGridLines.AlphaLevel = 255; inventoryChart.Axis.X2.MinorGridLines.Color = Color.LightGray; inventoryChart.Axis.X2.MinorGridLines.DrawStyle = LineDrawStyle.Dot; inventoryChart.Axis.X2.MinorGridLines.Visible = false; inventoryChart.Axis.X2.TickmarkStyle = AxisTickStyle.Smart; inventoryChart.Axis.X2.Visible = false; inventoryChart.Axis.Y.Labels.Font = new Font("Verdana", 7F); inventoryChart.Axis.Y.Labels.FontColor = Color.DimGray; inventoryChart.Axis.Y.Labels.HorizontalAlign = StringAlignment.Near; inventoryChart.Axis.Y.Labels.ItemFormatString = "<DATA_VALUE:00.##>"; inventoryChart.Axis.Y.Labels.Layout.Behavior = AxisLabelLayoutBehaviors.Auto; inventoryChart.Axis.Y.Labels.Orientation = TextOrientation.Horizontal; inventoryChart.Axis.Y.Labels.SeriesLabels.Font = new Font("Verdana", 7F); inventoryChart.Axis.Y.Labels.SeriesLabels.FontColor = Color.DimGray; inventoryChart.Axis.Y.Labels.SeriesLabels.FormatString = ""; inventoryChart.Axis.Y.Labels.SeriesLabels.HorizontalAlign = StringAlignment.Near; inventoryChart.Axis.Y.Labels.SeriesLabels.Layout.Behavior = AxisLabelLayoutBehaviors.Auto; inventoryChart.Axis.Y.Labels.SeriesLabels.Orientation = TextOrientation.Horizontal; inventoryChart.Axis.Y.Labels.SeriesLabels.VerticalAlign = StringAlignment.Center; inventoryChart.Axis.Y.Labels.VerticalAlign = StringAlignment.Center; inventoryChart.Axis.Y.LineThickness = 1; inventoryChart.Axis.Y.MajorGridLines.AlphaLevel = 255; inventoryChart.Axis.Y.MajorGridLines.Color = Color.Gainsboro; inventoryChart.Axis.Y.MajorGridLines.DrawStyle = LineDrawStyle.Dot; inventoryChart.Axis.Y.MajorGridLines.Visible = true; inventoryChart.Axis.Y.MinorGridLines.AlphaLevel = 255; inventoryChart.Axis.Y.MinorGridLines.Color = Color.LightGray; inventoryChart.Axis.Y.MinorGridLines.DrawStyle = LineDrawStyle.Dot; inventoryChart.Axis.Y.MinorGridLines.Visible = false; inventoryChart.Axis.Y.TickmarkInterval = 10; inventoryChart.Axis.Y.TickmarkStyle = AxisTickStyle.Smart; inventoryChart.Axis.Y.Visible = true; inventoryChart.Axis.Y2.Labels.Font = new Font("Verdana", 7F); inventoryChart.Axis.Y2.Labels.FontColor = Color.Gray; inventoryChart.Axis.Y2.Labels.HorizontalAlign = StringAlignment.Near; inventoryChart.Axis.Y2.Labels.ItemFormatString = ""; inventoryChart.Axis.Y2.Labels.Layout.Behavior = AxisLabelLayoutBehaviors.Auto; inventoryChart.Axis.Y2.Labels.Orientation = TextOrientation.Horizontal; inventoryChart.Axis.Y2.Labels.SeriesLabels.Font = new Font("Verdana", 7F); inventoryChart.Axis.Y2.Labels.SeriesLabels.FontColor = Color.Gray; inventoryChart.Axis.Y2.Labels.SeriesLabels.FormatString = ""; inventoryChart.Axis.Y2.Labels.SeriesLabels.HorizontalAlign = StringAlignment.Near; inventoryChart.Axis.Y2.Labels.SeriesLabels.Layout.Behavior = AxisLabelLayoutBehaviors.Auto; inventoryChart.Axis.Y2.Labels.SeriesLabels.Orientation = TextOrientation.Horizontal; inventoryChart.Axis.Y2.Labels.SeriesLabels.VerticalAlign = StringAlignment.Center; inventoryChart.Axis.Y2.Labels.VerticalAlign = StringAlignment.Center; inventoryChart.Axis.Y2.Labels.Visible = false; inventoryChart.Axis.Y2.LineThickness = 1; inventoryChart.Axis.Y2.MajorGridLines.AlphaLevel = 255; inventoryChart.Axis.Y2.MajorGridLines.Color = Color.Gainsboro; inventoryChart.Axis.Y2.MajorGridLines.DrawStyle = LineDrawStyle.Dot; inventoryChart.Axis.Y2.MajorGridLines.Visible = true; inventoryChart.Axis.Y2.MinorGridLines.AlphaLevel = 255; inventoryChart.Axis.Y2.MinorGridLines.Color = Color.LightGray; inventoryChart.Axis.Y2.MinorGridLines.DrawStyle = LineDrawStyle.Dot; inventoryChart.Axis.Y2.MinorGridLines.Visible = false; inventoryChart.Axis.Y2.TickmarkInterval = 10; inventoryChart.Axis.Y2.TickmarkStyle = AxisTickStyle.Smart; inventoryChart.Axis.Y2.Visible = false; inventoryChart.Axis.Z.Labels.Font = new Font("Verdana", 7F); inventoryChart.Axis.Z.Labels.FontColor = Color.DimGray; inventoryChart.Axis.Z.Labels.HorizontalAlign = StringAlignment.Near; inventoryChart.Axis.Z.Labels.ItemFormatString = ""; inventoryChart.Axis.Z.Labels.Layout.Behavior = AxisLabelLayoutBehaviors.Auto; inventoryChart.Axis.Z.Labels.Orientation = TextOrientation.Horizontal; inventoryChart.Axis.Z.Labels.SeriesLabels.Font = new Font("Verdana", 7F); inventoryChart.Axis.Z.Labels.SeriesLabels.FontColor = Color.DimGray; inventoryChart.Axis.Z.Labels.SeriesLabels.HorizontalAlign = StringAlignment.Near; inventoryChart.Axis.Z.Labels.SeriesLabels.Layout.Behavior = AxisLabelLayoutBehaviors.Auto; inventoryChart.Axis.Z.Labels.SeriesLabels.Orientation = TextOrientation.Horizontal; inventoryChart.Axis.Z.Labels.SeriesLabels.VerticalAlign = StringAlignment.Center; inventoryChart.Axis.Z.Labels.VerticalAlign = StringAlignment.Center; inventoryChart.Axis.Z.Labels.Visible = false; inventoryChart.Axis.Z.LineThickness = 1; inventoryChart.Axis.Z.MajorGridLines.AlphaLevel = 255; inventoryChart.Axis.Z.MajorGridLines.Color = Color.Gainsboro; inventoryChart.Axis.Z.MajorGridLines.DrawStyle = LineDrawStyle.Dot; inventoryChart.Axis.Z.MajorGridLines.Visible = true; inventoryChart.Axis.Z.MinorGridLines.AlphaLevel = 255; inventoryChart.Axis.Z.MinorGridLines.Color = Color.LightGray; inventoryChart.Axis.Z.MinorGridLines.DrawStyle = LineDrawStyle.Dot; inventoryChart.Axis.Z.MinorGridLines.Visible = false; inventoryChart.Axis.Z.TickmarkStyle = AxisTickStyle.Smart; inventoryChart.Axis.Z.Visible = false; inventoryChart.Axis.Z2.Labels.Font = new Font("Verdana", 7F); inventoryChart.Axis.Z2.Labels.FontColor = Color.Gray; inventoryChart.Axis.Z2.Labels.HorizontalAlign = StringAlignment.Near; inventoryChart.Axis.Z2.Labels.ItemFormatString = ""; inventoryChart.Axis.Z2.Labels.Layout.Behavior = AxisLabelLayoutBehaviors.Auto; inventoryChart.Axis.Z2.Labels.Orientation = TextOrientation.Horizontal; inventoryChart.Axis.Z2.Labels.SeriesLabels.Font = new Font("Verdana", 7F); inventoryChart.Axis.Z2.Labels.SeriesLabels.FontColor = Color.Gray; inventoryChart.Axis.Z2.Labels.SeriesLabels.HorizontalAlign = StringAlignment.Near; inventoryChart.Axis.Z2.Labels.SeriesLabels.Layout.Behavior = AxisLabelLayoutBehaviors.Auto; inventoryChart.Axis.Z2.Labels.SeriesLabels.Orientation = TextOrientation.Horizontal; inventoryChart.Axis.Z2.Labels.SeriesLabels.VerticalAlign = StringAlignment.Center; inventoryChart.Axis.Z2.Labels.VerticalAlign = StringAlignment.Center; inventoryChart.Axis.Z2.Labels.Visible = false; inventoryChart.Axis.Z2.LineThickness = 1; inventoryChart.Axis.Z2.MajorGridLines.AlphaLevel = 255; inventoryChart.Axis.Z2.MajorGridLines.Color = Color.Gainsboro; inventoryChart.Axis.Z2.MajorGridLines.DrawStyle = LineDrawStyle.Dot; inventoryChart.Axis.Z2.MajorGridLines.Visible = true; inventoryChart.Axis.Z2.MinorGridLines.AlphaLevel = 255; inventoryChart.Axis.Z2.MinorGridLines.Color = Color.LightGray; inventoryChart.Axis.Z2.MinorGridLines.DrawStyle = LineDrawStyle.Dot; inventoryChart.Axis.Z2.MinorGridLines.Visible = false; inventoryChart.Axis.Z2.TickmarkStyle = AxisTickStyle.Smart; inventoryChart.Axis.Z2.Visible = false; inventoryChart.BackgroundImageLayout = ImageLayout.Center; inventoryChart.Border.Thickness = 0; inventoryChart.ColorModel.AlphaLevel = 100; inventoryChart.ColorModel.ColorBegin = Color.Pink; inventoryChart.ColorModel.ColorEnd = Color.DarkRed; inventoryChart.ColorModel.ModelStyle = ColorModels.CustomLinear; inventoryChart.Dock = DockStyle.Fill; gradientEffect1.Coloring = GradientColoringStyle.Lighten; gradientEffect1.Style = GradientStyle.BackwardDiagonal; inventoryChart.Effects.Effects.Add(gradientEffect1); inventoryChart.EmptyChartText = ""; inventoryChart.Location = new Point(0, 0); inventoryChart.Name = "inventoryChart"; pieChartAppearance1.Labels.Font = new Font("Verdana", 7.25F, FontStyle.Regular, GraphicsUnit.Point, 0); pieChartAppearance1.Labels.FontColor = Color.DimGray; pieChartAppearance1.Labels.FormatString = "<ITEM_LABEL> (<DATA_VALUE:#0>)"; pieChartAppearance1.Labels.LeaderLineColor = Color.DimGray; pieChartAppearance1.RadiusFactor = 85; inventoryChart.PieChart = pieChartAppearance1; inventoryChart.Size = new Size(526, 249); inventoryChart.TabIndex = 2; inventoryChart.Tooltips.Font = new Font("Verdana", 7.25F, FontStyle.Regular, GraphicsUnit.Point, 0); inventoryChart.Tooltips.FormatString = "<ITEM_LABEL>"; inventoryChart.Tooltips.HighlightFillColor = Color.LightBlue;; inventoryChart.Tooltips.HighlightOutlineColor = Color.DarkGray; inventoryChart.InvalidDataReceived += ultraChart1_InvalidDataReceived; inventoryChart.ChartDataClicked += inventoryChart_ChartDataClicked; //inventoryChart.ChartDrawItem += new Infragistics.UltraChart.Shared.Events.ChartDrawItemEventHandler(inventoryChart_ChartDrawItem); inventoryChart.PieChart.OthersCategoryPercent = 0; return(inventoryChart); }
public static UltraChart CreateAchartByDesignTime(ChartSchemaItemAmong among) { UltraChart ultraChart = new UltraChart(); //Color color = ultraChart.BackColor; if (!string.IsNullOrEmpty(among.ChartXml)) { using (StringReader sR = new StringReader(among.ChartXml)) { ultraChart.LoadPreset(sR, true); } } //有些控件只能显示百分比,不能显示数字,所以要屏下面设置 if (ultraChart.ChartType != ChartType.PieChart3D && ultraChart.ChartType != ChartType.DoughnutChart3D) { if (ultraChart.ChartType == ChartType.PieChart || ultraChart.ChartType == ChartType.DoughnutChart) { if (!among.ShowPercent) { ChartStyleHelper.InitChartWithSolidProperty(ultraChart); } } else { ChartStyleHelper.InitChartWithSolidProperty(ultraChart); } } ultraChart.Axis.Y.TickmarkStyle = AxisTickStyle.Smart; //Y轴数据自动算值的,去除了小数点坐标 ultraChart.Data.ZeroAligned = true; //是否从0开始算值 //ultraChart.Margin = new Padding(10, 10, 10, 10); //ultraChart.Legend.DataAssociation = ChartTypeData.DefaultData; //ultraChart.Legend.SpanPercentage = 10; //ultraChart.MouseHover += new EventHandler(ultraChart_MouseHover); ////ultraChart.Axis.Y.TickmarkStyle = AxisTickStyle.Percentage; ////ultraChart.Axis.Y.Labels.VerticalAlign = StringAlignment.Near; ////ultraChart.Axis.X.Labels.VerticalAlign = StringAlignment.Near; //ultraChart.Axis.Y.Labels.Flip = true; ultraChart.ColorModel.ModelStyle = ColorModels.LinearRange; //ultraChart.ColorModel.ColorBegin = Color.LimeGreen; //ultraChart.ColorModel.ColorEnd = Color.Gold; ultraChart.ColorModel.ColorBegin = Color.LimeGreen; ultraChart.ColorModel.ColorEnd = Color.Gray; //ultraChart.ColorModel.Scaling = ColorScaling.Oscillating; //ultraChart.Data.EmptyStyle.LineStyle.MidPointAnchors = false; //ultraChart.Data.EmptyStyle.LineStyle.StartStyle = LineCapStyle.NoAnchor; ultraChart.TitleTop.Text = among.Caption;//图表名称 ultraChart.TitleTop.HorizontalAlign = StringAlignment.Center; ultraChart.BackColor = Color.White; ultraChart.Axis.X.Labels.SeriesLabels.Font = new Font("宋体", 9, FontStyle.Regular); ultraChart.Axis.Y.Labels.Font = new Font("宋体", 9, FontStyle.Regular); ultraChart.Axis.Y2.Labels.Font = new Font("宋体", 9, FontStyle.Regular); if (among.Width != 0) { ultraChart.Width = among.Width; ultraChart.Height = among.Height; } ((Control)ultraChart).Location = among.Position; ultraChart.Anchor = AnchorStyles.Left | AnchorStyles.Top; //ChartTextAppearance text = new ChartTextAppearance(); //text.Column = -2; //text.Row = -2; //text.PositionFromRadius = 50; //text.VerticalAlign = System.Drawing.StringAlignment.Far; //text.ItemFormatString = "<DATA_VALUE:00.00>"; //text.Visible = true; //ultraChart.ColumnChart.ChartText.Add(text); return(ultraChart); }
private static void AddAnnotation(UltraChart chart, MeteoGtzYear meteoGtzYear, bool pdf) { var relativeData = meteoGtzYear.ToRelativeData(); var textStyle = new LabelStyle { Font = new Font("Verdana", pdf ? 6.5f : 8.5f, FontStyle.Italic, GraphicsUnit.Point), FontColor = Constants.YearsChartColors[1], HorizontalAlign = StringAlignment.Center, FontSizeBestFit = false, ClipText = true, Orientation = TextOrientation.Horizontal, WrapText = false, Flip = true, VerticalAlign = StringAlignment.Center, Dy = 0 }; var ann = new TextAnnatation { Width = pdf ? 80 : -1, Location = new Location { Type = LocationType.RowColumn, Row = 0, Column = 1 }, Text = GetAnnotationText(relativeData.Period2, "war um"), TextStyle = textStyle }; chart.Annotations.Add(ann); ann = new TextAnnatation { Width = pdf ? 80 : -1, Location = new Location { Type = LocationType.RowColumn, Row = 0, Column = 2, ValueY = meteoGtzYear.Period2 }, Text = GetAnnotationText(relativeData.Period3, "war um"), TextStyle = textStyle }; chart.Annotations.Add(ann); }
/// <summary> /// 新增供U易联调用的接口 /// </summary> /// <param name="login"></param> /// <param name="actionType"></param> /// <param name="parameters"></param> /// <param name="responseXml"></param> /// <returns></returns> public string Execute(U8LoginInfor login, string actionType, Dictionary <string, string> parameters, ref string responseXml) { string result = ""; bool is4chart = false; if (parameters.ContainsKey("is4chart")) { is4chart = Boolean.Parse(parameters["is4chart"]); } this._loginInfo = login; this._responseXml = responseXml; if (!this.CheckReportExist(parameters)) { result = "该查询方案不存在,可能已经取消发布到移动端,请确认!"; throw new Exception("该查询方案不存在,可能已经取消发布到移动端,请确认!"); } try { MobileReportEngine engine = new MobileReportEngine(this._loginInfo, actionType, parameters, ref responseXml); int startLine = Convert.ToInt32(this.GetInformationByKey("startline", parameters)); this._columnsStr = this.GetInformationByKey("columnsstring", parameters); int pageRowCount = 25; if (this.GetInformationByKey("count", parameters) != null) { pageRowCount = Convert.ToInt32(this.GetInformationByKey("count", parameters)); } engine.SetReportPageRowCount(pageRowCount); if (startLine == 1) //请求第一页数据 { this._mobileReport = engine.OpenReport(parameters); this._pageRowsCount = engine.GetReportPageRowCount(); //this._mobileReport = this.OpenReport(this._loginInfo, parameters); this._mobileReport.Page = 0; int totalpage = this._mobileReport.Report.RowsCount / this._pageRowsCount + 1; string reportCacheString = RetrieveRowData2Json.GetColumnsInfoString(this._mobileReport); this.SetCacheInfoIntoSession(ref responseXml, "currentpage", "1"); this.SetCacheInfoIntoSession(ref responseXml, "totalpage", totalpage.ToString()); byte[] bytes = Encoding.Default.GetBytes(reportCacheString); reportCacheString = Convert.ToBase64String(bytes); this.SetCacheInfoIntoSession(ref responseXml, "columnsString", reportCacheString); this.SetCacheInfoIntoSession(ref responseXml, "cacheid", this._mobileReport.Report.CacheID); } else { int pageIndex = Convert.ToInt32(this.GetCacheInfoFromSession(responseXml, "currentpage")); if (pageIndex == 0) { pageIndex = Convert.ToInt32(this.GetInformationByKey("currentpage", parameters)); //pageIndex = Convert.ToInt32(parameters["currentpage"].ToString()); } int totalpage = Convert.ToInt32(this.GetCacheInfoFromSession(responseXml, "totalpage")); if (totalpage == 0) { totalpage = Convert.ToInt32(this.GetInformationByKey("totalpage", parameters)); this._totolPage = totalpage.ToString(); } if (pageIndex + 1 > totalpage) { result = null; return(result); } else { string cacheId = GetCacheInfoFromSession(responseXml, "cacheid"); if (string.IsNullOrEmpty(cacheId)) { cacheId = this.GetInformationByKey("cacheid", parameters); this._cacheid = cacheId; } int lastIndex = -1; //this._mobileReport = this.PageTo(cacheId, pageIndex, lastIndex); this._mobileReport = engine.PageTo(cacheId, pageIndex, lastIndex); this.SetCacheInfoIntoSession(ref responseXml, "currentpage", (pageIndex + 1).ToString()); this._mobileReport.Page = pageIndex + 1; } } if (_mobileReport != null) { int pageIndex = Convert.ToInt32(this.GetCacheInfoFromSession(responseXml, "currentpage")); if (pageIndex == 0) { if (parameters.ContainsKey("currentpage")) { pageIndex = Convert.ToInt32(this.GetInformationByKey("currentpage", parameters)); } } // 由于CS端每页都需要显示总计行,这里需要将不是最后一页的总计行删除掉 //if (!bLastPage(pageIndex, _mobileReport.Report) && this._mobileReport.Report.Sections[SectionType.ReportSummary] != null) //{ // _mobileReport.SemiRows.RemoveAt(_mobileReport.SemiRows.Count - 1); //} // 如果是请求图表数据 if (is4chart) { var report = _mobileReport.Report; engine.InitMobileReportChartSchema(report); ChartService chartservice = new ChartService(report); ChartSchemas css = report.ChartSchemas; if (css.CurrentGroupChart.Items != null && css.CurrentGroupChart.Items.Count > 0) { ChartSchemaItem groupCharts = css.CurrentGroupChart.Items[1] as ChartSchemaItem; if (groupCharts != null) { foreach (ChartSchemaItemAmong among in groupCharts.Items.Values) { UltraChart designChart = MobileChartHelper.CreateAchartByDesignTime(among); var dataTable1 = chartservice.GetDataSource(groupCharts.Level, among.ID, null, designChart.ChartType); MobileChart mobileChart = new MobileChart(designChart.ChartType, dataTable1); string result1 = MobileChartHelper.TransferDataTableToString(mobileChart); MobileChartHelper.Desrialize <MobileChart>(mobileChart, result1); return(result1); } } } } System.Diagnostics.Trace.WriteLine("<<<<<<<<<<MobileReportTest>>>>>>>>>>OpenReport-->ParseReport TaskID: " + _loginInfo.TaskID + " Start:" + System.DateTime.Now.ToString()); result = ULinkParse(this._mobileReport); System.Diagnostics.Trace.WriteLine("<<<<<<<<<<MobileReportTest>>>>>>>>>>OpenReport-->ParseReport TaskID: " + _loginInfo.TaskID + " End:" + System.DateTime.Now.ToString()); } } catch (Exception ex) { if (ex.Message.Contains("无法将类型为“U8Login.clsLoginClass”的 COM 对象强制转换为接口类型“U8Login._clsLogin”") && !parameters.ContainsKey("AAA")) { parameters.Add("AAA", "1"); return(Execute(this._loginInfo, actionType, parameters, ref responseXml)); } else { throw ex; } } System.Diagnostics.Trace.WriteLine("<<<<<<<<<<MobileReportTest>>>>>>>>>>OpenReport-->ExecuteOpenReport TaskID: " + this._loginInfo.UserToken + " End:" + System.DateTime.Now.ToString()); return(result); }
public static UltraChart GetIngredientChartControl(int ingredientID) { // Get ingredient data from cache DataView dataView = CacheManager.GetItem(CacheManager.Cache_GetIngredients, "GetIngredients", "Ingredient_pk", null); DataRow dr = dataView.Table.Rows.Find(ingredientID); UltraChart chart = new UltraChart(); chart.ID = "_ingredientChart"; chart.ChartType = Infragistics.UltraChart.Shared.Styles.ChartType.RadarChart; chart.JavaScriptEnabled = false; chart.Height = Unit.Pixel(300); chart.Width = Unit.Pixel(300); chart.BackColor = Color.White; chart.Tooltips.Display = Infragistics.UltraChart.Shared.Styles.TooltipDisplay.Never; chart.Effects.Effects.Add(new Infragistics.UltraChart.Resources.Appearance.GradientEffect()); chart.ColorModel.AlphaLevel = 1; chart.ColorModel.ModelStyle = Infragistics.UltraChart.Shared.Styles.ColorModels.LinearRange; chart.ColorModel.ColorBegin = Color.FromArgb(108, 162, 36); chart.ColorModel.ColorEnd = Color.FromArgb(108, 162, 36); chart.RadarChart.SplineTension = 0; chart.RadarChart.ColorFill = true; chart.RadarChart.SpacingAroundChart = 40; chart.Border.CornerRadius = 4; chart.Border.DrawStyle = Infragistics.UltraChart.Shared.Styles.LineDrawStyle.Solid; chart.Border.Color = Color.FromArgb(0xcc, 0xcc, 0xcc); chart.Border.Thickness = 1; chart.Axis.X.Labels.Font = new Font("Verdana", 8); chart.Axis.X.Labels.ItemFormatString = "<ITEM_LABEL>"; chart.Axis.Y.LineThickness = 1; chart.Axis.Y.LineDrawStyle = Infragistics.UltraChart.Shared.Styles.LineDrawStyle.Dot; chart.Axis.Y.LineColor = Color.FromArgb(0xcc, 0xcc, 0xcc); chart.Axis.Y.TickmarkStyle = Infragistics.UltraChart.Shared.Styles.AxisTickStyle.Smart; chart.Axis.Y.Visible = true; chart.Axis.Y.RangeMax = 5; chart.Axis.Y.RangeType = Infragistics.UltraChart.Shared.Styles.AxisRangeType.Custom; chart.Axis.Y.MajorGridLines.AlphaLevel = 255; chart.Axis.Y.MajorGridLines.Color = Color.FromArgb(0xcc, 0xcc, 0xcc); chart.Axis.Y.MajorGridLines.DrawStyle = Infragistics.UltraChart.Shared.Styles.LineDrawStyle.Dot; chart.Axis.Y.MajorGridLines.Thickness = 1; chart.Axis.Y.MajorGridLines.Visible = true; chart.Axis.Y.Labels.Font = new Font("Verdana", 8); chart.Axis.Y.Labels.FontColor = Color.FromArgb(0x66, 0x66, 0x66); chart.Axis.Y.Labels.ItemFormatString = "<DATA_VALUE:0>"; chart.Section508Compliant = true; chart.Section508.ChartImage.AltFormatString = (string)dr["IngredientName"] + " flavor profile"; DataTable dtFlavorProfile = new DataTable(); dtFlavorProfile.Columns.Add("Body", typeof(decimal)); dtFlavorProfile.Columns.Add("Sweet", typeof(decimal)); dtFlavorProfile.Columns.Add("Acidity", typeof(decimal)); dtFlavorProfile.Columns.Add("Fresh Fruit", typeof(decimal)); dtFlavorProfile.Columns.Add("Dried Fruit", typeof(decimal)); dtFlavorProfile.Columns.Add("Spice", typeof(decimal)); dtFlavorProfile.Columns.Add("Heat", typeof(decimal)); dtFlavorProfile.Columns.Add("Wood", typeof(decimal)); dtFlavorProfile.Rows.Add(new object[] {dr["Body"], dr["Sweet"], dr["Sour"], dr["FreshFruit"], dr["DriedFruit"], dr["Spice"], dr["Heat"], dr["Wood"]}); chart.DeploymentScenario.FilePath = "desktopmodules/charlesthompson/charlesthompson.liquoranddrink.dnn.ingredient/chartimages"; chart.DeploymentScenario.ImageURL = ConfigurationManager.AppSettings["SiteUrl"] + "desktopmodules/charlesthompson/charlesthompson.liquoranddrink.dnn.ingredient/chartimages/FlavorProfile_#SEQNUM(100).png"; chart.DataSource = dtFlavorProfile; chart.DataBind(); if (dr["Body"] == DBNull.Value && dr["Sweet"] == DBNull.Value && dr["Sour"] == DBNull.Value && dr["FreshFruit"] == DBNull.Value && dr["DriedFruit"] == DBNull.Value && dr["Spice"] == DBNull.Value && dr["Heat"] == DBNull.Value && dr["Wood"] == DBNull.Value) {// No flavor profile information so return null chart = null; } return chart; }
public static UltraChart GetChart(object datasource, int width, int height, params string[] columnLabels) { var chart = new UltraChart(); chart.FillSceneGraph += ChartOnFillSceneGraph; //.ID = "ChartVergleichJahr" chart.DeploymentScenario = deploymentScenario; chart.Width = width; chart.Height = height; chart.Border.Thickness = 0; var colorModel = chart.ColorModel; colorModel.ModelStyle = ColorModels.CustomLinear; //.AlphaLevel = 150 colorModel.CustomPalette = Constants.ChartColors; var gradientEffect = new GradientEffect { Coloring = GradientColoringStyle.Darken }; chart.Effects.Add(gradientEffect); chart.ChartType = ChartType.ColumnChart; chart.ImagePipePageName = Constants.ImagePipePageName; var cta = new ChartTextAppearance(); cta.ItemFormatString = "<DATA_VALUE:#0.00>"; cta.Visible = false; cta.ChartTextFont = new Font("Arial", 5, FontStyle.Regular, GraphicsUnit.Point); cta.Column = -2; cta.Row = -2; cta.VerticalAlign = StringAlignment.Far; cta.HorizontalAlign = StringAlignment.Center; var columnChart = chart.ColumnChart; columnChart.ChartText.Add(cta); columnChart.ColumnSpacing = 0; columnChart.SeriesSpacing = 1; var legend = chart.Legend; legend.BackgroundColor = Color.Transparent; legend.Visible = true; legend.Location = LegendLocation.Top; legend.SpanPercentage = 10; legend.BorderThickness = 0; legend.DataAssociation = ChartTypeData.LineData; var margins = legend.Margins; margins.Bottom = 1; margins.Top = 1; margins.Left = 50; margins.Right = 1; //'*** Implementierungs IRenderLabel für die Labels-Formatierung Hashtable labelHash = new Hashtable(); labelHash.Add("MY_MONTH_LABEL", new MonthLabelRenderer()); chart.LabelHash = labelHash; chart.Axis.X.Labels.SeriesLabels.Format = AxisSeriesLabelFormat.Custom; chart.Axis.X.Labels.SeriesLabels.FormatString = "<MY_MONTH_LABEL>"; //'*** END Implementierungs IRenderLabel-Interface für die Labels-Formatierung var axisX = chart.Axis.X; axisX.Extent = 30; axisX.LineColor = Color.Green; axisX.LineThickness = 1; axisX.TickmarkStyle = AxisTickStyle.Smart; axisX.TickmarkInterval = 1; axisX.Labels.Visible = false; //.Labels.ItemFormatString = "<ITEM_LABEL>" axisX.Labels.Orientation = TextOrientation.VerticalLeftFacing; axisX.Labels.HorizontalAlign = StringAlignment.Near; axisX.Labels.VerticalAlign = StringAlignment.Center; axisX.Labels.Font = new Font("Verdana", 9, FontStyle.Regular, GraphicsUnit.Point); axisX.Labels.FontColor = Color.Black; axisX.Labels.Layout.Padding = 25; //.Labels.SeriesLabels.Format = Infragistics.UltraChart.Shared.Styles.AxisSeriesLabelFormat.Custom //.Labels.SeriesLabels.FormatString = "<MY_MONTH_LABEL>" axisX.Labels.SeriesLabels.Font = new Font("Verdana", 9, FontStyle.Regular, GraphicsUnit.Point); axisX.Labels.SeriesLabels.Orientation = TextOrientation.Horizontal; axisX.Labels.SeriesLabels.FontColor = Color.Black; axisX.Labels.SeriesLabels.HorizontalAlign = StringAlignment.Far; axisX.Labels.SeriesLabels.VerticalAlign = StringAlignment.Near; axisX.Labels.SeriesLabels.Layout.Behavior = AxisLabelLayoutBehaviors.Auto; axisX.Labels.SeriesLabels.Layout.Padding = 20; axisX.MajorGridLines.Visible = false; axisX.MinorGridLines.Visible = false; var axisY = chart.Axis.Y; axisY.Extent = 20; axisY.LineThickness = 1; axisY.TickmarkInterval = 1; axisY.TickmarkStyle = AxisTickStyle.Smart; //.RangeType = AxisRangeType.Custom //.RangeMin = -3 //.RangeMax = 2 //.Margin.Near.Value = 20 'New Infragistics.UltraChart.Resources.Appearance.AxisMargin( //.Margin.Far.Value = 20 axisY.Labels.Orientation = TextOrientation.Horizontal; axisY.Labels.HorizontalAlign = StringAlignment.Far; axisY.Labels.ItemFormatString = "<DATA_VALUE:0.##>"; axisY.Labels.Font = new Font("Verdana", 9, FontStyle.Regular, GraphicsUnit.Point); axisY.Labels.FontColor = Color.Black; axisY.Labels.SeriesLabels.Font = new Font("Verdana", 9, FontStyle.Regular, GraphicsUnit.Point); axisY.Labels.SeriesLabels.FontColor = Color.Black; axisY.Labels.SeriesLabels.Orientation = TextOrientation.VerticalLeftFacing; axisY.Labels.SeriesLabels.FontColor = Color.Black; axisY.Labels.SeriesLabels.HorizontalAlign = StringAlignment.Far; axisY.Labels.SeriesLabels.VerticalAlign = StringAlignment.Center; var titleLeft = chart.TitleLeft; titleLeft.Visible = true; titleLeft.Extent = 30; titleLeft.Font = new Font("Arial", 9.75f, FontStyle.Bold, GraphicsUnit.Point); titleLeft.HorizontalAlign = StringAlignment.Center; titleLeft.Text = "Monat war im Vergleich zum Langzeitmittel" + Environment.NewLine + " kälter / wärmer [%]"; var titleLeftmargins = titleLeft.Margins; titleLeftmargins.Bottom = 1; titleLeftmargins.Top = 1; titleLeftmargins.Left = 1; titleLeftmargins.Right = 1; var titleTop = chart.TitleTop; titleTop.Extent = 33; titleTop.Font = new Font("Arial", 8, FontStyle.Bold, GraphicsUnit.Point); var titleTopMargins = titleTop.Margins; titleTopMargins.Bottom = 10; titleTopMargins.Top = 0; titleTopMargins.Left = 15; titleTopMargins.Right = 0; var titleBottom = chart.TitleBottom; titleBottom.Text = ""; titleBottom.Extent = 33; titleBottom.Font = new Font("Microsoft Sans Serif", 9.75f, FontStyle.Bold, GraphicsUnit.Point); titleBottom.HorizontalAlign = StringAlignment.Center; var titleBottomMargins = titleBottom.Margins; titleBottomMargins.Bottom = 1; titleBottomMargins.Top = 1; titleBottomMargins.Left = 1; titleBottomMargins.Right = 1; var tooltips = chart.Tooltips; tooltips.FormatString = "<DATA_VALUE:0.000000>"; var data = chart.Data; if (columnLabels != null) { data.SetColumnLabels(columnLabels); } //data.SetColumnLabels(new string[] { // "Vorjahr", // "Aktuelles Jahr", // "Langzeitmittel (Nulllinie)" //}); data.UseRowLabelsColumn = true; data.ZeroAligned = true; data.DataSource = datasource; data.DataBind(); try { data.IncludeColumn("Promille", false); data.IncludeColumn("Vorjahr gewichtet", false); data.IncludeColumn("Aktuelles Jahr gewichtet", false); } catch (Exception ex) { } return chart; }
//Revised for defect #1359 private void SetChartStype(UltraChart chart, string columnName, LoggingUsageDataSet dataset) { List<int> countsList = new List<int>(); foreach (DataRow row in dataset.T_IC_LOGGING_USAGE.Rows) { countsList.Add(Convert.ToInt32(row[columnName])); } int maxValue = countsList.Max(); chart.Axis.X.TickmarkStyle = AxisTickStyle.Smart; if (maxValue < 6) { chart.Axis.X.TickmarkStyle = AxisTickStyle.DataInterval; chart.Axis.X.TickmarkInterval = 1; } }
private UltraChart CreateNewColumnChart(UltraChart lColumnChart) { try { lColumnChart.Dock = DockStyle.Fill; lColumnChart.ChartType = Infragistics.UltraChart.Shared.Styles.ChartType.ColumnChart; lColumnChart.ColumnChart.SeriesSpacing = 0; lColumnChart.ColumnChart.NullHandling = Infragistics.UltraChart.Shared.Styles.NullHandling.InterpolateSimple; Infragistics.UltraChart.Resources.Appearance.ChartTextAppearance chartTextAppearance = new Infragistics.UltraChart.Resources.Appearance.ChartTextAppearance(); chartTextAppearance.ChartTextFont = new System.Drawing.Font("Verdana", 8F); chartTextAppearance.Column = 0; chartTextAppearance.ItemFormatString = "<DATA_VALUE:00.00>"; chartTextAppearance.Row = -2; chartTextAppearance.VerticalAlign = StringAlignment.Center; chartTextAppearance.HorizontalAlign = StringAlignment.Near; lColumnChart.BarChart.ChartText.Add(chartTextAppearance); lColumnChart.Axis.Y.Labels.Font = new System.Drawing.Font("Verdana", 8F); lColumnChart.Axis.Y.Labels.FontColor = System.Drawing.Color.DimGray; lColumnChart.Axis.Y.Labels.HorizontalAlign = System.Drawing.StringAlignment.Far; lColumnChart.Axis.Y.Labels.ItemFormatString = "<DATA_VALUE:0.##>"; lColumnChart.Axis.Y.Labels.Layout.Behavior = Infragistics.UltraChart.Shared.Styles.AxisLabelLayoutBehaviors.Auto; lColumnChart.Axis.Y.Labels.Orientation = Infragistics.UltraChart.Shared.Styles.TextOrientation.Horizontal; lColumnChart.Axis.Y.Labels.SeriesLabels.Font = new System.Drawing.Font("Verdana", 8F); lColumnChart.Axis.Y.Labels.SeriesLabels.FontColor = System.Drawing.Color.DimGray; lColumnChart.Axis.Y.Labels.SeriesLabels.HorizontalAlign = System.Drawing.StringAlignment.Center; lColumnChart.Axis.Y.Labels.SeriesLabels.Layout.Behavior = Infragistics.UltraChart.Shared.Styles.AxisLabelLayoutBehaviors.Auto; lColumnChart.Axis.Y.Labels.SeriesLabels.Orientation = Infragistics.UltraChart.Shared.Styles.TextOrientation.VerticalLeftFacing; lColumnChart.Axis.Y.Labels.SeriesLabels.VerticalAlign = System.Drawing.StringAlignment.Center; lColumnChart.Axis.Y.Labels.VerticalAlign = System.Drawing.StringAlignment.Center; lColumnChart.Axis.Y.LineThickness = 1; lColumnChart.Axis.Y.MajorGridLines.AlphaLevel = ((byte)(255)); lColumnChart.Axis.Y.MajorGridLines.Color = System.Drawing.Color.Gainsboro; lColumnChart.Axis.Y.MajorGridLines.DrawStyle = Infragistics.UltraChart.Shared.Styles.LineDrawStyle.Solid; lColumnChart.Axis.Y.MajorGridLines.Visible = true; lColumnChart.Axis.Y.MinorGridLines.AlphaLevel = ((byte)(200)); lColumnChart.Axis.Y.MinorGridLines.Color = System.Drawing.Color.LightGray; lColumnChart.Axis.Y.MinorGridLines.DrawStyle = Infragistics.UltraChart.Shared.Styles.LineDrawStyle.Dot; lColumnChart.Axis.Y.MinorGridLines.Visible = true; lColumnChart.Axis.Y.TickmarkInterval = 40; lColumnChart.Axis.Y.TickmarkStyle = Infragistics.UltraChart.Shared.Styles.AxisTickStyle.Smart; lColumnChart.Axis.Y.Visible = true; lColumnChart.Axis.X.Margin.Near.Value = 0; lColumnChart.Axis.Y.Margin.Far.Value = 2; lColumnChart.Axis.X.Labels.ItemFormatString = String.Empty; lColumnChart.Axis.X.Labels.Layout.Behavior = Infragistics.UltraChart.Shared.Styles.AxisLabelLayoutBehaviors.Auto; lColumnChart.Axis.Y.Labels.Layout.Behavior = Infragistics.UltraChart.Shared.Styles.AxisLabelLayoutBehaviors.Auto; // title lColumnChart.TitleBottom.Visible = false; lColumnChart.TitleTop.Font = new System.Drawing.Font("Verdana", 12.75F, ((System.Drawing.FontStyle)((System.Drawing.FontStyle.Regular)))); lColumnChart.TitleTop.HorizontalAlign = System.Drawing.StringAlignment.Center; lColumnChart.TitleTop.Visible = false; // colours lColumnChart.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Center; lColumnChart.Border.Color = System.Drawing.Color.FromArgb(((int)(((byte)(170)))), ((int)(((byte)(173)))), ((int)(((byte)(187))))); lColumnChart.ColorModel.AlphaLevel = ((byte)(200)); lColumnChart.ColorModel.ColorBegin = System.Drawing.Color.Red; lColumnChart.ColorModel.ColorEnd = System.Drawing.Color.Red; lColumnChart.ColorModel.ModelStyle = ColorModels.CustomLinear; //lColumnChart.ColorModel.Scaling = ColorScaling.None; Infragistics.UltraChart.Resources.Appearance.GradientEffect gradientEffect1 = new Infragistics.UltraChart.Resources.Appearance.GradientEffect(); gradientEffect1.Coloring = Infragistics.UltraChart.Shared.Styles.GradientColoringStyle.Lighten; gradientEffect1.Style = Infragistics.UltraChart.Shared.Styles.GradientStyle.BackwardDiagonal; lColumnChart.Effects.Effects.Add(gradientEffect1); lColumnChart.Data.UseRowLabelsColumn = false; // tooltips lColumnChart.Tooltips.Font = new System.Drawing.Font("Verdana", 8F); lColumnChart.Tooltips.FormatString = " <SERIES_LABEL> (<DATA_VALUE>) "; lColumnChart.Tooltips.HighlightFillColor = System.Drawing.Color.LightBlue; lColumnChart.Tooltips.HighlightOutlineColor = System.Drawing.Color.LightBlue; lColumnChart.Axis.X.Labels.SeriesLabels.Font = new System.Drawing.Font("Verdana", 8F); lColumnChart.Axis.X.Labels.SeriesLabels.FontColor = System.Drawing.Color.DimGray; lColumnChart.InvalidDataReceived += new Infragistics.UltraChart.Shared.Events.ChartDataInvalidEventHandler(lChart_InvalidDataReceived); lColumnChart.ChartDrawItem += new Infragistics.UltraChart.Shared.Events.ChartDrawItemEventHandler(lColumnChart_ChartDrawItem); lColumnChart.ChartDataClicked += new Infragistics.UltraChart.Shared.Events.ChartDataClickedEventHandler(this.complianceChart_ChartDataClicked); DataTable reportData = new StatisticsDAO().StatisticsComplianceByType("", ""); lColumnChart.Axis.Y.RangeType = Infragistics.UltraChart.Shared.Styles.AxisRangeType.Custom; double yMax = 0; foreach (DataRow row in reportData.Rows) { double value = Math.Abs(Convert.ToDouble(row.ItemArray[1])); if (value > yMax) { yMax = value; } } lColumnChart.Axis.Y.RangeMax = yMax; lColumnChart.Axis.Y.RangeMin = 0; lColumnChart.DataSource = reportData; } catch (Exception ex) { //logger.Error(ex.Message); } return(lColumnChart); }
private UltraChart CreateNewStackColumnChart(string reportType) { UltraChart lStackColumnChart = new UltraChart(); try { lStackColumnChart.Dock = DockStyle.Fill; lStackColumnChart.ChartType = ChartType.StackColumnChart; lStackColumnChart.Tooltips.Overflow = TooltipOverflow.ChartArea; lStackColumnChart.ColumnChart.SeriesSpacing = 1; Infragistics.UltraChart.Resources.Appearance.ChartTextAppearance chartTextAppearance = new Infragistics.UltraChart.Resources.Appearance.ChartTextAppearance(); Infragistics.UltraChart.Resources.Appearance.StackAppearance stackAppearance = new Infragistics.UltraChart.Resources.Appearance.StackAppearance(); chartTextAppearance.ChartTextFont = new Font("Verdana", 8F); chartTextAppearance.Column = 0; chartTextAppearance.ItemFormatString = "<DATA_VALUE:00.00>"; chartTextAppearance.Row = -2; chartTextAppearance.VerticalAlign = StringAlignment.Center; chartTextAppearance.HorizontalAlign = StringAlignment.Near; lStackColumnChart.BarChart.ChartText.Add(chartTextAppearance); lStackColumnChart.Axis.BackColor = Color.White; lStackColumnChart.Axis.Y.Labels.Font = new Font("Verdana", 8F); lStackColumnChart.Axis.Y.Labels.FontColor = Color.DimGray; lStackColumnChart.Axis.Y.Labels.HorizontalAlign = StringAlignment.Far; lStackColumnChart.Axis.Y.Labels.ItemFormatString = "<DATA_VALUE:0.##>"; lStackColumnChart.Axis.Y.Labels.Layout.Behavior = AxisLabelLayoutBehaviors.Auto; lStackColumnChart.Axis.Y.Labels.Orientation = TextOrientation.Horizontal; lStackColumnChart.Axis.Y.Labels.SeriesLabels.Font = new Font("Verdana", 8F); lStackColumnChart.Axis.Y.Labels.SeriesLabels.FontColor = Color.DimGray; lStackColumnChart.Axis.Y.Labels.SeriesLabels.HorizontalAlign = StringAlignment.Center; lStackColumnChart.Axis.Y.Labels.SeriesLabels.Layout.Behavior = AxisLabelLayoutBehaviors.Auto; lStackColumnChart.Axis.Y.Labels.SeriesLabels.Orientation = TextOrientation.VerticalLeftFacing; lStackColumnChart.Axis.Y.Labels.SeriesLabels.VerticalAlign = StringAlignment.Center; lStackColumnChart.Axis.Y.Labels.VerticalAlign = StringAlignment.Center; lStackColumnChart.Axis.Y.LineThickness = 1; lStackColumnChart.Axis.Y.MajorGridLines.AlphaLevel = 255; lStackColumnChart.Axis.Y.MajorGridLines.Color = Color.Gainsboro; lStackColumnChart.Axis.Y.MajorGridLines.DrawStyle = LineDrawStyle.Solid; lStackColumnChart.Axis.Y.MajorGridLines.Visible = true; lStackColumnChart.Axis.Y.MinorGridLines.AlphaLevel = 200; lStackColumnChart.Axis.Y.MinorGridLines.Color = Color.LightGray; lStackColumnChart.Axis.Y.MinorGridLines.DrawStyle = LineDrawStyle.Dot; lStackColumnChart.Axis.Y.MinorGridLines.Visible = true; lStackColumnChart.Axis.Y.TickmarkInterval = 40; lStackColumnChart.Axis.Y.TickmarkStyle = AxisTickStyle.Smart; lStackColumnChart.Axis.Y.Visible = true; //lStackColumnChart.Axis.X.Margin.Near.Value = 0.74626865671641784; lStackColumnChart.Axis.Y.Margin.Far.Value = 2; lStackColumnChart.Axis.X.Extent = 13; lStackColumnChart.Axis.Y.Extent = 30; lStackColumnChart.Axis.X.Labels.ItemFormatString = String.Empty; lStackColumnChart.Axis.X.Labels.SeriesLabels.Font = new Font("Verdana", 8F); lStackColumnChart.Axis.X.Labels.SeriesLabels.FontColor = Color.DimGray; lStackColumnChart.Axis.X.Labels.Layout.Behavior = AxisLabelLayoutBehaviors.Auto; lStackColumnChart.Axis.Y.Labels.Layout.Behavior = AxisLabelLayoutBehaviors.Auto; // title lStackColumnChart.TitleBottom.Visible = false; lStackColumnChart.TitleTop.Font = new Font("Verdana", 12.75F, FontStyle.Regular); lStackColumnChart.TitleTop.HorizontalAlign = StringAlignment.Center; lStackColumnChart.TitleTop.Visible = false; lStackColumnChart.Tooltips.Font = new Font("Calibri", 8.25F); lStackColumnChart.Tooltips.FormatString = " <SERIES_LABEL>, <ITEM_LABEL>: <DATA_VALUE> "; lStackColumnChart.Tooltips.HighlightFillColor = Color.LightBlue; lStackColumnChart.Tooltips.HighlightOutlineColor = Color.LightBlue; // colours lStackColumnChart.BackgroundImageLayout = ImageLayout.Center; lStackColumnChart.Border.Color = Color.FromArgb(170, 173, 187); //lStackColumnChart.ColorModel.AlphaLevel = ((byte)(255)); lStackColumnChart.ColorModel.AlphaLevel = 200; lStackColumnChart.ColorModel.ColorBegin = Color.Red; lStackColumnChart.ColorModel.ColorEnd = Color.Red; lStackColumnChart.ColorModel.ModelStyle = ColorModels.CustomLinear; //lColumnChart.ColorModel.Scaling = ColorScaling.None; Infragistics.UltraChart.Resources.Appearance.GradientEffect gradientEffect1 = new Infragistics.UltraChart.Resources.Appearance.GradientEffect(); gradientEffect1.Coloring = GradientColoringStyle.Lighten; gradientEffect1.Style = GradientStyle.BackwardDiagonal; lStackColumnChart.Effects.Effects.Add(gradientEffect1); // use different colour depending on report type DataTable reportData; if (reportType == "Under-Licensed Applications") { reportData = new StatisticsDAO().StatisticsUnderLicensedApplicationsForDashboard(); lStackColumnChart.ColorModel.ColorBegin = Color.FromArgb(211, 78, 78); } else { reportData = new StatisticsDAO().StatisticsOverLicensedApplicationsForDashboard(); lStackColumnChart.ColorModel.ColorBegin = Color.FromArgb(151, 189, 100); } lStackColumnChart.ColorModel.ModelStyle = ColorModels.Office2007Style; lStackColumnChart.ColorModel.Scaling = ColorScaling.Decreasing; lStackColumnChart.Data.UseRowLabelsColumn = false; lStackColumnChart.EmptyChartText = ""; lStackColumnChart.InvalidDataReceived += lChart_InvalidDataReceived; lStackColumnChart.ChartDataClicked += licenseChart_ChartDataClicked; lStackColumnChart.DataSource = reportData; } catch (Exception ex) { //logger.Error(ex.Message); } return(lStackColumnChart); }
//public static UltraChart GetChart2(UltraChart chart, object datasource, int width, int height) //{ // if ((chart == null)) // { // chart = new UltraChart(); // } // chart.FillSceneGraph += TemperaturChartFillSceneGraph; // var ultraChart = chart; // ultraChart.AccessKey = "A"; // //.ID = "ChartVergleichJahr" // ultraChart.ChartType = ChartType.LineChart; // ultraChart.ImagePipePageName = Constants.ImagePipePageName; ; // ultraChart.DeploymentScenario = deploymentScenario; // ultraChart.Width = width; // ultraChart.Height = height; // ultraChart.Border.Thickness = 0; // var colorModel = ultraChart.ColorModel; // colorModel.ModelStyle = ColorModels.CustomLinear; // //.AlphaLevel = 150 // colorModel.CustomPalette = Constants.ChartColors; // var gradientEffect = new GradientEffect // { // Coloring = GradientColoringStyle.Darken // }; // ultraChart.Effects.Add(gradientEffect); // //LineAppearance Start // var lineApp1 = new LineAppearance // { // Thickness = 2, // LineStyle = // { // DrawStyle = LineDrawStyle.Dash, // MidPointAnchors = false // }, // }; // lineApp1.IconAppearance.Icon = SymbolIcon.None; // var lineApp2 = new LineAppearance // { // LineStyle = // { // DrawStyle = LineDrawStyle.Solid, // MidPointAnchors = true, // EndStyle = LineCapStyle.DiamondAnchor // }, // Thickness = 2 // }; // //LineAppearance END // var lineChart = ultraChart.LineChart; // lineChart.LineAppearances.Add(lineApp2); // lineChart.LineAppearances.Add(lineApp2); // lineChart.LineAppearances.Add(lineApp1); // lineChart.NullHandling = NullHandling.InterpolateSimple; // lineChart.TreatDateTimeAsString = false; // lineChart.Thickness = 1; // //*** Line width **** // lineChart.MidPointAnchors = true; // var legend = ultraChart.Legend; // legend.Visible = true; // legend.Location = LegendLocation.Top; // legend.SpanPercentage = 6; // legend.BorderThickness = 0; // legend.AlphaLevel = 15; // legend.DataAssociation = ChartTypeData.DefaultData; // var marginsAppearance = legend.Margins; // marginsAppearance.Bottom = 1; // marginsAppearance.Top = 1; // marginsAppearance.Left = 50; // marginsAppearance.Right = 1; // var axis = ultraChart.Axis; // axis.PE.ElementType = PaintElementType.None; // axis.PE.Fill = Color.Cornsilk; // //'*** Implementierungs IRenderLabel für die Labels-Formatierung // { // Hashtable labelHash = new Hashtable(); // labelHash.Add("MY_MONTH_LABEL", new TempMonthLabelRenderer()); // chart.LabelHash = labelHash; // chart.Axis.X.Labels.ItemFormat = AxisItemLabelFormat.Custom; // chart.Axis.X.Labels.ItemFormatString = "<MY_MONTH_LABEL>"; // } // //'*** END Implementierungs IRenderLabel-Interface für die Labels-Formatierung // var axisX = ultraChart.Axis.X; // axisX.Extent = 10; // axisX.LineColor = Color.LightGray; // axisX.LineThickness = 1; // axisX.TickmarkStyle = AxisTickStyle.DataInterval; // axisX.TickmarkInterval = 1; // axisX.TickmarkIntervalType = AxisIntervalType.Months; // //axisX.Labels.ItemFormatString = "<ITEM_LABEL:MMM>"; // axisX.Labels.Orientation = TextOrientation.Horizontal; // axisX.Labels.VerticalAlign = StringAlignment.Far; // axisX.Labels.HorizontalAlign = StringAlignment.Far; // axisX.Labels.Font = new Font("Verdana", 7, FontStyle.Regular, GraphicsUnit.Point); // axisX.Labels.FontColor = Color.DimGray; // //axisX.Labels.SeriesLabels.Font = new Font("Verdana", 7, FontStyle.Regular, GraphicsUnit.Point); // //axisX.Labels.SeriesLabels.Orientation = Infragistics.UltraChart.Shared.Styles.TextOrientation.VerticalLeftFacing; // //axisX.Labels.SeriesLabels.FontColor = Color.DimGray; // //axisX.Labels.SeriesLabels.HorizontalAlign = StringAlignment.Near; // //axisX.Labels.SeriesLabels.VerticalAlign = StringAlignment.Center; // axisX.MajorGridLines.Visible = false; // axisX.MinorGridLines.Visible = false; // var axisY = ultraChart.Axis.Y; // axisY.Extent = 15; // axisY.LineThickness = 1; // axisY.TickmarkInterval = 10; // axisY.TickmarkStyle = AxisTickStyle.Smart; // axisY.Labels.Orientation = TextOrientation.Horizontal; // axisY.Labels.HorizontalAlign = StringAlignment.Far; // axisY.Labels.VerticalAlign = StringAlignment.Center; // axisY.Labels.ItemFormatString = "<DATA_VALUE:00.##>"; // axisY.Labels.Font = new Font("Verdana", 7, FontStyle.Regular, GraphicsUnit.Point); // axisY.Labels.FontColor = Color.DimGray; // //.Labels.SeriesLabels.Font = New Font("Verdana", 7, FontStyle.Regular, GraphicsUnit.Point) // //.Labels.SeriesLabels.Orientation = Infragistics.UltraChart.Shared.Styles.TextOrientation.VerticalLeftFacing // //.Labels.SeriesLabels.FontColor = Color.DimGray // //.Labels.SeriesLabels.HorizontalAlign = StringAlignment.Far // //.Labels.SeriesLabels.VerticalAlign = StringAlignment.Center // axisY.MinorGridLines.Visible = false; // //With .MajorGridLines // // .Visible = True // // .AlphaLevel = 255 // // .Color = Color.LightGray // // .DrawStyle = LineDrawStyle.Solid // // .Thickness = 1 // //End With // var titleLeft = ultraChart.TitleLeft; // titleLeft.Visible = true; // titleLeft.Text = "Mittlere Außentemperatur [°C]"; // titleLeft.Extent = 15; // titleLeft.Font = new Font("Arial", 9.75f, FontStyle.Bold, GraphicsUnit.Point); // titleLeft.HorizontalAlign = StringAlignment.Center; // var titleLeftMarginswith10 = titleLeft.Margins; // titleLeftMarginswith10.Bottom = 1; // titleLeftMarginswith10.Top = 1; // titleLeftMarginswith10.Left = 1; // titleLeftMarginswith10.Right = 1; // var titleTop = ultraChart.TitleTop; // titleTop.Extent = 33; // titleTop.ClipText = false; // titleTop.Font = new Font("Arial", 8, FontStyle.Bold, GraphicsUnit.Point); // var titleTopMargins = titleTop.Margins; // titleTopMargins.Bottom = 10; // titleTopMargins.Top = 0; // titleTopMargins.Left = 15; // titleTopMargins.Right = 0; // var titleBottom = ultraChart.TitleBottom; // titleBottom.Visible = false; // //' ''*** Implementierungs IRenderLabel für die Labels-Formatierung // Hashtable labelHash2 = new Hashtable(); // labelHash2.Add("MY_TOOLTIP_LABEL", new TemperaturLabelRenderer()); // if (chart.LabelHash == null) // { // ultraChart.LabelHash = labelHash2; // } // else // { // ultraChart.LabelHash.Add("MY_TOOLTIP_LABEL", new TemperaturLabelRenderer()); // } // var tooltips = ultraChart.Tooltips; // tooltips.FormatString = "<MY_TOOLTIP_LABEL>"; // tooltips.Overflow = TooltipOverflow.ClientArea; // tooltips.BorderThickness = 0; // tooltips.EnableFadingEffect = true; // ultraChart.Drill.Enabled = true; // ultraChart.Drill.DrillElements = new DrillElement[] { new DrillElement() }; // ultraChart.Drill.DrillElements[0].DrillDown = new TemperaturDrillDown(chart); // var data = ultraChart.Data; // //.UseRowLabelsColumn = True // //.ZeroAligned = True // data.SwapRowsAndColumns = true; // data.EmptyStyle.EnableLineStyle = true; // data.EmptyStyle.EnablePoint = true; // data.EmptyStyle.EnablePE = true; // data.DataSource = datasource; // data.DataBind(); // return chart; //} public static UltraChart GetChart(UltraChart chart, object datasource, int width, int height, params string[] columnLabels) { if ((chart == null)) { chart = new UltraChart(); } if (columnLabels != null) { chart.Data.SetColumnLabels(columnLabels); } chart.FillSceneGraph += TemperaturChartFillSceneGraph; var ultraChart = chart; ultraChart.AccessKey = "A"; //.ID = "ChartVergleichJahr" ultraChart.ChartType = ChartType.LineChart; ultraChart.ImagePipePageName = Constants.ImagePipePageName; ultraChart.DeploymentScenario = deploymentScenario; ultraChart.Width = width; ultraChart.Height = height; ultraChart.Border.Thickness = 0; var colorModel = ultraChart.ColorModel; colorModel.ModelStyle = ColorModels.CustomLinear; //.AlphaLevel = 150 colorModel.CustomPalette = Constants.ChartColors; var gradientEffect = new GradientEffect { Coloring = GradientColoringStyle.Darken }; ultraChart.Effects.Add(gradientEffect); //LineAppearance Start var lineApp1 = new LineAppearance { Thickness = 2, LineStyle = { DrawStyle = LineDrawStyle.Dash, MidPointAnchors = false }, }; lineApp1.IconAppearance.Icon = SymbolIcon.None; lineApp1.IconAppearance.IconSize = SymbolIconSize.Small; var lineApp2 = new LineAppearance { LineStyle = { DrawStyle = LineDrawStyle.Solid, MidPointAnchors = true, EndStyle = LineCapStyle.DiamondAnchor }, Thickness = 2 }; lineApp2.IconAppearance.IconSize = SymbolIconSize.Small; //LineAppearance END var lineChart = ultraChart.LineChart; lineChart.LineAppearances.Add(lineApp2); lineChart.LineAppearances.Add(lineApp2); lineChart.LineAppearances.Add(lineApp1); lineChart.NullHandling = NullHandling.InterpolateSimple; lineChart.TreatDateTimeAsString = false; lineChart.Thickness = 1; //*** Line width **** lineChart.MidPointAnchors = true; var legend = ultraChart.Legend; legend.Visible = true; legend.Location = LegendLocation.Top; legend.SpanPercentage = 6; legend.BorderThickness = 0; legend.AlphaLevel = 15; legend.DataAssociation = ChartTypeData.DefaultData; var marginsAppearance = legend.Margins; marginsAppearance.Bottom = 1; marginsAppearance.Top = 1; marginsAppearance.Left = 50; marginsAppearance.Right = 1; var axis = ultraChart.Axis; axis.PE.ElementType = PaintElementType.None; axis.PE.Fill = Color.Cornsilk; //'*** Implementierungs IRenderLabel für die Labels-Formatierung { Hashtable labelHash = new Hashtable(); labelHash.Add("MY_MONTH_LABEL", new TempMonthLabelRenderer()); chart.LabelHash = labelHash; chart.Axis.X.Labels.ItemFormat = AxisItemLabelFormat.Custom; chart.Axis.X.Labels.ItemFormatString = "<MY_MONTH_LABEL>"; } //'*** END Implementierungs IRenderLabel-Interface für die Labels-Formatierung var axisX = ultraChart.Axis.X; axisX.Extent = 15; axisX.LineColor = Color.LightGray; axisX.LineThickness = 1; axisX.TickmarkStyle = AxisTickStyle.DataInterval; axisX.TickmarkInterval = 1; axisX.TickmarkIntervalType = AxisIntervalType.Months; //axisX.Labels.ItemFormatString = "<ITEM_LABEL:MMM>"; axisX.Labels.Orientation = TextOrientation.Horizontal; axisX.Labels.VerticalAlign = StringAlignment.Far; axisX.Labels.HorizontalAlign = StringAlignment.Far; axisX.Labels.Font = new Font("Verdana", 9, FontStyle.Regular, GraphicsUnit.Point); axisX.Labels.FontColor = Color.Black; axisX.Labels.Layout.Padding = 15; //axisX.Labels.SeriesLabels.Font = new Font("Verdana", 7, FontStyle.Regular, GraphicsUnit.Point); //axisX.Labels.SeriesLabels.Orientation = Infragistics.UltraChart.Shared.Styles.TextOrientation.VerticalLeftFacing; //axisX.Labels.SeriesLabels.FontColor = Color.DimGray; //axisX.Labels.SeriesLabels.HorizontalAlign = StringAlignment.Near; //axisX.Labels.SeriesLabels.VerticalAlign = StringAlignment.Center; axisX.MajorGridLines.Visible = false; axisX.MinorGridLines.Visible = false; var axisY = ultraChart.Axis.Y; axisY.Extent = 30; axisY.LineThickness = 1; axisY.TickmarkInterval = 10; axisY.TickmarkStyle = AxisTickStyle.Smart; axisY.Labels.Orientation = TextOrientation.Horizontal; axisY.Labels.HorizontalAlign = StringAlignment.Far; //axisY.Labels.VerticalAlign = StringAlignment.Center; axisY.Labels.ItemFormatString = "<DATA_VALUE:00.######>"; axisY.Labels.Font = new Font("Verdana", 9, FontStyle.Regular, GraphicsUnit.Point); axisY.Labels.FontColor = Color.Black; //.Labels.SeriesLabels.Font = New Font("Verdana", 7, FontStyle.Regular, GraphicsUnit.Point) //.Labels.SeriesLabels.Orientation = Infragistics.UltraChart.Shared.Styles.TextOrientation.VerticalLeftFacing //.Labels.SeriesLabels.FontColor = Color.DimGray //.Labels.SeriesLabels.HorizontalAlign = StringAlignment.Far //.Labels.SeriesLabels.VerticalAlign = StringAlignment.Center axisY.MinorGridLines.Visible = false; //With .MajorGridLines // .Visible = True // .AlphaLevel = 255 // .Color = Color.LightGray // .DrawStyle = LineDrawStyle.Solid // .Thickness = 1 //End With var titleLeft = ultraChart.TitleLeft; titleLeft.Visible = true; titleLeft.Text = "Mittlere Außentemperatur [°C]"; titleLeft.Extent = 15; titleLeft.Font = new Font("Arial", 9.75f, FontStyle.Bold, GraphicsUnit.Point); titleLeft.HorizontalAlign = StringAlignment.Center; var titleLeftMarginswith10 = titleLeft.Margins; titleLeftMarginswith10.Bottom = 1; titleLeftMarginswith10.Top = 1; titleLeftMarginswith10.Left = 1; titleLeftMarginswith10.Right = 1; var titleTop = ultraChart.TitleTop; titleTop.Extent = 33; titleTop.ClipText = false; titleTop.Font = new Font("Arial", 8, FontStyle.Bold, GraphicsUnit.Point); var titleTopMargins = titleTop.Margins; titleTopMargins.Bottom = 10; titleTopMargins.Top = 0; titleTopMargins.Left = 15; titleTopMargins.Right = 0; var titleBottom = ultraChart.TitleBottom; titleBottom.Visible = false; //' ''*** Implementierungs IRenderLabel für die Labels-Formatierung Hashtable labelHash2= new Hashtable(); labelHash2.Add("MY_TOOLTIP_LABEL", new TemperaturLabelRenderer()); if (chart.LabelHash == null) { ultraChart.LabelHash = labelHash2; } else { ultraChart.LabelHash.Add("MY_TOOLTIP_LABEL", new TemperaturLabelRenderer()); } var tooltips = ultraChart.Tooltips; tooltips.FormatString = "<MY_TOOLTIP_LABEL>"; tooltips.Overflow = TooltipOverflow.ClientArea; tooltips.BorderThickness = 0; tooltips.EnableFadingEffect = true; ultraChart.Drill.Enabled = true; ultraChart.Drill.DrillElements = new DrillElement[] { new DrillElement() }; ultraChart.Drill.DrillElements[0].DrillDown = new TemperaturDrillDown(chart); var data = ultraChart.Data; //.UseRowLabelsColumn = True //.ZeroAligned = True data.SwapRowsAndColumns = true; data.EmptyStyle.EnableLineStyle = true; data.EmptyStyle.EnablePoint = true; data.EmptyStyle.EnablePE = true; data.DataSource = datasource; data.DataBind(); return chart; }
private void InitializeComponent() { Infragistics.Win.Appearance appearance = new Infragistics.Win.Appearance(); PaintElement element = new PaintElement(); BarChartAppearance appearance2 = new BarChartAppearance(); ChartTextAppearance item = new ChartTextAppearance(); GradientEffect effect = new GradientEffect(); this.tableLayoutPanel1 = new TableLayoutPanel(); this.ultraButton1 = new UltraButton(); this.ultraChart1 = new UltraChart(); this.panel1 = new Panel(); this.pictureBox2 = new PictureBox(); this.pictureBox1 = new PictureBox(); this.backgroundWorker1 = new BackgroundWorker(); this.tableLayoutPanel1.SuspendLayout(); this.ultraChart1.BeginInit(); this.panel1.SuspendLayout(); ((ISupportInitialize)this.pictureBox2).BeginInit(); ((ISupportInitialize)this.pictureBox1).BeginInit(); base.SuspendLayout(); this.tableLayoutPanel1.BackColor = Color.Silver; this.tableLayoutPanel1.ColumnCount = 4; this.tableLayoutPanel1.ColumnStyles.Add(new ColumnStyle(SizeType.Absolute, 5f)); this.tableLayoutPanel1.ColumnStyles.Add(new ColumnStyle(SizeType.Absolute, 320f)); this.tableLayoutPanel1.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 100f)); this.tableLayoutPanel1.ColumnStyles.Add(new ColumnStyle(SizeType.Absolute, 6f)); this.tableLayoutPanel1.Controls.Add(this.ultraButton1, 2, 1); this.tableLayoutPanel1.Controls.Add(this.ultraChart1, 2, 2); this.tableLayoutPanel1.Controls.Add(this.panel1, 1, 1); this.tableLayoutPanel1.Dock = DockStyle.Fill; this.tableLayoutPanel1.Location = new Point(0, 0); this.tableLayoutPanel1.Margin = new Padding(0); this.tableLayoutPanel1.Name = "tableLayoutPanel1"; this.tableLayoutPanel1.RowCount = 4; this.tableLayoutPanel1.RowStyles.Add(new RowStyle(SizeType.Absolute, 5f)); this.tableLayoutPanel1.RowStyles.Add(new RowStyle(SizeType.Absolute, 50f)); this.tableLayoutPanel1.RowStyles.Add(new RowStyle(SizeType.Percent, 100f)); this.tableLayoutPanel1.RowStyles.Add(new RowStyle(SizeType.Absolute, 5f)); this.tableLayoutPanel1.Size = new Size(0x45d, 270); this.tableLayoutPanel1.TabIndex = 0; appearance.BackColor = Color.FromArgb(0xc0, 0xc0, 0xff); appearance.BackColor2 = Color.White; appearance.BackGradientStyle = Infragistics.Win.GradientStyle.Vertical; this.ultraButton1.Appearance = appearance; this.ultraButton1.Dock = DockStyle.Fill; this.ultraButton1.Font = new Font("Arial", 18f, FontStyle.Bold, GraphicsUnit.Point, 0); this.ultraButton1.Location = new Point(0x148, 8); this.ultraButton1.Name = "ultraButton1"; this.ultraButton1.Size = new Size(780, 0x2c); this.ultraButton1.TabIndex = 1; this.ultraButton1.Text = "NASLOV"; this.ultraButton1.UseOsThemes = DefaultableBoolean.False; this.ultraChart1.ChartType = ChartType.BarChart; this.ultraChart1.Axis.BackColor = Color.FromArgb(0xff, 0xf8, 220); element.ElementType = PaintElementType.None; element.Fill = Color.FromArgb(0xff, 0xf8, 220); this.ultraChart1.Axis.PE = element; this.ultraChart1.Axis.X.Extent = 20; this.ultraChart1.Axis.X.Labels.Font = new Font("Verdana", 12f, FontStyle.Bold, GraphicsUnit.Point, 0); this.ultraChart1.Axis.X.Labels.FontColor = Color.Red; this.ultraChart1.Axis.X.Labels.HorizontalAlign = StringAlignment.Far; this.ultraChart1.Axis.X.Labels.ItemFormatString = "<DATA_VALUE:0>"; this.ultraChart1.Axis.X.Labels.Layout.Behavior = AxisLabelLayoutBehaviors.Auto; this.ultraChart1.Axis.X.Labels.Orientation = TextOrientation.Horizontal; this.ultraChart1.Axis.X.Labels.SeriesLabels.Font = new Font("Verdana", 20.25f, FontStyle.Regular, GraphicsUnit.Point, 0); this.ultraChart1.Axis.X.Labels.SeriesLabels.FontColor = Color.DimGray; this.ultraChart1.Axis.X.Labels.SeriesLabels.FormatString = ""; this.ultraChart1.Axis.X.Labels.SeriesLabels.HorizontalAlign = StringAlignment.Far; this.ultraChart1.Axis.X.Labels.SeriesLabels.Layout.Behavior = AxisLabelLayoutBehaviors.Auto; this.ultraChart1.Axis.X.Labels.SeriesLabels.Orientation = TextOrientation.VerticalLeftFacing; this.ultraChart1.Axis.X.Labels.SeriesLabels.VerticalAlign = StringAlignment.Center; this.ultraChart1.Axis.X.Labels.VerticalAlign = StringAlignment.Center; this.ultraChart1.Axis.X.LineThickness = 1; this.ultraChart1.Axis.X.MajorGridLines.AlphaLevel = 0xff; this.ultraChart1.Axis.X.MajorGridLines.Color = Color.Gainsboro; this.ultraChart1.Axis.X.MajorGridLines.DrawStyle = LineDrawStyle.Dot; this.ultraChart1.Axis.X.MajorGridLines.Visible = true; this.ultraChart1.Axis.X.MinorGridLines.AlphaLevel = 0xff; this.ultraChart1.Axis.X.MinorGridLines.Color = Color.LightGray; this.ultraChart1.Axis.X.MinorGridLines.DrawStyle = LineDrawStyle.Dot; this.ultraChart1.Axis.X.MinorGridLines.Visible = false; this.ultraChart1.Axis.X.RangeMax = 100.0; this.ultraChart1.Axis.X.RangeType = AxisRangeType.Custom; this.ultraChart1.Axis.X.TickmarkInterval = 10.0; this.ultraChart1.Axis.X.TickmarkStyle = AxisTickStyle.Smart; this.ultraChart1.Axis.X.Visible = true; this.ultraChart1.Axis.X2.Labels.Font = new Font("Verdana", 7f); this.ultraChart1.Axis.X2.Labels.FontColor = Color.Gray; this.ultraChart1.Axis.X2.Labels.HorizontalAlign = StringAlignment.Far; this.ultraChart1.Axis.X2.Labels.ItemFormatString = "<DATA_VALUE:00.##>"; this.ultraChart1.Axis.X2.Labels.Layout.Behavior = AxisLabelLayoutBehaviors.Auto; this.ultraChart1.Axis.X2.Labels.Orientation = TextOrientation.VerticalLeftFacing; this.ultraChart1.Axis.X2.Labels.SeriesLabels.Font = new Font("Verdana", 7f); this.ultraChart1.Axis.X2.Labels.SeriesLabels.FontColor = Color.Gray; this.ultraChart1.Axis.X2.Labels.SeriesLabels.FormatString = ""; this.ultraChart1.Axis.X2.Labels.SeriesLabels.HorizontalAlign = StringAlignment.Far; this.ultraChart1.Axis.X2.Labels.SeriesLabels.Layout.Behavior = AxisLabelLayoutBehaviors.Auto; this.ultraChart1.Axis.X2.Labels.SeriesLabels.Orientation = TextOrientation.VerticalLeftFacing; this.ultraChart1.Axis.X2.Labels.SeriesLabels.VerticalAlign = StringAlignment.Center; this.ultraChart1.Axis.X2.Labels.VerticalAlign = StringAlignment.Center; this.ultraChart1.Axis.X2.Labels.Visible = false; this.ultraChart1.Axis.X2.LineThickness = 1; this.ultraChart1.Axis.X2.MajorGridLines.AlphaLevel = 0xff; this.ultraChart1.Axis.X2.MajorGridLines.Color = Color.Gainsboro; this.ultraChart1.Axis.X2.MajorGridLines.DrawStyle = LineDrawStyle.Dot; this.ultraChart1.Axis.X2.MajorGridLines.Visible = true; this.ultraChart1.Axis.X2.MinorGridLines.AlphaLevel = 0xff; this.ultraChart1.Axis.X2.MinorGridLines.Color = Color.LightGray; this.ultraChart1.Axis.X2.MinorGridLines.DrawStyle = LineDrawStyle.Dot; this.ultraChart1.Axis.X2.MinorGridLines.Visible = false; this.ultraChart1.Axis.X2.TickmarkInterval = 40.0; this.ultraChart1.Axis.X2.TickmarkStyle = AxisTickStyle.Smart; this.ultraChart1.Axis.X2.Visible = false; this.ultraChart1.Axis.Y.Extent = 400; this.ultraChart1.Axis.Y.Labels.Font = new Font("Verdana", 24f, FontStyle.Bold, GraphicsUnit.Point, 0); this.ultraChart1.Axis.Y.Labels.HorizontalAlign = StringAlignment.Far; this.ultraChart1.Axis.Y.Labels.ItemFormatString = "<ITEM_LABEL>"; this.ultraChart1.Axis.Y.Labels.Layout.Behavior = AxisLabelLayoutBehaviors.Auto; this.ultraChart1.Axis.Y.Labels.Orientation = TextOrientation.Horizontal; this.ultraChart1.Axis.Y.Labels.SeriesLabels.HorizontalAlign = StringAlignment.Center; this.ultraChart1.Axis.Y.Labels.SeriesLabels.Layout.Behavior = AxisLabelLayoutBehaviors.Auto; this.ultraChart1.Axis.Y.Labels.SeriesLabels.Orientation = TextOrientation.VerticalLeftFacing; this.ultraChart1.Axis.Y.Labels.SeriesLabels.VerticalAlign = StringAlignment.Center; this.ultraChart1.Axis.Y.Labels.SeriesLabels.Visible = false; this.ultraChart1.Axis.Y.Labels.VerticalAlign = StringAlignment.Center; this.ultraChart1.Axis.Y.LineThickness = 1; this.ultraChart1.Axis.Y.MajorGridLines.AlphaLevel = 0xff; this.ultraChart1.Axis.Y.MajorGridLines.Color = Color.Gainsboro; this.ultraChart1.Axis.Y.MajorGridLines.DrawStyle = LineDrawStyle.Dot; this.ultraChart1.Axis.Y.MajorGridLines.Visible = true; this.ultraChart1.Axis.Y.MinorGridLines.AlphaLevel = 0xff; this.ultraChart1.Axis.Y.MinorGridLines.Color = Color.LightGray; this.ultraChart1.Axis.Y.MinorGridLines.DrawStyle = LineDrawStyle.Dot; this.ultraChart1.Axis.Y.MinorGridLines.Visible = false; this.ultraChart1.Axis.Y.TickmarkStyle = AxisTickStyle.Smart; this.ultraChart1.Axis.Y.Visible = true; this.ultraChart1.Axis.Y2.Labels.Font = new Font("Verdana", 7f); this.ultraChart1.Axis.Y2.Labels.FontColor = Color.Gray; this.ultraChart1.Axis.Y2.Labels.HorizontalAlign = StringAlignment.Near; this.ultraChart1.Axis.Y2.Labels.ItemFormatString = "<ITEM_LABEL>"; this.ultraChart1.Axis.Y2.Labels.Layout.Behavior = AxisLabelLayoutBehaviors.Auto; this.ultraChart1.Axis.Y2.Labels.Orientation = TextOrientation.Horizontal; this.ultraChart1.Axis.Y2.Labels.SeriesLabels.Font = new Font("Verdana", 7f); this.ultraChart1.Axis.Y2.Labels.SeriesLabels.FontColor = Color.Gray; this.ultraChart1.Axis.Y2.Labels.SeriesLabels.HorizontalAlign = StringAlignment.Center; this.ultraChart1.Axis.Y2.Labels.SeriesLabels.Layout.Behavior = AxisLabelLayoutBehaviors.Auto; this.ultraChart1.Axis.Y2.Labels.SeriesLabels.Orientation = TextOrientation.VerticalLeftFacing; this.ultraChart1.Axis.Y2.Labels.SeriesLabels.VerticalAlign = StringAlignment.Center; this.ultraChart1.Axis.Y2.Labels.VerticalAlign = StringAlignment.Center; this.ultraChart1.Axis.Y2.Labels.Visible = false; this.ultraChart1.Axis.Y2.LineThickness = 1; this.ultraChart1.Axis.Y2.MajorGridLines.AlphaLevel = 0xff; this.ultraChart1.Axis.Y2.MajorGridLines.Color = Color.Gainsboro; this.ultraChart1.Axis.Y2.MajorGridLines.DrawStyle = LineDrawStyle.Dot; this.ultraChart1.Axis.Y2.MajorGridLines.Visible = true; this.ultraChart1.Axis.Y2.MinorGridLines.AlphaLevel = 0xff; this.ultraChart1.Axis.Y2.MinorGridLines.Color = Color.LightGray; this.ultraChart1.Axis.Y2.MinorGridLines.DrawStyle = LineDrawStyle.Dot; this.ultraChart1.Axis.Y2.MinorGridLines.Visible = false; this.ultraChart1.Axis.Y2.TickmarkStyle = AxisTickStyle.Smart; this.ultraChart1.Axis.Y2.Visible = false; this.ultraChart1.Axis.Z.Labels.Font = new Font("Verdana", 7f); this.ultraChart1.Axis.Z.Labels.FontColor = Color.DimGray; this.ultraChart1.Axis.Z.Labels.HorizontalAlign = StringAlignment.Near; this.ultraChart1.Axis.Z.Labels.ItemFormatString = ""; this.ultraChart1.Axis.Z.Labels.Layout.Behavior = AxisLabelLayoutBehaviors.Auto; this.ultraChart1.Axis.Z.Labels.Orientation = TextOrientation.Horizontal; this.ultraChart1.Axis.Z.Labels.SeriesLabels.Font = new Font("Verdana", 7f); this.ultraChart1.Axis.Z.Labels.SeriesLabels.FontColor = Color.DimGray; this.ultraChart1.Axis.Z.Labels.SeriesLabels.HorizontalAlign = StringAlignment.Near; this.ultraChart1.Axis.Z.Labels.SeriesLabels.Layout.Behavior = AxisLabelLayoutBehaviors.Auto; this.ultraChart1.Axis.Z.Labels.SeriesLabels.Orientation = TextOrientation.Horizontal; this.ultraChart1.Axis.Z.Labels.SeriesLabels.VerticalAlign = StringAlignment.Center; this.ultraChart1.Axis.Z.Labels.VerticalAlign = StringAlignment.Center; this.ultraChart1.Axis.Z.Labels.Visible = false; this.ultraChart1.Axis.Z.LineThickness = 1; this.ultraChart1.Axis.Z.MajorGridLines.AlphaLevel = 0xff; this.ultraChart1.Axis.Z.MajorGridLines.Color = Color.Gainsboro; this.ultraChart1.Axis.Z.MajorGridLines.DrawStyle = LineDrawStyle.Dot; this.ultraChart1.Axis.Z.MajorGridLines.Visible = true; this.ultraChart1.Axis.Z.MinorGridLines.AlphaLevel = 0xff; this.ultraChart1.Axis.Z.MinorGridLines.Color = Color.LightGray; this.ultraChart1.Axis.Z.MinorGridLines.DrawStyle = LineDrawStyle.Dot; this.ultraChart1.Axis.Z.MinorGridLines.Visible = false; this.ultraChart1.Axis.Z.TickmarkStyle = AxisTickStyle.Smart; this.ultraChart1.Axis.Z.Visible = false; this.ultraChart1.Axis.Z2.Labels.Font = new Font("Verdana", 7f); this.ultraChart1.Axis.Z2.Labels.FontColor = Color.Gray; this.ultraChart1.Axis.Z2.Labels.HorizontalAlign = StringAlignment.Near; this.ultraChart1.Axis.Z2.Labels.ItemFormatString = ""; this.ultraChart1.Axis.Z2.Labels.Layout.Behavior = AxisLabelLayoutBehaviors.Auto; this.ultraChart1.Axis.Z2.Labels.Orientation = TextOrientation.Horizontal; this.ultraChart1.Axis.Z2.Labels.SeriesLabels.Font = new Font("Verdana", 7f); this.ultraChart1.Axis.Z2.Labels.SeriesLabels.FontColor = Color.Gray; this.ultraChart1.Axis.Z2.Labels.SeriesLabels.HorizontalAlign = StringAlignment.Near; this.ultraChart1.Axis.Z2.Labels.SeriesLabels.Layout.Behavior = AxisLabelLayoutBehaviors.Auto; this.ultraChart1.Axis.Z2.Labels.SeriesLabels.Orientation = TextOrientation.VerticalLeftFacing; this.ultraChart1.Axis.Z2.Labels.SeriesLabels.VerticalAlign = StringAlignment.Center; this.ultraChart1.Axis.Z2.Labels.VerticalAlign = StringAlignment.Center; this.ultraChart1.Axis.Z2.Labels.Visible = false; this.ultraChart1.Axis.Z2.LineThickness = 1; this.ultraChart1.Axis.Z2.MajorGridLines.AlphaLevel = 0xff; this.ultraChart1.Axis.Z2.MajorGridLines.Color = Color.Gainsboro; this.ultraChart1.Axis.Z2.MajorGridLines.DrawStyle = LineDrawStyle.Dot; this.ultraChart1.Axis.Z2.MajorGridLines.Visible = true; this.ultraChart1.Axis.Z2.MinorGridLines.AlphaLevel = 0xff; this.ultraChart1.Axis.Z2.MinorGridLines.Color = Color.LightGray; this.ultraChart1.Axis.Z2.MinorGridLines.DrawStyle = LineDrawStyle.Dot; this.ultraChart1.Axis.Z2.MinorGridLines.Visible = false; this.ultraChart1.Axis.Z2.TickmarkStyle = AxisTickStyle.Smart; this.ultraChart1.Axis.Z2.Visible = false; this.ultraChart1.BackgroundImageLayout = ImageLayout.Center; item.ChartTextFont = new Font("Arial", 20.25f, FontStyle.Regular, GraphicsUnit.Point, 0); item.Column = -2; item.HorizontalAlign = StringAlignment.Far; item.ItemFormatString = "<DATA_VALUE:0>"; item.Row = -2; item.Visible = true; appearance2.ChartText.Add(item); this.ultraChart1.BarChart = appearance2; this.ultraChart1.ColorModel.AlphaLevel = 150; this.ultraChart1.ColorModel.ColorBegin = Color.Pink; this.ultraChart1.ColorModel.ColorEnd = Color.DarkRed; this.ultraChart1.ColorModel.ModelStyle = ColorModels.CustomLinear; this.ultraChart1.Dock = DockStyle.Fill; this.ultraChart1.Effects.Effects.Add(effect); this.ultraChart1.EmptyChartText = "Učitavanje podataka..."; this.ultraChart1.Legend.Location = LegendLocation.Left; this.ultraChart1.Location = new Point(0x148, 0x3a); this.ultraChart1.Name = "ultraChart1"; this.ultraChart1.Size = new Size(780, 0xcc); this.ultraChart1.TabIndex = 2; this.ultraChart1.Tooltips.HighlightFillColor = Color.DimGray; this.ultraChart1.Tooltips.HighlightOutlineColor = Color.DarkGray; this.panel1.Controls.Add(this.pictureBox2); this.panel1.Controls.Add(this.pictureBox1); this.panel1.Dock = DockStyle.Fill; this.panel1.Location = new Point(5, 5); this.panel1.Margin = new Padding(0); this.panel1.Name = "panel1"; this.tableLayoutPanel1.SetRowSpan(this.panel1, 2); this.panel1.Size = new Size(320, 260); this.panel1.TabIndex = 3; this.pictureBox2.BackColor = Color.Sienna; this.pictureBox2.BackgroundImageLayout = ImageLayout.Stretch; this.pictureBox2.BorderStyle = BorderStyle.FixedSingle; this.pictureBox2.Location = new Point(0, 0); this.pictureBox2.Name = "pictureBox2"; this.pictureBox2.Size = new Size(100, 50); this.pictureBox2.TabIndex = 1; this.pictureBox2.TabStop = false; this.pictureBox1.BackColor = Color.Maroon; this.pictureBox1.BackgroundImageLayout = ImageLayout.Stretch; this.pictureBox1.BorderStyle = BorderStyle.Fixed3D; this.pictureBox1.Dock = DockStyle.Fill; this.pictureBox1.Location = new Point(0, 0); this.pictureBox1.Name = "pictureBox1"; this.pictureBox1.Size = new Size(320, 260); this.pictureBox1.TabIndex = 0; this.pictureBox1.TabStop = false; this.backgroundWorker1.DoWork += new DoWorkEventHandler(this.backgroundWorker1_DoWork); this.backgroundWorker1.RunWorkerCompleted += new RunWorkerCompletedEventHandler(this.backgroundWorker1_RunWorkerCompleted); base.AutoScaleDimensions = new SizeF(6f, 13f); base.AutoScaleMode = AutoScaleMode.Font; base.Controls.Add(this.tableLayoutPanel1); base.Margin = new Padding(10, 15, 3, 0); base.Name = "UVSvest"; base.Size = new Size(0x45d, 270); this.tableLayoutPanel1.ResumeLayout(false); this.ultraChart1.EndInit(); this.panel1.ResumeLayout(false); ((ISupportInitialize)this.pictureBox2).EndInit(); ((ISupportInitialize)this.pictureBox1).EndInit(); base.ResumeLayout(false); }
public TemperaturDrillDown(UltraChart chart) { this._chart = chart; }
private void InitializeComponent() { this.components = (IContainer) new Container(); ComponentResourceManager componentResourceManager = new ComponentResourceManager(typeof(FrmGraph)); this.graph = new UltraChart(); this.btnPrint = new UltraButton(); this.ultraPrintPreviewDialog1 = new UltraPrintPreviewDialog(this.components); this.graph.BeginInit(); this.SuspendLayout(); this.graph.Axis.BackColor = Color.FromArgb((int)byte.MaxValue, 248, 220); this.graph.Axis.X.Extent = 85; this.graph.Axis.X.Labels.Flip = true; this.graph.Axis.X.Labels.HorizontalAlign = StringAlignment.Near; this.graph.Axis.X.Labels.ItemFormatString = "<ITEM_LABEL>"; this.graph.Axis.X.Labels.Orientation = TextOrientation.Custom; this.graph.Axis.X.Labels.OrientationAngle = 230; this.graph.Axis.X.Labels.SeriesLabels.FormatString = ""; this.graph.Axis.X.Labels.SeriesLabels.HorizontalAlign = StringAlignment.Near; this.graph.Axis.X.Labels.SeriesLabels.Orientation = TextOrientation.Horizontal; this.graph.Axis.X.Labels.SeriesLabels.VerticalAlign = StringAlignment.Center; this.graph.Axis.X.Labels.VerticalAlign = StringAlignment.Center; this.graph.Axis.X.MajorGridLines.AlphaLevel = byte.MaxValue; this.graph.Axis.X.MajorGridLines.Color = Color.Gainsboro; this.graph.Axis.X.MajorGridLines.DrawStyle = LineDrawStyle.Dot; this.graph.Axis.X.MajorGridLines.Visible = true; this.graph.Axis.X.MinorGridLines.AlphaLevel = byte.MaxValue; this.graph.Axis.X.MinorGridLines.Color = Color.LightGray; this.graph.Axis.X.MinorGridLines.DrawStyle = LineDrawStyle.Dot; this.graph.Axis.X.MinorGridLines.Visible = false; this.graph.Axis.X.ScrollScale.Height = 5; this.graph.Axis.X.ScrollScale.Visible = true; this.graph.Axis.X.ScrollScale.Width = 10; this.graph.Axis.X.TickmarkInterval = 1.0; this.graph.Axis.X.TickmarkIntervalType = AxisIntervalType.Days; this.graph.Axis.X.TickmarkStyle = AxisTickStyle.Smart; this.graph.Axis.X.Visible = true; this.graph.Axis.X2.Labels.HorizontalAlign = StringAlignment.Far; this.graph.Axis.X2.Labels.ItemFormatString = "<ITEM_LABEL>"; this.graph.Axis.X2.Labels.Orientation = TextOrientation.VerticalLeftFacing; this.graph.Axis.X2.Labels.SeriesLabels.FormatString = ""; this.graph.Axis.X2.Labels.SeriesLabels.HorizontalAlign = StringAlignment.Far; this.graph.Axis.X2.Labels.SeriesLabels.Orientation = TextOrientation.VerticalLeftFacing; this.graph.Axis.X2.Labels.SeriesLabels.VerticalAlign = StringAlignment.Center; this.graph.Axis.X2.Labels.VerticalAlign = StringAlignment.Center; this.graph.Axis.X2.MajorGridLines.AlphaLevel = byte.MaxValue; this.graph.Axis.X2.MajorGridLines.Color = Color.Gainsboro; this.graph.Axis.X2.MajorGridLines.DrawStyle = LineDrawStyle.Dot; this.graph.Axis.X2.MajorGridLines.Visible = true; this.graph.Axis.X2.MinorGridLines.AlphaLevel = byte.MaxValue; this.graph.Axis.X2.MinorGridLines.Color = Color.LightGray; this.graph.Axis.X2.MinorGridLines.DrawStyle = LineDrawStyle.Dot; this.graph.Axis.X2.MinorGridLines.Visible = false; this.graph.Axis.X2.Visible = false; this.graph.Axis.Y.Extent = 60; this.graph.Axis.Y.Labels.HorizontalAlign = StringAlignment.Far; this.graph.Axis.Y.Labels.ItemFormatString = "<DATA_VALUE:00.##>"; this.graph.Axis.Y.Labels.Orientation = TextOrientation.Horizontal; this.graph.Axis.Y.Labels.SeriesLabels.FormatString = ""; this.graph.Axis.Y.Labels.SeriesLabels.HorizontalAlign = StringAlignment.Far; this.graph.Axis.Y.Labels.SeriesLabels.Orientation = TextOrientation.Horizontal; this.graph.Axis.Y.Labels.SeriesLabels.VerticalAlign = StringAlignment.Center; this.graph.Axis.Y.Labels.VerticalAlign = StringAlignment.Center; this.graph.Axis.Y.MajorGridLines.AlphaLevel = byte.MaxValue; this.graph.Axis.Y.MajorGridLines.Color = Color.Gainsboro; this.graph.Axis.Y.MajorGridLines.DrawStyle = LineDrawStyle.Dot; this.graph.Axis.Y.MajorGridLines.Visible = true; this.graph.Axis.Y.MinorGridLines.AlphaLevel = byte.MaxValue; this.graph.Axis.Y.MinorGridLines.Color = Color.LightGray; this.graph.Axis.Y.MinorGridLines.DrawStyle = LineDrawStyle.Dot; this.graph.Axis.Y.MinorGridLines.Visible = false; this.graph.Axis.Y.RangeMax = 200.0; this.graph.Axis.Y.ScrollScale.Height = 5; this.graph.Axis.Y.ScrollScale.Visible = true; this.graph.Axis.Y.ScrollScale.Width = 10; this.graph.Axis.Y.TickmarkInterval = 40.0; this.graph.Axis.Y.TickmarkStyle = AxisTickStyle.Smart; this.graph.Axis.Y.Visible = true; this.graph.Axis.Y2.Labels.HorizontalAlign = StringAlignment.Near; this.graph.Axis.Y2.Labels.ItemFormatString = "<DATA_VALUE:00.##>"; this.graph.Axis.Y2.Labels.Orientation = TextOrientation.Horizontal; this.graph.Axis.Y2.Labels.SeriesLabels.FormatString = ""; this.graph.Axis.Y2.Labels.SeriesLabels.HorizontalAlign = StringAlignment.Near; this.graph.Axis.Y2.Labels.SeriesLabels.Orientation = TextOrientation.Horizontal; this.graph.Axis.Y2.Labels.SeriesLabels.VerticalAlign = StringAlignment.Center; this.graph.Axis.Y2.Labels.VerticalAlign = StringAlignment.Center; this.graph.Axis.Y2.MajorGridLines.AlphaLevel = byte.MaxValue; this.graph.Axis.Y2.MajorGridLines.Color = Color.Gainsboro; this.graph.Axis.Y2.MajorGridLines.DrawStyle = LineDrawStyle.Dot; this.graph.Axis.Y2.MajorGridLines.Visible = true; this.graph.Axis.Y2.MinorGridLines.AlphaLevel = byte.MaxValue; this.graph.Axis.Y2.MinorGridLines.Color = Color.LightGray; this.graph.Axis.Y2.MinorGridLines.DrawStyle = LineDrawStyle.Dot; this.graph.Axis.Y2.MinorGridLines.Visible = false; this.graph.Axis.Y2.Visible = false; this.graph.Axis.Z.Labels.HorizontalAlign = StringAlignment.Near; this.graph.Axis.Z.Labels.ItemFormatString = ""; this.graph.Axis.Z.Labels.Orientation = TextOrientation.Horizontal; this.graph.Axis.Z.Labels.SeriesLabels.HorizontalAlign = StringAlignment.Near; this.graph.Axis.Z.Labels.SeriesLabels.Orientation = TextOrientation.Horizontal; this.graph.Axis.Z.Labels.SeriesLabels.VerticalAlign = StringAlignment.Center; this.graph.Axis.Z.Labels.VerticalAlign = StringAlignment.Center; this.graph.Axis.Z.MajorGridLines.AlphaLevel = byte.MaxValue; this.graph.Axis.Z.MajorGridLines.Color = Color.Gainsboro; this.graph.Axis.Z.MajorGridLines.DrawStyle = LineDrawStyle.Dot; this.graph.Axis.Z.MajorGridLines.Visible = true; this.graph.Axis.Z.MinorGridLines.AlphaLevel = byte.MaxValue; this.graph.Axis.Z.MinorGridLines.Color = Color.LightGray; this.graph.Axis.Z.MinorGridLines.DrawStyle = LineDrawStyle.Dot; this.graph.Axis.Z.MinorGridLines.Visible = false; this.graph.Axis.Z.Visible = false; this.graph.Axis.Z2.Labels.HorizontalAlign = StringAlignment.Near; this.graph.Axis.Z2.Labels.ItemFormatString = ""; this.graph.Axis.Z2.Labels.Orientation = TextOrientation.Horizontal; this.graph.Axis.Z2.Labels.SeriesLabels.HorizontalAlign = StringAlignment.Near; this.graph.Axis.Z2.Labels.SeriesLabels.Orientation = TextOrientation.Horizontal; this.graph.Axis.Z2.Labels.SeriesLabels.VerticalAlign = StringAlignment.Center; this.graph.Axis.Z2.Labels.VerticalAlign = StringAlignment.Center; this.graph.Axis.Z2.MajorGridLines.AlphaLevel = byte.MaxValue; this.graph.Axis.Z2.MajorGridLines.Color = Color.Gainsboro; this.graph.Axis.Z2.MajorGridLines.DrawStyle = LineDrawStyle.Dot; this.graph.Axis.Z2.MajorGridLines.Visible = true; this.graph.Axis.Z2.MinorGridLines.AlphaLevel = byte.MaxValue; this.graph.Axis.Z2.MinorGridLines.Color = Color.LightGray; this.graph.Axis.Z2.MinorGridLines.DrawStyle = LineDrawStyle.Dot; this.graph.Axis.Z2.MinorGridLines.Visible = false; this.graph.Axis.Z2.Visible = false; this.graph.Border.CornerRadius = 5; this.graph.ChartType = ChartType.LineChart; this.graph.ColorModel.AlphaLevel = (byte)150; this.graph.Data.EmptyStyle.LineStyle.DrawStyle = LineDrawStyle.Dash; this.graph.Data.SwapRowsAndColumns = true; this.graph.Data.UseRowLabelsColumn = true; this.graph.Dock = DockStyle.Fill; this.graph.EmptyChartText = "Data Not Available."; this.graph.ForeColor = SystemColors.ControlText; this.graph.Legend.Location = LegendLocation.Bottom; this.graph.Legend.Margins.Bottom = 0; this.graph.Legend.Margins.Left = 0; this.graph.Legend.Margins.Right = 0; this.graph.Legend.Margins.Top = 0; this.graph.Legend.SpanPercentage = 22; this.graph.Legend.Visible = true; this.graph.Location = new Point(0, 0); this.graph.Name = "graph"; this.graph.Size = new Size(485, 384); this.graph.TabIndex = 0; this.graph.TitleBottom.Visible = false; this.graph.TitleTop.Visible = false; this.graph.Tooltips.Font = new Font("Microsoft Sans Serif", 7.8f); this.graph.Tooltips.FormatString = ""; this.graph.DataItemOver += new DataItemOverEventHandler(this.graph_DataItemOver); this.btnPrint.Anchor = AnchorStyles.Bottom | AnchorStyles.Right; this.btnPrint.Location = new Point(435, 271); this.btnPrint.Name = "btnPrint"; this.btnPrint.Size = new Size(38, 23); this.btnPrint.TabIndex = 3; this.btnPrint.Text = "Print"; this.btnPrint.Click += new EventHandler(this.btnPrint_Click); this.ultraPrintPreviewDialog1.Name = "ultraPrintPreviewDialog1"; this.AutoScaleDimensions = new SizeF(6f, 13f); //this.AutoScaleMode = AutoScaleMode.Font; this.ClientSize = new Size(485, 384); this.Controls.Add((Control)this.btnPrint); this.Controls.Add((Control)this.graph); // this.Icon = (Icon) componentResourceManager.GetObject("$this.Icon"); this.Name = "FrmGraph"; this.ShowIcon = false; this.ShowInTaskbar = false; this.Text = "Graph"; this.graph.EndInit(); this.ResumeLayout(false); }
public void AddTagesmitteltemperaturen(object chartData, List<Zeitraum> zeitraums ) { var periods = zeitraums.OrderByDescending(p => p.Start).GetFormatted(true); this.CreateHeading("3. Tagesmitteltemperaturen³ des gewählten Abrechnungszeitraumes und des Vorjahres"); ICanvas legendCanvas = default(ICanvas); IText text = default(IText); // Add grid IGrid grid = this.currentBand.AddGrid(); GridCellPattern cellPattern = new GridCellPattern(); cellPattern.Alignment = new ContentAlignment(Alignment.Left, Alignment.Middle); // Grid pattern for borders around block GridPattern gridPattern = new GridPattern(); gridPattern.Borders = new Borders(new Pen(new Color(0, 0, 0))); gridPattern.Paddings.All = 10; gridPattern.Apply(grid); IGridColumn column = grid.AddColumn(); IGridRow gridRow = grid.AddRow(); IGridCell gridCell = gridRow.AddCell(); //Add Legend gridCell.Alignment = new ContentAlignment(Alignment.Center, Alignment.Middle); IGrid legendGrid = gridCell.AddGrid(); IGridCell legendCell; legendGrid.Width = new FixedWidth(450); column = legendGrid.AddColumn(); column.Width = new FixedWidth(7); column = legendGrid.AddColumn(); column = legendGrid.AddColumn(); column.Width = new FixedWidth(7); column = legendGrid.AddColumn(); column = legendGrid.AddColumn(); column.Width = new FixedWidth(7); column = legendGrid.AddColumn(); gridRow = legendGrid.AddRow(); //1 Period legendCell = gridRow.AddCell(); cellPattern.Apply(legendCell); legendCanvas = legendCell.AddCanvas(); legendCanvas.Width = new FixedWidth(5); legendCanvas.Paddings.All = 0; legendCanvas.Margins.All = 0; legendCanvas.Height = new FixedHeight(5); legendCanvas.Pen = new Pen(new Color(65, 69, 120), 2); legendCanvas.DrawLine(0, 2.5f, 5, 2.5f); legendCell = gridRow.AddCell(); cellPattern.Apply(legendCell); text = legendCell.AddText(); text.Style.Font = this.pdfFonts[PdfFont.DefaultNormalReg]; text.AddContent(periods[0]); //2 Period legendCell = gridRow.AddCell(); cellPattern.Apply(legendCell); legendCanvas = legendCell.AddCanvas(); legendCanvas.Width = new FixedWidth(5); legendCanvas.Height = new FixedHeight(5); legendCanvas.Pen = new Pen(new Color(204, 76, 24), 2); legendCanvas.DrawLine(0, 2.5f, 5, 2.5f); legendCell = gridRow.AddCell(); cellPattern.Apply(legendCell); text = legendCell.AddText(); text.Style.Font = this.pdfFonts[PdfFont.DefaultNormalReg]; text.AddContent(periods[1]); //Ausgangbasis legendCell = gridRow.AddCell(); cellPattern.Apply(legendCell); legendCanvas = legendCell.AddCanvas(); legendCanvas.Width = new FixedWidth(5); legendCanvas.Height = new FixedHeight(5); legendCanvas.Pen = new Pen(Colors.Green, 2); legendCanvas.DrawLine(0, 2.5f, 5, 2.5f); legendCell = gridRow.AddCell(); cellPattern.Apply(legendCell); text = legendCell.AddText(); text.Style.Font = this.pdfFonts[PdfFont.DefaultNormalReg]; text.AddContent("Heizgrenztemperatur"); //text.AddContent("Heizgrenztemperatur⁴"); //Add Chart //chartData.Columns("Heizgrenztemperatur").ColumnName = "Heizgrenztemperatur³" gridRow = grid.AddRow(); gridCell = gridRow.AddCell(); ICanvas canvas = gridCell.AddCanvas(); //Me.currentBand.AddCanvas() canvas.Width = new FixedWidth(530); canvas.Height = new FixedHeight(300); using (System.Drawing.Graphics g = canvas.CreateGraphics()) { using (UltraChart myChart = new UltraChart()) { TemperaturChart.GetChart(myChart, chartData, 530, 300); myChart.Legend.Visible = false; myChart.RenderPdfFriendlyGraphics(g); } } //this.currentBand.AddStretcher(); }
private UltraChart CreateNewStackColumnChart() { UltraChart lStackColumnChart = new UltraChart(); try { lStackColumnChart.Dock = DockStyle.Fill; lStackColumnChart.ChartType = ChartType.StackColumnChart; lStackColumnChart.ColumnChart.SeriesSpacing = 1; Infragistics.UltraChart.Resources.Appearance.ChartTextAppearance chartTextAppearance = new Infragistics.UltraChart.Resources.Appearance.ChartTextAppearance(); Infragistics.UltraChart.Resources.Appearance.StackAppearance stackAppearance = new Infragistics.UltraChart.Resources.Appearance.StackAppearance(); chartTextAppearance.ChartTextFont = new Font("Verdana", 8F); chartTextAppearance.Column = 0; chartTextAppearance.ItemFormatString = "<DATA_VALUE:00.00>"; chartTextAppearance.Row = -2; chartTextAppearance.VerticalAlign = StringAlignment.Center; chartTextAppearance.HorizontalAlign = StringAlignment.Near; lStackColumnChart.BarChart.ChartText.Add(chartTextAppearance); lStackColumnChart.Axis.BackColor = Color.White; lStackColumnChart.Axis.X.Extent = 35; lStackColumnChart.Axis.Y.Extent = 20; lStackColumnChart.Axis.Y.Margin.Far.Value = 2; lStackColumnChart.Axis.Y.Labels.Font = new Font("Verdana", 8F); lStackColumnChart.Axis.Y.Labels.FontColor = Color.DimGray; lStackColumnChart.Axis.Y.Labels.HorizontalAlign = StringAlignment.Far; lStackColumnChart.Axis.Y.Labels.ItemFormatString = "<DATA_VALUE:0.##>"; lStackColumnChart.Axis.Y.Labels.Layout.Behavior = AxisLabelLayoutBehaviors.Auto; lStackColumnChart.Axis.Y.Labels.Orientation = TextOrientation.Horizontal; lStackColumnChart.Axis.Y.Labels.SeriesLabels.Font = new Font("Verdana", 7F); lStackColumnChart.Axis.Y.Labels.SeriesLabels.FontColor = Color.DimGray; lStackColumnChart.Axis.Y.Labels.SeriesLabels.HorizontalAlign = StringAlignment.Center; lStackColumnChart.Axis.Y.Labels.SeriesLabels.Layout.Behavior = AxisLabelLayoutBehaviors.Auto; lStackColumnChart.Axis.Y.Labels.SeriesLabels.Orientation = TextOrientation.VerticalLeftFacing; lStackColumnChart.Axis.Y.Labels.SeriesLabels.VerticalAlign = StringAlignment.Center; lStackColumnChart.Axis.Y.Labels.VerticalAlign = StringAlignment.Center; lStackColumnChart.Axis.Y.LineThickness = 1; lStackColumnChart.Axis.Y.MajorGridLines.AlphaLevel = 255; lStackColumnChart.Axis.Y.MajorGridLines.Color = Color.Gainsboro; lStackColumnChart.Axis.Y.MajorGridLines.DrawStyle = LineDrawStyle.Solid; lStackColumnChart.Axis.Y.MajorGridLines.Visible = true; lStackColumnChart.Axis.Y.MinorGridLines.AlphaLevel = 200; lStackColumnChart.Axis.Y.MinorGridLines.Color = Color.LightGray; lStackColumnChart.Axis.Y.MinorGridLines.DrawStyle = LineDrawStyle.Dot; lStackColumnChart.Axis.Y.MinorGridLines.Visible = true; lStackColumnChart.Axis.Y.TickmarkInterval = 40; lStackColumnChart.Axis.Y.TickmarkStyle = AxisTickStyle.Smart; lStackColumnChart.Axis.Y.Visible = true; lStackColumnChart.Axis.X.Labels.ItemFormatString = String.Empty; lStackColumnChart.Axis.X.Labels.SeriesLabels.Font = new Font("Verdana", 8F); lStackColumnChart.Axis.X.Labels.SeriesLabels.FontColor = Color.DimGray; lStackColumnChart.Axis.X.Labels.Layout.Behavior = AxisLabelLayoutBehaviors.Auto; lStackColumnChart.Axis.Y.Labels.Layout.Behavior = AxisLabelLayoutBehaviors.Auto; // title lStackColumnChart.TitleBottom.Visible = false; lStackColumnChart.TitleTop.Font = new Font("Verdana", 10F, FontStyle.Regular); lStackColumnChart.TitleTop.HorizontalAlign = StringAlignment.Center; lStackColumnChart.TitleTop.Visible = false; lStackColumnChart.Tooltips.Font = new Font("Verdana", 8F); lStackColumnChart.Tooltips.FormatString = " Drive <SERIES_LABEL> <ITEM_LABEL>: <DATA_VALUE> GB "; lStackColumnChart.Tooltips.HighlightFillColor = Color.LightBlue; lStackColumnChart.Tooltips.HighlightOutlineColor = Color.LightBlue; // colours lStackColumnChart.BackgroundImageLayout = ImageLayout.Center; lStackColumnChart.Border.Color = Color.FromArgb(170, 173, 187); lStackColumnChart.ColorModel.Scaling = ColorScaling.Decreasing; lStackColumnChart.ColorModel.AlphaLevel = 200; lStackColumnChart.ColorModel.ColorBegin = Color.FromArgb(151, 189, 100); //lStackColumnChart.ColorModel.ColorEnd = System.Drawing.Color.Red; lStackColumnChart.ColorModel.ModelStyle = ColorModels.Office2007Style; //lColumnChart.ColorModel.Scaling = ColorScaling.None; lStackColumnChart.Tooltips.Overflow = TooltipOverflow.ChartArea; Infragistics.UltraChart.Resources.Appearance.GradientEffect gradientEffect1 = new Infragistics.UltraChart.Resources.Appearance.GradientEffect(); gradientEffect1.Coloring = GradientColoringStyle.Lighten; gradientEffect1.Style = GradientStyle.BackwardDiagonal; lStackColumnChart.Effects.Effects.Add(gradientEffect1); lStackColumnChart.Data.UseRowLabelsColumn = false; lStackColumnChart.EmptyChartText = ""; lStackColumnChart.InvalidDataReceived += lStackColumnChart_InvalidDataReceived; } catch (Exception ex) { //logger.Error(ex.Message); } return(lStackColumnChart); }
private void SetChartDataPoint(UltraChart chart, DataTable tb, string StartField, string EndField, string RowField, string ColumnField) { try { DataTable tbMy = IniMyChartTable(); int sno = 0; foreach (DataRow dr in tb.Rows) { string start = BLL.ConvertRule.ToDateString(dr[StartField], "yyyy-MM-dd"); string end = BLL.ConvertRule.ToDateString(dr[EndField], "yyyy-MM-dd"); if ((start == end) && (start != "")) { Infragistics.UltraChart.Resources.Appearance.EllipseAnnotation ann = new Infragistics.UltraChart.Resources.Appearance.EllipseAnnotation(); int row = (int)dr[RowField]; int col = (int)dr[ColumnField]; Color color; if (BLL.ConvertRule.ToString(dr["Task"]) == "实际") { color = Color.Salmon; } else { color = Color.LimeGreen; } ann.FillColor = color; ann.OutlineThickness = 3; ann.Text = " "; ann.Width = 8; ann.Height = 8; /* * int x = 195; * int y = 26; * ann.Location.Type = Infragistics.UltraChart.Shared.Styles.LocationType.Pixels; * ann.Location.LocationX = x; * ann.Location.LocationY = y; */; ann.Location.Type = Infragistics.UltraChart.Shared.Styles.LocationType.RowColumn; ann.Location.Row = row; ann.Location.Column = col; // ann.Text = string.Format("{0},{1}", row, col); chart.Annotations.Add(ann); //客户端事件 begin--------------- sno++; DataRow drMy = tbMy.NewRow(); drMy["sno"] = sno; drMy["row"] = row; drMy["col"] = col; tbMy.Rows.Add(drMy); //客户端事件 end--------------- } } } catch (Exception ex) { throw ex; } }
public static void ProcessChart(UltraChart chart_) { if (_overrides == null) return; if (chart_.ChartType == ChartType.Composite) { foreach (ChartArea area in chart_.CompositeChart.ChartAreas) { if (_overrides.ChartBackColor.HasValue && _overrides.ChartBackColorStop.HasValue) { area.PE.ElementType = PaintElementType.Gradient; area.PE.FillGradientStyle = GradientStyle.Vertical; area.PE.Fill = _overrides.ChartBackColor.Value; area.PE.FillStopColor = _overrides.ChartBackColorStop.Value; } if (_overrides.LineFrom.HasValue || _overrides.LineTo.HasValue) { foreach (AxisItem axis in area.Axes) { if (axis.LineColor == _overrides.LineFrom.Value) axis.LineColor = _overrides.LineTo.Value; if (axis.Labels.FontColor == _overrides.LineFrom.Value || axis.Labels.FontColor.Name.Equals("0")) axis.Labels.FontColor = _overrides.LineTo.Value; if (axis.Labels.SeriesLabels != null && axis.Labels.SeriesLabels.FontColor == _overrides.LineFrom) axis.Labels.SeriesLabels.FontColor = _overrides.LineTo.Value; } foreach (Infragistics.UltraChart.Data.Series.SeriesBase sb in chart_.CompositeChart.Series) { for (int i = 0; i < sb.PEs.Count; ++i) { if (sb.PEs[i].Fill == _overrides.LineFrom.Value) { sb.PEs.RemoveAt(i); sb.PEs.Insert(0, new PaintElement(_overrides.LineTo.Value)); } } } } foreach (ChartLayerAppearance chart in chart_.CompositeChart.ChartLayers) { if (chart.ChartType == ChartType.LineChart) { LineChartAppearance app = (LineChartAppearance) chart.ChartTypeAppearance; if (app.Thickness == 1) app.Thickness = 2; } } } } else { if(_overrides.ChartBackColor.HasValue) chart_.BackColor = _overrides.ChartBackColor.Value; if (_overrides.LineTo.HasValue) { chart_.Axis.X.LineColor = _overrides.LineTo.Value; chart_.Axis.Y.LineColor = _overrides.LineTo.Value; chart_.Axis.X.Labels.FontColor = _overrides.LineTo.Value; chart_.Axis.Y.Labels.FontColor = _overrides.LineTo.Value; chart_.Axis.X.Labels.SeriesLabels.FontColor = _overrides.LineTo.Value; chart_.Axis.Y.Labels.SeriesLabels.FontColor = _overrides.LineTo.Value; } GradientEffect gd = new GradientEffect(); gd.Style = GradientStyle.ForwardDiagonal; gd.Coloring = GradientColoringStyle.Lighten; chart_.Effects.Add(gd); } }