private NLinearScaleConfigurator ConfigureScale(NFillStyle rulerFillStyle, Color tickColor) { NLinearScaleConfigurator scale = new NLinearScaleConfigurator(); scale.RulerStyle.FillStyle = (NFillStyle)rulerFillStyle.Clone(); scale.RulerStyle.Shape = ScaleLevelShape.Bar; scale.RulerStyle.Height = new NLength(5, NGraphicsUnit.Point); scale.RulerStyle.BorderStyle.Color = tickColor; scale.OuterMajorTickStyle.LineStyle.Color = tickColor; scale.InnerMajorTickStyle.LineStyle.Color = tickColor; scale.MajorGridStyle.LineStyle.Color = tickColor; NScaleStripStyle strip = new NScaleStripStyle(); strip.StrokeStyle = null; strip.FillStyle = (NFillStyle)rulerFillStyle.Clone(); strip.FillStyle.SetTransparencyPercent(80); strip.SetShowAtWall(ChartWallType.Back, true); strip.SetShowAtWall(ChartWallType.Left, true); scale.StripStyles.Add(strip); scale.MajorGridStyle.SetShowAtWall(ChartWallType.Back, true); scale.MajorGridStyle.SetShowAtWall(ChartWallType.Left, true); return(scale); }
/// <summary> /// /// </summary> /// <param name="flowChartingShape"></param> /// <param name="bounds"></param> /// <param name="text"></param> /// <param name="fillStyle"></param> /// <returns></returns> public NShape CreateFlowChartingShape(FlowChartingShapes flowChartingShape, NRectangleF bounds, string text, NFillStyle fillStyle) { NFlowChartingShapesFactory factory = new NFlowChartingShapesFactory(document); NShape shape = factory.CreateShape((int)flowChartingShape); shape.Bounds = bounds; shape.Text = text; shape.Style.FillStyle = (NFillStyle)fillStyle.Clone(); document.ActiveLayer.AddChild(shape); return(shape); }
/// <summary> /// /// </summary> /// <param name="basicShape"></param> /// <param name="bounds"></param> /// <param name="text"></param> /// <param name="fillStyle"></param> /// <param name="addToActiveLayer"></param> /// <returns></returns> public NShape CreateBasicShape(BasicShapes basicShape, NRectangleF bounds, string text, NFillStyle fillStyle, bool addToActiveLayer) { NBasicShapesFactory factory = new NBasicShapesFactory(document); NShape shape = factory.CreateShape((int)basicShape); shape.Bounds = bounds; shape.Text = text; shape.Style.FillStyle = (NFillStyle)fillStyle.Clone(); if (addToActiveLayer) { document.ActiveLayer.AddChild(shape); } return(shape); }
protected NCompositeShape CreateLegendItem(NRectangleF bounds, string str, NFillStyle fillStyle) { NCompositeShape item = new NCompositeShape(); NRectanglePath rect = new NRectanglePath(0, 0, 2, 2); NStyle.SetFillStyle(rect, (fillStyle.Clone() as NFillStyle)); item.Primitives.AddChild(rect); NTextPrimitive text = new NTextPrimitive(str, new NRectangleF(2, 0, 4, 2)); item.Primitives.AddChild(text); item.UpdateModelBounds(); item.Bounds = bounds; return(item); }