private void VariantComboBack_SelectedIndexChanged(object sender, System.EventArgs e) { if (m_bSkipUpdate) { return; } NGradientFillStyle gradientFillStyle = (NGradientFillStyle)nChartControl1.BackgroundStyle.FillStyle; gradientFillStyle.Variant = (GradientVariant)VariantComboBack.SelectedIndex; nChartControl1.Refresh(); }
private void EndColorBack_Click(object sender, System.EventArgs e) { NGradientFillStyle gradientFillStyle = (NGradientFillStyle)nChartControl1.BackgroundStyle.FillStyle; colorDialog1.Color = gradientFillStyle.EndColor; if (colorDialog1.ShowDialog() == DialogResult.OK) { gradientFillStyle.EndColor = colorDialog1.Color; nChartControl1.Refresh(); } }
private void BeginColorBars_Click(object sender, System.EventArgs e) { NGradientFillStyle gradientFillStyle = (NGradientFillStyle)(m_Bar.FillStyle); colorDialog1.Color = gradientFillStyle.BeginColor; if (colorDialog1.ShowDialog() == DialogResult.OK) { gradientFillStyle.BeginColor = colorDialog1.Color; nChartControl1.Refresh(); } }
private void StyleComboBack_SelectedIndexChanged(object sender, System.EventArgs e) { if (m_bSkipUpdate) { return; } NGradientFillStyle gradientFillStyle = (NGradientFillStyle)nChartControl1.BackgroundStyle.FillStyle; gradientFillStyle.Style = (Nevron.GraphicsCore.GradientStyle)StyleComboBack.SelectedIndex; nChartControl1.Refresh(); }
private void EndColorWalls_Click(object sender, System.EventArgs e) { NGradientFillStyle gradientFillStyle = (NGradientFillStyle)m_Chart.Wall(ChartWallType.Back).FillStyle; colorDialog1.Color = gradientFillStyle.EndColor; if (colorDialog1.ShowDialog() == DialogResult.OK) { gradientFillStyle.EndColor = colorDialog1.Color; m_Chart.Wall(ChartWallType.Back).FillStyle = gradientFillStyle; m_Chart.Wall(ChartWallType.Left).FillStyle = gradientFillStyle; m_Chart.Wall(ChartWallType.Floor).FillStyle = gradientFillStyle; nChartControl1.Refresh(); } }
private void VariantComboWalls_SelectedIndexChanged(object sender, System.EventArgs e) { if (m_bSkipUpdate) { return; } NGradientFillStyle gradientFillStyle = (NGradientFillStyle)(m_Chart.Wall(ChartWallType.Back).FillStyle); gradientFillStyle.Variant = (GradientVariant)VariantComboWalls.SelectedIndex; m_Chart.Wall(ChartWallType.Back).FillStyle = gradientFillStyle; m_Chart.Wall(ChartWallType.Left).FillStyle = gradientFillStyle; m_Chart.Wall(ChartWallType.Floor).FillStyle = gradientFillStyle; nChartControl1.Refresh(); }
private void StyleComboWalls_SelectedIndexChanged(object sender, System.EventArgs e) { if (m_bSkipUpdate) { return; } NGradientFillStyle gradientFillStyle = (NGradientFillStyle)m_Chart.Wall(ChartWallType.Back).FillStyle; gradientFillStyle.Style = (Nevron.GraphicsCore.GradientStyle)StyleComboWalls.SelectedIndex; m_Chart.Wall(ChartWallType.Back).FillStyle = gradientFillStyle; m_Chart.Wall(ChartWallType.Left).FillStyle = gradientFillStyle; m_Chart.Wall(ChartWallType.Floor).FillStyle = gradientFillStyle; nChartControl1.Refresh(); }
public override void OnAfterPaint(NPanel panel, NPanelPaintEventArgs eventArgs) { NGraphics graphics = eventArgs.Graphics; double dPreviousValue, dCurrentValue; int nBarCount = 10; NChart chart = panel as NChart; NBarSeries bar = (NBarSeries)chart.Series[0]; NAxis horzAxis = chart.Axis(StandardAxis.PrimaryX); NAxis vertAxis = chart.Axis(StandardAxis.PrimaryY); NVector3DF vecClientPoint = new NVector3DF(); NVector3DF vecModelPoint = new NVector3DF(); int nBarSize = (int)(chart.ContentArea.Width * (int)bar.WidthPercent) / (nBarCount * 200); // init pens and brushes NStrokeStyle rectStrokeStyle = new NStrokeStyle(1, Color.DarkBlue); NFillStyle rectFillStyle = new NGradientFillStyle(GradientStyle.Horizontal, GradientVariant.Variant1, Color.FromArgb(125, Color.LightBlue), Color.FromArgb(125, Color.DarkBlue)); NLightingImageFilter lightingFilter = new NLightingImageFilter(); NStrokeStyle positiveArrowStrokeStyle = new NStrokeStyle(1, Color.DarkGreen); NFillStyle positiveArrowFillStyle = new NGradientFillStyle(GradientStyle.Horizontal, GradientVariant.Variant1, Color.Green, Color.DarkGreen); positiveArrowFillStyle.ImageFiltersStyle.Filters.Add(lightingFilter); NStrokeStyle equalSignStrokeStyle = new NStrokeStyle(1, Color.DarkGray); NFillStyle equalSignFillStyle = new NGradientFillStyle(GradientStyle.Horizontal, GradientVariant.Variant1, Color.Gray, Color.DarkGray); positiveArrowFillStyle.ImageFiltersStyle.Filters.Add(lightingFilter); NStrokeStyle negativeArrowStrokeStyle = new NStrokeStyle(1, Color.DarkRed); NFillStyle negativeArrowFillStyle = new NGradientFillStyle(GradientStyle.Horizontal, GradientVariant.Variant1, Color.Red, Color.DarkRed); positiveArrowFillStyle.ImageFiltersStyle.Filters.Add(lightingFilter); for (int i = 1; i < bar.Values.Count; i++) { dPreviousValue = (double)bar.Values[i - 1]; dCurrentValue = (double)bar.Values[i]; vecModelPoint.X = horzAxis.TransformScaleToModel(false, i); vecModelPoint.Y = vertAxis.TransformScaleToModel(false, (float)(double)bar.Values[i]); vecModelPoint.Z = 0; if (!chart.TransformModelToClient(vecModelPoint, ref vecClientPoint)) { continue; } RectangleF rcArrowRect = new RectangleF(vecClientPoint.X - nBarSize, vecClientPoint.Y - nBarSize, 2 * nBarSize, 2 * nBarSize); if (rcArrowRect.Width <= 0 || rcArrowRect.Height <= 0) { continue; } if (!DisplayMark(dCurrentValue, dPreviousValue)) { continue; } // draw arrow background GraphicsPath path = GetRoundRectanglePath(rcArrowRect); graphics.PaintPath(rectFillStyle, rectStrokeStyle, path); path.Dispose(); rcArrowRect.Inflate(-5, -5); // draw the arrow itself if (rcArrowRect.Width <= 0 || rcArrowRect.Height <= 0) { continue; } if (dCurrentValue < dPreviousValue) { // draw negative arrow path = GetArrowPath(rcArrowRect, false); graphics.PaintPath(negativeArrowFillStyle, negativeArrowStrokeStyle, path); path.Dispose(); } else if (dCurrentValue > dPreviousValue) { // draw positive arrow path = GetArrowPath(rcArrowRect, true); graphics.PaintPath(positiveArrowFillStyle, positiveArrowStrokeStyle, path); path.Dispose(); } else { // draw equal sign NRectangleF rect = new NRectangleF(rcArrowRect.Left, rcArrowRect.Top, rcArrowRect.Width, rcArrowRect.Height / 3.0f); graphics.PaintRectangle(equalSignFillStyle, equalSignStrokeStyle, rect); rect = new NRectangleF(rcArrowRect.Left, rcArrowRect.Bottom - rect.Height, rcArrowRect.Width, rect.Height); graphics.PaintRectangle(equalSignFillStyle, equalSignStrokeStyle, rect); } } }
public override void Initialize() { base.Initialize(); // set a chart title NLabel title = nChartControl1.Labels.AddHeader("Tooltips and Cursor"); title.TextStyle.FontStyle = new NFontStyle("Times New Roman", 18, FontStyle.Italic); title.ContentAlignment = ContentAlignment.BottomCenter; title.Location = new NPointL(new NLength(50, NRelativeUnit.ParentPercentage), new NLength(2, NRelativeUnit.ParentPercentage)); // init the values for the tooltip properties NTooltipTool tooltip = new NTooltipTool(); AutoPopDelayUpDown.Value = tooltip.AutoPopDelay; InitialDelayUpDown.Value = tooltip.InitialDelay; ReshowDelayUpDown.Value = tooltip.ReshowDelay; m_Chart = nChartControl1.Charts[0]; m_Chart.Axis(StandardAxis.Depth).Visible = false; // Add stripes for the left and the bottom axes NAxisStripe s1 = m_Chart.Axis(StandardAxis.PrimaryY).Stripes.Add(50, 60); NAxisStripe s2 = m_Chart.Axis(StandardAxis.PrimaryX).Stripes.Add(2, 3); s1.FillStyle = new NColorFillStyle(Color.CornflowerBlue); s1.SetShowAtWall(ChartWallType.Left, true); s2.FillStyle = new NColorFillStyle(Color.DarkOrange); // Create a bar series m_Bar = (NBarSeries)m_Chart.Series.Add(SeriesType.Bar); m_Bar.BarShape = BarShape.Bar; m_Bar.Legend.Mode = SeriesLegendMode.DataPoints; m_Bar.Values.Add(20.0); m_Bar.Values.Add(60.0); m_Bar.Values.Add(50.0); m_Bar.Values.Add(80.0); m_Bar.Values.Add(60.0); m_Bar.InteractivityStyles.Add(0, new NInteractivityStyle("Data item 0", CursorType.Default)); m_Bar.InteractivityStyles.Add(1, new NInteractivityStyle("Data item 1", CursorType.Default)); m_Bar.InteractivityStyles.Add(2, new NInteractivityStyle("Data item 2", CursorType.Default)); m_Bar.InteractivityStyles.Add(3, new NInteractivityStyle("Data item 3", CursorType.Default)); m_Bar.InteractivityStyles.Add(4, new NInteractivityStyle("Data item 4", CursorType.Default)); // set some fill styles in the collection. NFillStyle fillStyle; fillStyle = new NGradientFillStyle(GradientStyle.DiagonalUp, GradientVariant.Variant3, Color.Chocolate, Color.WhiteSmoke); m_Bar.FillStyles.Add(0, fillStyle); fillStyle = new NGradientFillStyle(GradientStyle.DiagonalUp, GradientVariant.Variant3, Color.Goldenrod, Color.WhiteSmoke); m_Bar.FillStyles.Add(1, fillStyle); fillStyle = new NGradientFillStyle(GradientStyle.DiagonalUp, GradientVariant.Variant3, Color.OliveDrab, Color.WhiteSmoke); m_Bar.FillStyles.Add(2, fillStyle); fillStyle = new NGradientFillStyle(GradientStyle.DiagonalUp, GradientVariant.Variant3, Color.SteelBlue, Color.WhiteSmoke); m_Bar.FillStyles.Add(3, fillStyle); fillStyle = new NGradientFillStyle(GradientStyle.DiagonalUp, GradientVariant.Variant3, Color.BlueViolet, Color.WhiteSmoke); m_Bar.FillStyles.Add(4, fillStyle); // init form controls EnableTooltipChangeCheckBox.Checked = true; CursorChangeCheckBox.Checked = true; ChartObjectComboBox.Items.Add("Background"); ChartObjectComboBox.Items.Add("Back chart wall"); ChartObjectComboBox.Items.Add("Left chart wall"); ChartObjectComboBox.Items.Add("Floor chart wall"); ChartObjectComboBox.Items.Add("Primary Y axis"); ChartObjectComboBox.Items.Add("Primary X axis"); ChartObjectComboBox.Items.Add("Horizontal stripe"); ChartObjectComboBox.Items.Add("Vertical stripe"); ChartObjectComboBox.Items.Add("Legend"); ChartObjectComboBox.Items.Add("Data item 0"); ChartObjectComboBox.Items.Add("Data item 1"); ChartObjectComboBox.Items.Add("Data item 2"); ChartObjectComboBox.Items.Add("Data item 3"); ChartObjectComboBox.Items.Add("Data item 4"); ChartObjectComboBox.SelectedIndex = 0; CursorComboBox.FillFromEnum(typeof(CursorType)); CursorComboBox.SelectedIndex = 0; }
// Draw Flaws on Map public void DrawPieceFlaw(int pieceNum, bool drawFlag) { List<FlawInfoAddPriority> flawPiece = MapWindowVariable.FlawPieces[pieceNum]; nChartMap.Series.Clear(); SubPieceMarkup(pieceNum); if (flawPiece.Count > 0) { bool skipFlag = false; foreach (FlawInfoAddPriority f in flawPiece) { skipFlag = false; NPointSeries point = (NPointSeries)nChartMap.Series.Add(SeriesType.Point); point.Name = f.FlawID.ToString(); point.Labels.Add(f.FlawID); point.Size = new NLength(3, NRelativeUnit.ParentPercentage); point.BorderStyle.Width = new NLength(0, NGraphicsUnit.Millimeter); NDataLabelStyle dataLabel = new NDataLabelStyle(); dataLabel.Format = f.FlawID.ToString(); dataLabel.TextStyle.StringFormatStyle.HorzAlign = Nevron.HorzAlign.Center; point.DataLabelStyle = dataLabel; point.DataLabelStyle.Visible = false; foreach (DataGridViewRow row in gvFlawClass.Rows) { DataGridViewCheckBoxCell col = (DataGridViewCheckBoxCell)row.Cells[2]; if (f.FlawType == Convert.ToInt32(row.Cells["FlawType"].Value)) { if (!Convert.ToBoolean(row.Cells["Display"].EditedFormattedValue)) { skipFlag = true; break; } point.FillStyle = new NColorFillStyle(System.Drawing.ColorTranslator.FromHtml(row.Cells["Color"].Value.ToString())); switch (row.Cells["Shape"].Value.ToString()) { case "▲": point.PointShape = PointShape.DiagonalCross; break; case "▼": point.PointShape = PointShape.InvertedCone; break; case "■": point.PointShape = PointShape.Bar; break; case "●": point.PointShape = PointShape.Sphere; break; case "+": point.PointShape = PointShape.Cross; break; case "╳": point.PointShape = PointShape.DiagonalCross; break; case "★": point.PointShape = PointShape.Star; break; default: break; } } } if (skipFlag) continue; point.Tag = f.FlawType; point.UseXValues = true; // When BottomAxe equals zero, bottom axis is CD otherwise is RMD if (MapWindowVariable.BottomAxe == 0) point.AddDataPoint(new NDataPoint(f.CD, f.RMD)); else point.AddDataPoint(new NDataPoint(f.RMD, f.CD)); } } if (drawFlag) { MapWindowVariable.CurrentPiece = MapWindowVariable.FlawPieces.Count; lbPageCurrent.Text = MapWindowVariable.FlawPieces.Count.ToString(); lbPageTotal.Text = lbPageCurrent.Text; if (MapWindowVariable.FlawPieces.Count > 1) { btnPrevPiece.Enabled = true; } btnNextPiece.Enabled = false; } Color red = Color.FromArgb(255, 150, 150); NGradientFillStyle WallFail = new NGradientFillStyle(red, red); NGradientFillStyle WallPass = new NGradientFillStyle(Color.White, Color.White); if (MapWindowVariable.PieceResult[MapWindowVariable.CurrentPiece - 1]) nChartMap.Wall(ChartWallType.Back).FillStyle = WallPass; else nChartMap.Wall(ChartWallType.Back).FillStyle = WallFail; nChart.Refresh(); }
public override void Initialize() { base.Initialize(); // Set background gradient nChartControl1.BackgroundStyle.FillStyle = new NGradientFillStyle(Nevron.GraphicsCore.GradientStyle.DiagonalUp, GradientVariant.Variant3, Color.FromArgb(187, 221, 255), Color.White); // add label NLabel title = nChartControl1.Labels.AddHeader("Gradient Fill Style"); title.TextStyle.FontStyle = new NFontStyle("Times New Roman", 18, FontStyle.Italic); title.TextStyle.FillStyle = new NGradientFillStyle(Nevron.GraphicsCore.GradientStyle.Horizontal, GradientVariant.Variant1, Color.MidnightBlue, Color.PaleVioletRed); title.ContentAlignment = ContentAlignment.BottomCenter; title.Location = new NPointL(new NLength(50, NRelativeUnit.ParentPercentage), new NLength(2, NRelativeUnit.ParentPercentage)); // setup chart m_Chart = nChartControl1.Charts[0]; m_Chart.Axis(StandardAxis.Depth).Visible = false; NLinearScaleConfigurator linearScale = (NLinearScaleConfigurator)m_Chart.Axis(StandardAxis.PrimaryY).ScaleConfigurator; linearScale.MajorGridStyle.LineStyle.Color = Color.White; linearScale.MajorGridStyle.LineStyle.Pattern = LinePattern.Dot; NOrdinalScaleConfigurator ordinalScale = (NOrdinalScaleConfigurator)m_Chart.Axis(StandardAxis.PrimaryX).ScaleConfigurator; ordinalScale.MajorGridStyle.LineStyle.Color = Color.White; ordinalScale.MajorGridStyle.LineStyle.Pattern = LinePattern.Dot; ordinalScale.MajorGridStyle.SetShowAtWall(ChartWallType.Back, true); m_Chart.Projection.SetPredefinedProjection(PredefinedProjection.PerspectiveTilted); m_Chart.Projection.Rotation = -14; m_Chart.LightModel.SetPredefinedLightModel(PredefinedLightModel.ShinyTopLeft); // Setup walls Color c = Color.FromArgb(128, 128, 192); NGradientFillStyle wallGradientFillStyle = new NGradientFillStyle(Nevron.GraphicsCore.GradientStyle.Horizontal, GradientVariant.Variant1, c, Color.White); m_Chart.Wall(ChartWallType.Back).FillStyle = wallGradientFillStyle; m_Chart.Wall(ChartWallType.Left).FillStyle = wallGradientFillStyle; m_Chart.Wall(ChartWallType.Floor).FillStyle = wallGradientFillStyle; // Create a bar series m_Bar = (NFloatBarSeries)m_Chart.Series.Add(SeriesType.FloatBar); m_Bar.DataLabelStyle.Visible = false; m_Bar.BarShape = BarShape.Bar; m_Bar.BarEdgePercent = 50; m_Bar.WidthPercent = 60; m_Bar.DepthPercent = 60; m_Bar.Legend.Mode = SeriesLegendMode.DataPoints; m_Bar.FillStyle = new NGradientFillStyle(Nevron.GraphicsCore.GradientStyle.Horizontal, GradientVariant.Variant1, Color.Green, Color.Yellow); m_Bar.AddDataPoint(new NFloatBarDataPoint(2.0, 24.0)); m_Bar.AddDataPoint(new NFloatBarDataPoint(21.0, 60.0)); m_Bar.AddDataPoint(new NFloatBarDataPoint(22.0, 53.0)); m_Bar.AddDataPoint(new NFloatBarDataPoint(34.0, 80.0)); m_Bar.AddDataPoint(new NFloatBarDataPoint(11.0, 62.0)); // init form controls FillStyleCombo(StyleComboBars); FillStyleCombo(StyleComboWalls); FillStyleCombo(StyleComboBack); FillVariantCombo(VariantComboBars); FillVariantCombo(VariantComboWalls); FillVariantCombo(VariantComboBack); m_bSkipUpdate = true; StyleComboBars.SelectedIndex = (int)((NGradientFillStyle)m_Bar.FillStyle).Style; VariantComboBars.SelectedIndex = (int)((NGradientFillStyle)m_Bar.FillStyle).Variant; StyleComboWalls.SelectedIndex = (int)((NGradientFillStyle)m_Chart.Wall(ChartWallType.Back).FillStyle).Style; VariantComboWalls.SelectedIndex = (int)((NGradientFillStyle)m_Chart.Wall(ChartWallType.Back).FillStyle).Variant; StyleComboBack.SelectedIndex = (int)((NGradientFillStyle)nChartControl1.BackgroundStyle.FillStyle).Style; VariantComboBack.SelectedIndex = (int)((NGradientFillStyle)nChartControl1.BackgroundStyle.FillStyle).Variant; m_bSkipUpdate = false; }
private void CreateScene(NDrawingDocument document) { document.BackgroundStyle.FrameStyle.Visible = false; NFillStyle cpaFillStyle = new NGradientFillStyle(GradientStyle.Horizontal, GradientVariant.Variant1, Color.FromArgb(102, 204, 255), Color.FromArgb(0, 128, 128)); NFillStyle clientFillStyle = new NGradientFillStyle(GradientStyle.Horizontal, GradientVariant.Variant1, Color.FromArgb(255, 102, 0), Color.FromArgb(255, 204, 0)); NFillStyle stripeFillStyle = new NGradientFillStyle(GradientStyle.Horizontal, GradientVariant.Variant1, Color.White, Color.FromArgb(221, 221, 221)); NTextStyle abcTextStyle = new NTextStyle(new Font("Arial", 12), Color.FromArgb(150, 150, 150)); float abcWidth = 150; NDrawingDocumentHelper helper = new NDrawingDocumentHelper(document); // configure the document helper.DefaultGridCellSize = new NSizeF(100, 70); helper.DefaultGridSpacing = new NSizeF(30, 30); helper.DefaultGridOrigin = new NPointF(60, 30); document.Bounds = new NRectangleF(0, 0, 1000, (6 * helper.DefaultGridCellSize.Height) + (7 * helper.DefaultGridSpacing.Height)); document.ShadowsZOrder = ShadowsZOrder.BehindLayer; // create the stripes NRectangleShape rect = new NRectangleShape(0, 0, document.Width, document.Height / 3); rect.Style.FillStyle = (NFillStyle)stripeFillStyle.Clone(); rect.Style.StrokeStyle = new NStrokeStyle(0, Color.White); document.ActiveLayer.AddChild(rect); rect = new NRectangleShape(0, document.Height / 3, document.Width, document.Height / 3); rect.Style.FillStyle = (NFillStyle)stripeFillStyle.Clone(); rect.Style.StrokeStyle = new NStrokeStyle(0, Color.White); document.ActiveLayer.AddChild(rect); rect = new NRectangleShape(0, 2 * document.Height / 3, document.Width, document.Height / 3); rect.Style.FillStyle = (NFillStyle)stripeFillStyle.Clone(); rect.Style.StrokeStyle = new NStrokeStyle(0, Color.White); document.ActiveLayer.AddChild(rect); // create A,B,C texts NTextShape text = new NTextShape("A", document.Width - abcWidth, 0, abcWidth, document.Height / 3); text.Mode = BoxTextMode.Stretch; text.Style.TextStyle = (abcTextStyle.Clone() as NTextStyle); document.ActiveLayer.AddChild(text); text = new NTextShape("B", document.Width - abcWidth, document.Height / 3, abcWidth, document.Height / 3); text.Mode = BoxTextMode.Stretch; text.Style.TextStyle = (abcTextStyle.Clone() as NTextStyle); document.ActiveLayer.AddChild(text); text = new NTextShape("C", document.Width - abcWidth, 2 * document.Height / 3, abcWidth, document.Height / 3); text.Mode = BoxTextMode.Stretch; text.Style.TextStyle = (abcTextStyle.Clone() as NTextStyle); document.ActiveLayer.AddChild(text); // add stripe texts text = new NTextShape("Sing up client", document.Width - abcWidth, document.Height / 3 - 50, abcWidth, 50); document.ActiveLayer.AddChild(text); text = new NTextShape("Monthly Accounting Services", document.Width - abcWidth, 2 * document.Height / 3 - 50, abcWidth, 50); document.ActiveLayer.AddChild(text); text = new NTextShape("Additional Services", document.Width - abcWidth, 3 * document.Height / 3 - 50, abcWidth, 50); document.ActiveLayer.AddChild(text); // create a layer for the forground shapes NLayer layer = new NLayer(); document.Layers.AddChild(layer); document.ActiveLayerUniqueId = layer.UniqueId; layer.Style.ShadowStyle = new NShadowStyle(ShadowType.GaussianBlur, Color.Gray, new Nevron.GraphicsCore.NPointL(5, 5), 1, new NLength(10)); // shapes in row 1 NShape newClient = helper.CreateBasicShape(BasicShapes.Diamond, helper.GetGridCell(0, 0), "New Client", cpaFillStyle); NShape register = helper.CreateBasicShape(BasicShapes.Rectangle, helper.GetGridCell(0, 1), "Register", cpaFillStyle); NShape clientAccountInfo = helper.CreateFlowChartingShape(FlowChartingShapes.Data, helper.GetGridCell(0, 2), "Client account info", cpaFillStyle); NShape explainDataEntryProcedures = helper.CreateBasicShape(BasicShapes.Rectangle, helper.GetGridCell(0, 3), "Explain data entry procedures", cpaFillStyle); // shapes in row 2 NShape dataEntry = helper.CreateFlowChartingShape(FlowChartingShapes.ManualInput, helper.GetGridCell(2, 0), "Data Entry", clientFillStyle); NShape emailCompleted = helper.CreateFlowChartingShape(FlowChartingShapes.Document, helper.GetGridCell(2, 1), "E-mail Completed", clientFillStyle); NShape review = helper.CreateBasicShape(BasicShapes.Rectangle, helper.GetGridCell(2, 2), "Review", cpaFillStyle); NShape needsRevising = helper.CreateBasicShape(BasicShapes.Diamond, helper.GetGridCell(2, 3), "Needs revising", cpaFillStyle); NShape emailRevisions = helper.CreateBasicShape(BasicShapes.Rectangle, helper.GetGridCell(2, 4), "E-mail revisions", cpaFillStyle); NShape evaluateRevisions = helper.CreateBasicShape(BasicShapes.Rectangle, helper.GetGridCell(2, 5), "Evaluate revisions", clientFillStyle); // shapes in row 3 NShape emailApprovedRevisions = helper.CreateFlowChartingShape(FlowChartingShapes.Document, helper.GetGridCell(3, 2), "E-mail Approved Revisions", clientFillStyle); NShape evaluateRevisions2 = helper.CreateBasicShape(BasicShapes.Rectangle, helper.GetGridCell(3, 4), "Evaluate Revisions", clientFillStyle); NShape answerClientEmail = helper.CreateBasicShape(BasicShapes.Rectangle, helper.GetGridCell(3, 5), "Answer Client E-mail", cpaFillStyle); // shapes in row 4 NShape paywoll = helper.CreateFlowChartingShape(FlowChartingShapes.Document, helper.GetGridCell(5, 2), "Payroll", clientFillStyle); NShape taxes = helper.CreateBasicShape(BasicShapes.Rectangle, helper.GetGridCell(5, 3), "Taxes", clientFillStyle); NShape controller = helper.CreateBasicShape(BasicShapes.Rectangle, helper.GetGridCell(5, 4), "Controller", cpaFillStyle); // create the optional ports of the shape evaluateRevisions.CreateShapeElements(ShapeElementsMask.Ports); // some shapes need to have extra ports NRotatedBoundsPort port = new NRotatedBoundsPort(evaluateRevisions.UniqueId, new NContentAlignment(-25, 50)); port.Name = "BottomLeft"; evaluateRevisions.Ports.AddChild(port); port = new NRotatedBoundsPort(evaluateRevisions.UniqueId, new NContentAlignment(+25, 50)); port.Name = "BottomRight"; evaluateRevisions.Ports.AddChild(port); // create the optional ports of the shape answerClientEmail.CreateShapeElements(ShapeElementsMask.Ports); port = new NRotatedBoundsPort(answerClientEmail.UniqueId, new NContentAlignment(-25, -50)); port.Name = "TopLeft"; answerClientEmail.Ports.AddChild(port); port = new NRotatedBoundsPort(answerClientEmail.UniqueId, new NContentAlignment(+25, -50)); port.Name = "TopRight"; answerClientEmail.Ports.AddChild(port); // connect shapes in levels helper.CreateConnector(newClient, "Center", register, "Center", ConnectorType.Line, "YES"); helper.CreateConnector(register, "Center", clientAccountInfo, "Center", ConnectorType.Line, ""); helper.CreateConnector(clientAccountInfo, "Center", explainDataEntryProcedures, "Center", ConnectorType.Line, ""); helper.CreateConnector(dataEntry, "Center", emailCompleted, "Center", ConnectorType.Line, ""); helper.CreateConnector(emailCompleted, "Center", review, "Center", ConnectorType.Line, ""); helper.CreateConnector(review, "Center", needsRevising, "Center", ConnectorType.Line, ""); helper.CreateConnector(needsRevising, "Center", emailRevisions, "Center", ConnectorType.Line, "YES"); helper.CreateConnector(emailRevisions, "Center", evaluateRevisions, "Center", ConnectorType.Line, ""); helper.CreateConnector(evaluateRevisions2, "Center", emailApprovedRevisions, "Center", ConnectorType.Line, ""); // connect accross levels NStep3Connector connector = (helper.CreateConnector(newClient, "Center", dataEntry, "Center", ConnectorType.SideToSide, "NO") as NStep3Connector); connector.UseMiddleControlPointPercent = false; connector.MiddleControlPointOffset = -50; helper.CreateConnector(explainDataEntryProcedures, "Center", dataEntry, "Center", ConnectorType.TopToBottom, ""); helper.CreateConnector(emailApprovedRevisions, "Center", review, "Center", ConnectorType.Line, ""); helper.CreateConnector(emailRevisions, "Center", evaluateRevisions2, "Center", ConnectorType.Line, ""); helper.CreateConnector(evaluateRevisions, "BottomLeft", answerClientEmail, "TopLeft", ConnectorType.Line, ""); helper.CreateConnector(answerClientEmail, "TopRight", evaluateRevisions, "BottomRight", ConnectorType.Line, ""); connector = (helper.CreateConnector(needsRevising, "Center", paywoll, "Center", ConnectorType.TopToBottom, "") as NStep3Connector); connector.MiddleControlPointPercent = 66; connector = (helper.CreateConnector(needsRevising, "Center", taxes, "Center", ConnectorType.TopToBottom, "") as NStep3Connector); connector.MiddleControlPointPercent = 66; connector = (helper.CreateConnector(needsRevising, "Center", controller, "Center", ConnectorType.TopToBottom, "") as NStep3Connector); connector.MiddleControlPointPercent = 66; // create the legend NGroup legend = new NGroup(); NRectangleShape ledendBackground = new NRectangleShape(0, 0, 1, 3); ledendBackground.Style.FillStyle = new NColorFillStyle(Color.White); legend.Shapes.AddChild(ledendBackground); NTextShape legendTitle = new NTextShape("Legend", 0, 0, 1, 1); legend.Shapes.AddChild(legendTitle); NRectangleF bounds = new NRectangleF(0, 1, 1, 1); bounds.Inflate(-0.2f, -0.2f); NShape shape = helper.CreateBasicShape(BasicShapes.Rectangle, bounds, "CPA", (NFillStyle)cpaFillStyle.Clone(), false); legend.Shapes.AddChild(shape); bounds = new NRectangleF(0, 2, 1, 1); bounds.Inflate(-0.2f, -0.2f); shape = helper.CreateBasicShape(BasicShapes.Rectangle, bounds, "Client", (NFillStyle)clientFillStyle.Clone(), false); legend.Shapes.AddChild(shape); legend.UpdateModelBounds(); legend.Bounds = helper.GetGridCell(4, 0, 1, 1); document.ActiveLayer.AddChild(legend); }