/// <summary> /// create chart style /// </summary> /// <param name="nodeStyle"></param> /// <returns></returns> public ChartStyle CreateChartStyle(XElement nodeStyle) { ChartStyle chartStyle = new ChartStyle(Chart.Document) { Node = nodeStyle }; IPropertyCollection pCollection = new IPropertyCollection(); if (nodeStyle.HasElements) { foreach (XElement nodeChild in nodeStyle.Elements()) { IProperty property = GetProperty(chartStyle, nodeChild); if (property != null) { pCollection.Add(property); } } } chartStyle.Node.Value = ""; foreach (IProperty property in pCollection) { chartStyle.PropertyCollection.Add(property); } //this.Chart .Styles .Add (chartStyle); return(chartStyle); }
protected void DrawRecSection(DovDrawings graphic, ChartStyle cs) { graphic.DrwColor = "white"; graphic.FillColorOpt = "#15179c"; PointF pt1 = new PointF(-secRec.Width * 0.5f, -secRec.Height * 0.5f); graphic.DrawRecSection(pt1, secRec.Width, secRec.Height, cs); }
public override void SetStyle(ChartStyle style) { if (style is SpiderChartStyle spiderStyle) { base.SetStyle(style); _style = spiderStyle; } }
public override void SetStyle(ChartStyle style) { if (style is BarChartStyle barStyle) { _style = barStyle; base.SetStyle(style); } }
public override void SetStyle(ChartStyle style) { if (style is LineChartStyle lineStyle) { _style = lineStyle; base.SetStyle(style); } }
/// <summary> /// Default constructor /// </summary> public TernaryChartControl() { InitializeComponent(); this.cs = new ChartStyle(); this.lg = new Legend(); cs.TextCanvas = textCanvas; cs.ChartCanvas = chartCanvas; }
public override void SetStyle(ChartStyle style) { if (style is ScatterChartStyle scatterStyle) { _style = scatterStyle; base.SetStyle(style); } }
public EditableAnnotationLayer(C1FlexChart chart) { AllowMove = true; _flexChart = chart; Window.Current.CoreWindow.KeyDown += CoreWindow_KeyDown; _flexChart.DoubleTapped += _flexChart_DoubleTapped; _flexChart.RightTapped += _flexChart_RighTapped; _flexChart.PointerPressed += _flexChart_PointerPressed; _flexChart.PointerReleased += _flexChart_PointerReleased; _flexChart.PointerMoved += _flexChart_PointerMoved; _flexChart.Rendered += OnChartRendered; Annotations.CollectionChanged += OnCollectionChanged; _rectCache = new List <AnnotationEx>(); _originalStyle = new ChartStyle() { Fill = new SolidColorBrush(Colors.Red) }; SelectionStyle = new ChartStyle() { Fill = new SolidColorBrush(Colors.White), Stroke = new SolidColorBrush(Colors.Red), StrokeThickness = 1, StrokeDashArray = new DoubleCollection() { 1, 2 } }; TextAnnoStyle = new ChartStyle() { FontSize = 12, Stroke = new SolidColorBrush(Colors.Black) }; Attachment = AnnotationAttachment.Absolute; //Popup to show Annotation editor EditorPopup = new Popup(); EditorPopup.IsLightDismissEnabled = true; FlexChart.KeyDown += (s1, e1) => { if (e1.Key == Windows.System.VirtualKey.Escape) { HideContentEditor(); } }; EditorPopup.Closed += (s1, e1) => { _flexChart.Invalidate(); }; }
public ChartData(ChartControl chart, IChartDataTable _table, Color _color, ChartStyle _style) { Debug.Assert(_table != null); table = _table; color = _color; style = _style; listener = new DataUpdateListener(chart.onUpdateCalled); table.onUpdate += listener; }
public override void SetStyle(ChartStyle style) { base.SetStyle(style); if (style is PieChartStyle ps) { _style = ps; } }
private void AddChart() { ChartStyle.AddChartStyle(tbTitle, tbXLabel, tbYLabel); if (DataCollection.DataList.Count == 0) { return; } DataCollection.AddLines(ChartStyle); Legend.AddLegend(ChartCanvas, DataCollection); }
public EditStyleForm(ChartStyle style) { InitializeComponent(); Style = style; var settings = new JsonSerializerSettings { Formatting = Formatting.Indented, Converters = new JsonConverter[] { new MeasureConverter(), new ColorHexConverter(), new StringEnumConverter(), new FontConverter() }, TypeNameHandling = TypeNameHandling.Auto }; jsonBox.Text = JsonConvert.SerializeObject(style, Formatting.Indented, settings); }
public static void SetStyle(this AnnotationBase annotation, ChartStyle style) { if (annotation == null || annotation.Style == null) { return; } annotation.Style.Fill = style.Fill; annotation.Style.FontStyle = style.FontStyle; annotation.Style.Stroke = style.Stroke; annotation.Style.StrokeThickness = style.StrokeThickness; }
protected override void OnAfterRender(bool firstRender) { base.OnAfterRender(firstRender); this.designContext = new CanvasContext(DesignCanvas, JsRuntime); DsgnGraphics = new DovDrawings(designContext); // this.sectionContext = new CanvasContext(SectionCanvas, JsRuntime); SecGraphics = new DovDrawings(sectionContext); sectionChart = new ChartStyle(); designChart = new ChartStyle(); }
private void NewXmlNode(string styleName) { Node = new XElement(Ns.Chart + "chart"); if (styleName != null) { Node.SetAttributeValue(Ns.Chart + "style-name", styleName); ChartStyle = new ChartStyle(Document, styleName); Styles.Add(ChartStyle); } }
protected void DrawIsoFoot() { DimensionLine dim = new DimensionLine(); DiagramGraphics = new DovDrawings(diagramContext); diagramChart = new ChartStyle(); float footW = 0.4f * DiagramCanvWidth; float footH = 0.4f * DiagramCanvHeight; diagramChart.ChartArea = new RectangleF(0, 0, footW, footH); float startX = 0; float startY = 0; DiagramGraphics.Clear(startX, startY, footW, footH); float limit = (footingData.Width > footingData.Length ? footingData.Width : footingData.Length); float xMax = 0.5f * limit; float xMin = -0.5f * limit; float yMax = 0.5f * limit; float yMin = -0.5f * limit; SetGraphicLayout(footW, footH, startX, startY, diagramChart, new float[] { xMin, xMax, yMin, yMax }); PointF fPt1 = new PointF(-0.5f * footingData.Width, 0.5f * footingData.Length); PointF fPt2 = new PointF(0.5f * footingData.Width, -0.5f * footingData.Length); fPt1 = diagramChart.Point2D(fPt1); fPt2 = diagramChart.Point2D(fPt2); DiagramGraphics.FillColorOpt = "lightslategrey"; DiagramGraphics.FillColor(fPt1, fPt2); DiagramGraphics.DrwColor = "dimgrey"; DiagramGraphics.DrawRec(fPt1, fPt2); SetGraphicLayout(footW, footH, startX, startY, diagramChart, new float[] { xMin, xMax, yMin, yMax }); PointF cPt1 = new PointF(footingData.ColLocX - 0.5f * footingData.Width + footingData.ColumnWidth * 0.5f, footingData.ColLocY - footingData.Length * 0.5f - 0.5f * footingData.ColumnLength); PointF cPt2 = new PointF(footingData.ColLocX - 0.5f * footingData.Width - footingData.ColumnWidth * 0.5f, footingData.ColLocY - footingData.Length * 0.5f + 0.5f * footingData.ColumnLength); PointF center = new PointF(footingData.ColLocX - 0.5f * footingData.Width, footingData.ColLocY - footingData.Length * 0.5f); cPt1 = diagramChart.Point2D(cPt1); cPt2 = diagramChart.Point2D(cPt2); center = diagramChart.Point2D(center); DiagramGraphics.FillColorOpt = "darkslategrey"; DiagramGraphics.FillColor(cPt1, cPt2); DiagramGraphics.DrwColor = "dimgrey"; DiagramGraphics.DrawRec(cPt1, cPt2); DiagramGraphics.DrwColor = "cadetblue"; dim.Graphic = DiagramGraphics; dim.DimLoc = DimensionLine.DimensionLocation.end; dim.DrawAdjDimLine(fPt1, fPt2, string.Format("W={0}", footingData.Width)); dim.DimDir = DimensionLine.DimensionDirection.right; DiagramGraphics.TextBase = TextBaseline.Bottom; dim.DrawOppoDimLine(fPt1, fPt2, string.Format("L={0}", footingData.Length)); dim.DimDir = DimensionLine.DimensionDirection.right; dim.DrawOppoDimLine(fPt1, center, string.Format("y={0}", footingData.ColLocY)); dim.DimLoc = DimensionLine.DimensionLocation.start; dim.DrawAdjDimLine(fPt1, center, string.Format("x={0}", footingData.ColLocX)); }
public EditableAnnotationLayer(C1FlexChart chart) { AllowMove = true; _flexChart = chart; _flexChart.PreviewMouseDown += OnPreviewMouseDown; _flexChart.MouseDown += OnMouseDown; _flexChart.PreviewMouseLeftButtonUp += _flexChart_PreviewMouseLeftButtonUp; _flexChart.MouseUp += OnMouseUp; _flexChart.MouseMove += OnMouseMove; _flexChart.MouseDoubleClick += OnMouseDoubleClick; _flexChart.Rendered += OnChartRendered; Annotations.CollectionChanged += OnCollectionChanged; _rectCache = new List <AnnotationEx>(); _originalStyle = new ChartStyle { Fill = Brushes.Red }; SelectionStyle = new ChartStyle { Fill = Brushes.White, Stroke = Brushes.Red, StrokeThickness = 1, StrokeDashArray = new DoubleCollection() { 1, 2 } }; Attachment = AnnotationAttachment.Absolute; //Popup to show Annotation editor EditorPopup = new Popup(); EditorPopup.AllowsTransparency = true; EditorPopup.Placement = PlacementMode.AbsolutePoint; EditorPopup.PlacementTarget = FlexChart; FlexChart.KeyDown += (s1, e1) => { if (e1.Key == Key.Escape) { HideContentEditor(); } }; EditorPopup.Closed += (s1, e1) => { _flexChart.Invalidate(); }; }
public void Transform(Matrix3 m, Form1 form1, ChartStyle cs) { //new version float x = 0.5f - (X - cs.XMin) / (cs.XMax - cs.XMin), y = 0.5f - (Y - cs.YMin) / (cs.YMax - cs.YMin), z = 0.5f - (Z - cs.ZMin) / (cs.ZMax - cs.ZMin); //// old version //float x = (X - cs.XMin) / (cs.XMax - cs.XMin) - 0.5f, // y = (Y - cs.YMin) / (cs.YMax - cs.YMin) - 0.5f, // z = (Z - cs.ZMin) / (cs.ZMax - cs.ZMin) - 0.5f; float k = 1f; float[] result = m.VectorMultiply( new float[4] { k *x, k *y, z, W }); X = result[0]; Y = result[1]; float xShift = 1, // 1.05f, // зміщення по X yShift = 1.05f, // 1.05f, // зміщення по Y xScale = 0.9f, // масштаб по X yScale = 0.9f; // масштаб по Y if (cs.Title != "No Title") { yShift = 1f; yScale = 0.875f; } if (cs.IsColorBar) { xShift = 0.925f; xScale = 0.9f; } // Підтягує до розмірів вільного місця { X = (xShift + xScale * X) * form1.plotPicBox.Width / 2; Y = (yShift + yScale * Y) * form1.plotPicBox.Height / 2; } // Робить розміри квадратними { //int sizeGraph = Math.Min(form1.plotPicBox.Width, form1.plotPicBox.Height); //X = (xShift * form1.plotPicBox.Width + xScale * X * sizeGraph) / 2; //Y = (yShift * form1.plotPicBox.Height + yScale * Y * sizeGraph) / 2; } }
/// <summary> /// </summary> /// <param name="propertyDescriptor"></param> /// <param name="chartStyle"></param> /// <param name="attributes"></param> /// <returns></returns> public override PropertyDescriptorCollection GetProperties(PropertyDescriptor propertyDescriptor, ChartStyle chartStyle, Attribute[] attributes) { PropertyDescriptorCollection properties = base.GetProperties(propertyDescriptor, chartStyle, attributes); properties.Remove(properties.Find("BarWidthUI", true)); // here is how you change the display name of the property on the properties grid Gui.Design.DisplayNameAttribute.SetDisplayName(properties, "DownColor", "\r\r\rColor for down bars"); Gui.Design.DisplayNameAttribute.SetDisplayName(properties, "Pen", "\r\r\rUp bars outline"); Gui.Design.DisplayNameAttribute.SetDisplayName(properties, "Pen2", "\r\r\rDown bars outline"); Gui.Design.DisplayNameAttribute.SetDisplayName(properties, "UpColor", "\r\r\rColor for up bars"); return properties; }
protected override void OnAfterRender(bool firstRender) { this.diagramContext = new CanvasContext(DiagramCanvas, JsRuntime); DiagramGraphics = new DovDrawings(diagramContext); // this.footingContext = new CanvasContext(FootingCanvas, JsRuntime); FootingGraphics = new DovDrawings(footingContext); this.detailingContext = new CanvasContext(DetailingCanvas, JsRuntime); DetailingGraphics = new DovDrawings(detailingContext); footingChart = new ChartStyle(); diagramChart = new ChartStyle(); detailingChart = new ChartStyle(); }
public static void SetStyle(this AnnotationBase annotation, ChartStyle style) { if (annotation == null || annotation.Style == null) { return; } annotation.Style.Fill = style.Fill; annotation.Style.FillColor = style.FillColor; annotation.Style.Font = style.Font; annotation.Style.Stroke = style.Stroke; annotation.Style.StrokeColor = style.StrokeColor; annotation.Style.StrokeDashPattern = style.StrokeDashPattern; annotation.Style.StrokeWidth = style.StrokeWidth; }
protected void IsoFootAnalysis() { fDesign = new IsoFootingDesign(footingData, concMat, rebarMat); fDesign.CheckBearingStress(); DiagramGraphics = new DovDrawings(diagramContext); diagramChart = new ChartStyle(); float footW = 0.4f * DiagramCanvWidth; float footH = 0.2f * DiagramCanvHeight; diagramChart.ChartArea = new RectangleF(0, 0, footW, footH); float startX = 0; float startY = 0.4f * DiagramCanvHeight; DiagramGraphics.Clear(startX, startY, footW, footH); SetGraphicLayout(footW, footH, startX, startY, diagramChart, new float[] { 0, 0, 0, 0 }); DiagramGraphics.DrwColor = "black"; //await DiagramGraphics.FillColorAsync(startX, startY, footW, footH,"black"); fDesign.DrawSfx(DiagramGraphics, diagramChart); footW = 0.2f * DiagramCanvWidth; footH = 0.4f * DiagramCanvHeight; startX = 0.4f * DiagramCanvWidth; startY = 0; DiagramGraphics.Clear(startX, startY, footW, footH); SetGraphicLayout(footW, footH, startX, startY, diagramChart, new float[] { 0, 0, 0, 0 }); fDesign.DrawSfy(DiagramGraphics, diagramChart); footW = 0.4f * DiagramCanvWidth; footH = 0.15f * DiagramCanvHeight; startX = 0; startY = 0.6f * DiagramCanvHeight; DiagramGraphics.Clear(startX, startY, footW, footH); SetGraphicLayout(footW, footH, startX, startY, diagramChart, new float[] { 0, 0, 0, 0 }); fDesign.DrawBmx(DiagramGraphics, diagramChart); footW = 0.15f * DiagramCanvWidth; footH = 0.4f * DiagramCanvHeight; startX = 0.6f * DiagramCanvWidth; startY = 0; DiagramGraphics.Clear(startX, startY, footW, footH); SetGraphicLayout(footW, footH, startX, startY, diagramChart, new float[] { 0, 0, 0, 0 }); fDesign.DrawBmy(DiagramGraphics, diagramChart); fDesign.DsgnPref = DsgnPref; if (fDesign.CheckPunching() && fDesign.CheckWideBeamShear()) { continueDetailing = true; } else { continueDetailing = false; } }
static string getFontStrings(_Style sty) { ChartStyle cstyle = new ChartStyle(sty); if (cstyle != null && cstyle.FontFamily != null) { return(cstyle.FontFamily.Source + "," + cstyle.FontSize.ToString() + "," + cstyle.FontStretch.ToString() + "," + cstyle.FontWeight.ToString() + "," + cstyle.FontStyle.ToString()); } return(null); }
/// <summary> /// Create chart for Existing customer vs New customer /// </summary> private void CreateNewCustomerChart() { C1BarChart1.SeriesList.Clear(); C1BarChart1.DataBindings.Clear(); C1ChartBinding bar = new C1ChartBinding(); bar.XField = "NewProduct"; bar.XFieldType = ChartDataXFieldType.String; bar.YField = "NewCustomer"; bar.YFieldType = ChartDataYFieldType.Number; C1ChartBinding bar1 = new C1ChartBinding(); bar1.XField = "OldProduct"; bar1.XFieldType = ChartDataXFieldType.String; bar1.YField = "OldCustomer"; bar1.YFieldType = ChartDataYFieldType.Number; this.C1BarChart1.Shadow = true; this.C1BarChart1.Axis.X.TextStyle = new ChartStyle { Fill = new ChartStyleFill { Color = Color.BlueViolet } }; this.C1BarChart1.DataBindings.Add(bar); this.C1BarChart1.DataBindings.Add(bar1); this.C1BarChart1.DataSource = SalesOrderReport.CustomerRatio; this.C1BarChart1.DataBind(); this.C1BarChart1.SeriesStyles[0].Fill = new ChartStyleFill { Color = Color.FromName("#ff9900"), Type = ChartStyleFillType.Default }; this.C1BarChart1.ClusterRadius = 12; #region Styles ChartStyleFill chartfill = new ChartStyleFill(); chartfill.Color = Color.Beige; ChartStyleFill chartfillstyle = new ChartStyleFill(); chartfillstyle.Type = ChartStyleFillType.Default; chartfillstyle.Color = Color.FromName("#ff9900"); ChartStyle chstyle = new ChartStyle(); chstyle.Fill.Color = Color.FromName("#ff9900"); ChartStyle chstyle1 = new ChartStyle(); chstyle1.Fill.Color = Color.FromName("#ff0000"); #endregion }
/// <summary> /// Default ctor /// </summary> public TypographyBase() { // Default page DIN A4 PageHeight = 29.4; PageWidth = 21.0; FontName = "Calibri"; FontSize = 11; SmallFontSize = FontSize - 2; ExtraSmallFontSize = SmallFontSize - 2; HeadingFontName = FontName; HeadingFontSize5 = FontSize; HeadingFontSize4 = HeadingFontSize5 + 2; HeadingFontSize3 = HeadingFontSize4 + 2; HeadingFontSize2 = HeadingFontSize3 + 2; HeadingFontSize1 = HeadingFontSize2 + 4; TitleFontName = FontName; SubTitleFontName = FontName; TitleFontSize = HeadingFontSize1 + 6; SubTitleFontSize = HeadingFontSize1 + 2; LineHeight = 0.5; ColumnDividerWidth = 0.5; ColumnWidth = 2.5; ColumnCount = 6; DotsPerInch = 96; LogoWidth = 2 * ColumnWidth + ColumnDividerWidth; MarginLeftFactor = 2; MarginRightFactor = 2; MarginTopFactor = 1; MarginBottomFactor = 2; SetMargins(); ChartStyle = new ChartStyle(); Copyright = "Bodoconsult GmbH"; TableBodyBackground = Color.White; TableHeaderBackground = Color.White; TableBodyUnborderedBackground = Color.Transparent; TableHeaderUnborderedBackground = Color.Transparent; TableCornerRadius = 0.3; TableBorderWidth = 0.05; TableBorderColor = Color.FromArgb(178, 204, 255); }
public void Draw(DrawingContext dc, List <Point> filteredPoints, ChartStyle chartStyle) { var geometry = new StreamGeometry(); using (StreamGeometryContext context = geometry.Open()) { context.BeginFigure(filteredPoints[0], false, false); context.PolyLineTo(filteredPoints, true, true); } geometry.Freeze(); Pen pen = new Pen(chartStyle.LineColor, 1); dc.DrawGeometry(null, pen, geometry); }
public ChartPanel(ChartOptions options) { this.SeriesType = options.SeriesType; this.IndicatorType = options.IndicatorType; this.ChartDrawing = ChartDrawingHelper.GetChartDrawing(SeriesType, IndicatorType); this.ChartData = options.ChartData; this.ChartStyle = options.ChartStyle; if (this.ChartStyle == null) { this.ChartStyle = new DefaultChartStyle(); } SizeChanged += ChartPanel_SizeChanged; }
protected override void OnAfterRender(bool firstRender) { this.diagramContext = new CanvasContext(DiagramCanvas, JsRuntime); DiagramGraphics = new DovDrawings(diagramContext); this.biaxialContext = new CanvasContext(BiaxialDiagramCanvas, JsRuntime); // this.sectionContext = new CanvasContext(SectionCanvas, JsRuntime); SecGraphics = new DovDrawings(sectionContext); this.clmnNeutralAxisContext = new CanvasContext(ColumnNeutralAxisCanvas, JsRuntime); NeutralAxisGraphics = new DovDrawings(clmnNeutralAxisContext); sectionChart = new ChartStyle(); diagramChart = new ChartStyle(); biaxialChart = new ChartStyle(); neutralAxisChart = new ChartStyle(); }
protected void DrawAxis(DovDrawings graphic, ChartStyle cs) { float axisH = 0.5f * secRec.Height * 0.8f; float axisV = 0.5f * secRec.Width * 0.8f; graphic.DrwColor = "white"; graphic.TextBase = TextBaseline.Bottom; PointF origin = cs.Point2D(new PointF(0, 0)); PointF xEnd = cs.Point2D(new PointF(axisH, 0)); PointF yEnd = cs.Point2D(new PointF(0, axisV)); graphic.DrawLine(origin, xEnd, true); graphic.DrawLine(origin, yEnd, true, true); graphic.DrawText("X", xEnd); graphic.DrawText("Y", yEnd); }
public void SinROverR3D(DataSeries ds, ChartStyle cs) { cs.XMin = -8f; cs.XMax = 8f; cs.YMin = -8f; cs.YMax = 8f; cs.ZMin = -0.5f; cs.ZMax = 1f; cs.XTick = 4f; cs.YTick = 4f; cs.ZTick = 0.5f; ds.XDataMin = cs.XMin; ds.YDataMin = cs.YMin; ds.XSpacing = 0.25f; ds.YSpacing = 0.25f; ds.XNumber = Convert.ToInt16((cs.XMax - cs.XMin) / ds.XSpacing) + 1; ds.YNumber = Convert.ToInt16((cs.YMax - cs.YMin) / ds.YSpacing) + 1; Point3[,] pts = new Point3[ds.XNumber, ds.YNumber]; for (int i = 0; i < ds.XNumber; i++) { for (int j = 0; j < ds.YNumber; j++) { float x = ds.XDataMin + i * ds.XSpacing, y = ds.YDataMin + j * ds.YSpacing, r = (float)Math.Sqrt(x * x + y * y) + float.Epsilon, z; if (r == 0) { z = 1f; } else { z = (float)Math.Sin(r) / r; } pts[i, j] = new Point3(x, y, z, 1); } } ds.PointArray = pts; }
private void GetAnnotationEditorData(AnnotationBase anno) { var editStyle = (ContentEditor as AnnotationEditor).EditingAnnotationStyle; ChartStyle contentStyle = null; if (anno is Shape) { contentStyle = (anno as Shape).ContentStyle; } if (anno is Text) { contentStyle = anno.Style; Data.AnnotationStyle style = ViewModel.ViewModel.Instance.GetAnnotationStyle(Data.NewAnnotationType.Text); if (style != null && contentStyle != null) { contentStyle.FontFamily = new FontFamily(style.FontFamily); contentStyle.FontSize = contentStyle.FontSize == 0 ? style.FontSize : contentStyle.FontSize; } } if (editStyle != null && anno != null) { editStyle.Stroke = anno.Style == null || anno.Style.Stroke == null ? Colors.Black : (anno.Style.Stroke as SolidColorBrush).Color; editStyle.Fill = anno.Style == null || anno.Style.Fill == null ? Colors.Black : (anno.Style.Fill as SolidColorBrush).Color; } if (contentStyle != null) { if (anno is Text) { editStyle.Foreground = contentStyle == null || contentStyle.Stroke == null? ViewModel.ViewModel.Instance.GetAnnotationStyle(Data.NewAnnotationType.Text).Foreground : (contentStyle.Stroke as SolidColorBrush).Color; } else { editStyle.Foreground = contentStyle == null || contentStyle.Stroke == null ? Colors.Black : (contentStyle.Stroke as SolidColorBrush).Color; } editStyle.FontFamily = contentStyle.FontFamily.Source.ToString(); editStyle.FontSize = contentStyle.FontSize; editStyle.FontWeight = contentStyle.FontWeight; } }
/// <summary> /// Create summary data of all products revenue and units sold /// </summary> private void CreateSummary() { //Scale Sales Summary data this.C1RadialGauge1.Value = SalesOrderReport.CategoryRevenue[0].Amount / 1000000; this.C1RadialGauge2.Value = SalesOrderReport.CategoryRevenue[1].Amount / 1000000; this.C1RadialGauge3.Value = SalesOrderReport.CategoryRevenue[2].Amount / 1000000; this.sonysales.Text = ""; this.mssales.Text = ""; this.NVideaSales.Text=""; this.sonysales.Text = " SONY: " + SalesOrderReport.CategoryRevenue[0].Amount.ToString("C"); this.mssales.Text = "MS: " + SalesOrderReport.CategoryRevenue[1].Amount.ToString("C"); this.NVideaSales.Text = "NVIDEA: " +SalesOrderReport.CategoryRevenue[2].Amount.ToString("C"); // Unit Sold summary C1ChartBinding unitLine = new C1ChartBinding(); unitLine.XField = "Product"; unitLine.YField = "Units"; unitsummarychart.Type = LineChartType.Area; unitsummarychart.ShowChartLabels = false; unitsummarychart.DataBindings.Add(unitLine); unitsummarychart.DataSource = SalesOrderReport.CategoryRevenue; unitsummarychart.DataBind(); unitsummarychart.SeriesList[0].FitType = LineChartFitType.Spline; unitsummarychart.AutoResize = true; #region Styles ChartStyleFill chartfill = new ChartStyleFill(); chartfill.Color = Color.Beige; ChartStyle chstyle = new ChartStyle(); chstyle.Fill.Color = Color.FromName("#ff9900"); ; chstyle.Fill.Type = ChartStyleFillType.Default; this.unitsummarychart.SeriesStyles.Add(chstyle); #endregion }
/// <summary> /// Create chart for Existing customer vs New customer /// </summary> private void CreateNewCustomerChart() { C1BarChart1.SeriesList.Clear(); C1BarChart1.DataBindings.Clear(); C1ChartBinding bar = new C1ChartBinding(); bar.XField = "NewProduct"; bar.XFieldType = ChartDataXFieldType.String; bar.YField = "NewCustomer"; bar.YFieldType = ChartDataYFieldType.Number; C1ChartBinding bar1 = new C1ChartBinding(); bar1.XField = "OldProduct"; bar1.XFieldType = ChartDataXFieldType.String; bar1.YField = "OldCustomer"; bar1.YFieldType = ChartDataYFieldType.Number; this.C1BarChart1.Shadow = true; this.C1BarChart1.Axis.X.TextStyle = new ChartStyle { Fill = new ChartStyleFill { Color = Color.BlueViolet } }; this.C1BarChart1.DataBindings.Add(bar); this.C1BarChart1.DataBindings.Add(bar1); this.C1BarChart1.DataSource = SalesOrderReport.CustomerRatio; this.C1BarChart1.DataBind(); this.C1BarChart1.SeriesStyles[0].Fill = new ChartStyleFill { Color = Color.FromName("#ff9900"),Type=ChartStyleFillType.Default }; this.C1BarChart1.ClusterRadius = 12; #region Styles ChartStyleFill chartfill = new ChartStyleFill(); chartfill.Color = Color.Beige; ChartStyleFill chartfillstyle = new ChartStyleFill(); chartfillstyle.Type = ChartStyleFillType.Default; chartfillstyle.Color = Color.FromName("#ff9900"); ChartStyle chstyle = new ChartStyle(); chstyle.Fill.Color = Color.FromName("#ff9900"); ChartStyle chstyle1 = new ChartStyle(); chstyle1.Fill.Color = Color.FromName("#ff0000"); #endregion }