---
Product: Aspose.PDF
Platform: net
Page Type: reference
Canonical URL: https://reference.aspose.org/pdf/net/Graph
---

# Graph

## Overview

`Graph` is a class in Aspose.PDF FOSS for .NET.
Inherits from: `BaseParagraph`.

A graph container that holds drawable shapes and renders them to a content stream.

This class provides 7 methods for working with Graph objects in .NET programs.
Available methods include: `Add`, `Build`, `Clone`, `Graph`.
All public members are accessible to any .NET application after installing the Aspose.PDF FOSS for .NET package.
Properties: `Border`, `GraphInfo`, `Height`, `HorizontalAlignment`, `Hyperlink`, `HyperlinkText`, and 13 more.

## Properties

| Name | Type | Access | Description |
|------|------|--------|-------------|
| `Width` | `double` | Read/Write | Gets or sets the width. |
| `Height` | `double` | Read/Write | Gets or sets the height. |
| `IsChangePosition` | `bool` | Read/Write | When false the graph is placed at an absolute position (Left, Top) and does not participate in the document flow. |
| `Left` | `double` | Read/Write | Absolute horizontal position from the left page edge (used when IsChangePosition is false). |
| `Top` | `double` | Read/Write | Absolute vertical position from the top page edge (used when IsChangePosition is false). |
| `Border` | `BorderInfo?` | Read/Write | Optional border around the graph area. |
| `GraphInfo` | `Aspose.Pdf.GraphInfo` | Read/Write | Default stroke/fill settings inherited by shapes added to this graph. |
| `ZIndex` | `int` | Read/Write | Z-index for layering; higher draws on top. |
| `Title` | `Aspose.Pdf.Text.TextFragment?` | Read/Write | Optional title rendered above the graph. |
| `Shapes` | `BoundsCheckableList` | Read/Write | The list of shapes inside this graph. |
| `HorizontalAlignment` | `HorizontalAlignment` | Read/Write | Horizontal alignment applied to this paragraph. |
| `VerticalAlignment` | `VerticalAlignment` | Read/Write | Vertical alignment applied to this paragraph. |
| `Margin` | `MarginInfo?` | Read/Write | Outer-margin info applied to this paragraph. |
| `IsFirstParagraphInColumn` | `bool` | Read/Write | Force the paragraph to start a new column. |
| `IsKeptWithNext` | `bool` | Read/Write | Keep this paragraph on the same page as the next one. |
| `IsInNewPage` | `bool` | Read/Write | Force the paragraph to start on a new page. |
| `IsInLineParagraph` | `bool` | Read/Write | Inline paragraph flag (does not start a new line). |
| `HyperlinkText` | `string?` | Read/Write | Legacy string-typed hyperlink target. |
| `Hyperlink` | `Hyperlink?` | Read/Write | Typed hyperlink decoration applied to the paragraph. |

## Methods

| Signature | Description |
|-----------|-------------|
| `Graph(width: double, height: double)` | Calls Graph on this Graph instance. |
| `Graph(width: float, height: float)` | Single-precision overload. |
| `Add(shape: Shape)` | Calls Add on this Graph instance. |
| `Clone()` | Shallow clone — shapes are shared by reference. |
| `Build()` | Render all shapes to a content stream. |
| `Build(page: Page?)` | Render all shapes to a content stream, registering ExtGState resources on the page if needed. |
| `Build(page: Page?, offsetX: double, offsetY: double)` | Render all shapes to a content stream translated so the graph's local origin (bottom-left corner) lands at (offsetX, offsetY) in page coordinates. |

## See Also

- [Aspose.PDF for .NET — Enterprise API Reference](https://reference.aspose.com/pdf/net/)