# VisualSvgOptions

Controls safe SVG host integration and explicit captured-effect representation without repeating layout.

 Class  

`ChartForgeX.Rendering`

**Namespace**

`ChartForgeX.Rendering`

**Assembly**

`ChartForgeX`

**Source**

[VisualSvgOptions.cs:13](https://github.com/EvotecIT/ChartForgeX/blob/main/ChartForgeX/Rendering/VisualSvgOptions.cs#L13)

**Modifiers**

sealed

Controls safe SVG host integration and explicit captured-effect representation without repeating layout.

## Inheritance

- object
- VisualSvgOptions

## Usage

 Explore 12 API references to this type 

This type appears in these public API surfaces even when no hand-authored example is attached directly to the page.

### Returned or exposed by 8

- Method [VisualSvgOptions.WithCompactMarkup](/api/chartforgex-rendering-visualsvgoptions/#method-withcompactmarkup-boolean)
- Method [VisualSvgOptions.WithEnhanceHooks](/api/chartforgex-rendering-visualsvgoptions/#method-withenhancehooks-boolean-boolean)
- Method [VisualSvgOptions.WithFluidWidth](/api/chartforgex-rendering-visualsvgoptions/#method-withfluidwidth-boolean)
- Method [VisualSvgOptions.WithFontVariables](/api/chartforgex-rendering-visualsvgoptions/#method-withfontvariables-string-string)
- Method [VisualSvgOptions.WithInheritedFonts](/api/chartforgex-rendering-visualsvgoptions/#method-withinheritedfonts)
- Method [VisualSvgOptions.WithoutProductFonts](/api/chartforgex-rendering-visualsvgoptions/#method-withoutproductfonts)
- Method [VisualSvgOptions.WithPatternTiles](/api/chartforgex-rendering-visualsvgoptions/#method-withpatterntiles-boolean)
- Method [VisualSvgOptions.WithSharedDesignRoles](/api/chartforgex-rendering-visualsvgoptions/#method-withshareddesignroles-chartforgex-themes-visualtheme-chartforgex-thememode)

### Accepted by parameters 4

- Method [ChartExtensions.ToSvg](/api/chartforgex-chartextensions/#method-tosvg-chartforgex-core-chart-chartforgex-rendering-visualsvgoptions-string) parameter `options`
- Extension method [Chart.ToSvg](/api/chartforgex-core-chart/#extension-tosvg-chartforgex-core-chart-chartforgex-rendering-visualsvgoptions-string) parameter `options`
- Method [HtmlChartRenderer.RenderFragment](/api/chartforgex-html-htmlchartrenderer/#method-renderfragment-chartforgex-core-chart-chartforgex-rendering-visualsvgoptions-chartforgex-html-chartdatatablemode) parameter `svgOptions`
- Method [PreparedVisual.ToSvg](/api/chartforgex-rendering-preparedvisual/#method-tosvg-chartforgex-rendering-visualsvgoptions) parameter `options`

 Filter members   

    Show inherited   

 

## Constructors

 `public VisualSvgOptions(string? idScope = null, SvgColorVariables? colorVariables = null, VisualSvgLinkTarget linkTarget = SameContext, bool responsive = false, VisualSvgEffectProfile effectProfile = Baked, VisualRenderOptions? effectRasterOptions = null)` [#](#constructor-ctor-string-chartforgex-themes-svgcolorvariables-chartforgex-rendering-visualsvglinktarget-boolean-chartforgex-rendering-visualsvgeffectprofile-chartforgex-rendering-visualrenderoptions) 

[VisualSvgOptions.cs:13](https://github.com/EvotecIT/ChartForgeX/blob/main/ChartForgeX/Rendering/VisualSvgOptions.cs#L13)

Creates a detached SVG export policy.

Parameters

**idScope string? = null optional**

Unique host namespace; null uses a deterministic content namespace.

**colorVariables ChartForgeX.Themes.SvgColorVariables? = null optional**

Host CSS properties with resolved static fallback colors. The mapping is copied.

**linkTarget ChartForgeX.Rendering.VisualSvgLinkTarget = SameContext optional**

Whether safe scene links use the current browsing context or a new protected context.

**responsive bool = false optional**

Baked native effect pixels, or supported typed native SVG effects on retained vectors.

**effectProfile ChartForgeX.Rendering.VisualSvgEffectProfile = Baked optional**

Existing native raster options for baked effects; unused by native SVG filter math.

**effectRasterOptions ChartForgeX.Rendering.VisualRenderOptions? = null optional**

Whether inline SVG shrinks to its host width while preserving the logical viewport and aspect ratio.

## Methods

 `public VisualSvgOptions WithCompactMarkup(bool enabled = true)` [#](#method-withcompactmarkup-boolean) 

[VisualSvgOptions.Compact.cs:30](https://github.com/EvotecIT/ChartForgeX/blob/main/ChartForgeX/Rendering/VisualSvgOptions.Compact.cs#L30)

Returns a policy that writes a compact static SVG, retaining the other export settings.

Parameters

**enabled bool = true optional**

Whether to write compact markup.

Returns

 `VisualSvgOptions` An independent export policy. 

 `public VisualSvgOptions WithEnhanceHooks(bool enabled = true, bool includeData = false)` [#](#method-withenhancehooks-boolean-boolean) 

[VisualSvgOptions.Enhance.cs:24](https://github.com/EvotecIT/ChartForgeX/blob/main/ChartForgeX/Rendering/VisualSvgOptions.Enhance.cs#L24)

Returns a policy that writes the hooks a page-level enhance runtime needs, retaining the other export settings.

Parameters

**enabled bool = true optional**

Whether to write the hooks.

**includeData bool = false optional**

Whether to add a <metadata data-cfx-enhance-data> JSON island with series names, colours and X-sorted points. It is inert text: the SVG stays script-free.

Returns

 `VisualSvgOptions` An independent export policy. 

 `public VisualSvgOptions WithFluidWidth(bool enabled = true)` [#](#method-withfluidwidth-boolean) 

[VisualSvgOptions.Fluid.cs:20](https://github.com/EvotecIT/ChartForgeX/blob/main/ChartForgeX/Rendering/VisualSvgOptions.Fluid.cs#L20)

Returns a script-free, horizontally fluid SVG policy retaining the other export settings.

Parameters

**enabled bool = true optional**

Whether to fill the host width at the prepared logical height.

Returns

 `VisualSvgOptions` An independent export policy. 

 `public VisualSvgOptions WithFontVariables(string? familyVariable = null, string? sizeVariable = null)` [#](#method-withfontvariables-string-string) 

[VisualSvgOptions.PageTheme.cs:35](https://github.com/EvotecIT/ChartForgeX/blob/main/ChartForgeX/Rendering/VisualSvgOptions.PageTheme.cs#L35)

Lets browser SVG text use page custom properties for font family and/or size, with page inheritance as fallback.

Parameters

**familyVariable string? = null optional**

A validated custom property such as --body-font; null inherits the page family.

**sizeVariable string? = null optional**

A validated custom property such as --chart-font-size; null inherits the page size.

Returns

 `VisualSvgOptions` An independent export policy retaining the other settings. 

Exceptions

- `ArgumentException` – Neither property was supplied, or a property name is invalid.

 `public VisualSvgOptions WithInheritedFonts()` [#](#method-withinheritedfonts) 

[VisualSvgOptions.PageTheme.cs:22](https://github.com/EvotecIT/ChartForgeX/blob/main/ChartForgeX/Rendering/VisualSvgOptions.PageTheme.cs#L22)

Lets browser SVG text inherit the embedding page's font family and size.

Returns

 `VisualSvgOptions` An independent export policy retaining the other settings. 

 `public VisualSvgOptions WithoutProductFonts()` [#](#method-withoutproductfonts) 

[VisualSvgOptions.cs:22](https://github.com/EvotecIT/ChartForgeX/blob/main/ChartForgeX/Rendering/VisualSvgOptions.cs#L22)

Omits bundled product font styles from SVG embedded in a host that supplies the fonts.

Returns

 `VisualSvgOptions` An independent export policy retaining all other settings. 

 `public VisualSvgOptions WithPatternTiles(bool enabled = true)` [#](#method-withpatterntiles-boolean) 

[VisualSvgOptions.cs:30](https://github.com/EvotecIT/ChartForgeX/blob/main/ChartForgeX/Rendering/VisualSvgOptions.cs#L30)

Returns an export policy with native user-space pattern tiles, retaining the other host settings.

Parameters

**enabled bool = true optional**

Whether to use tiles. Static exports keep individual native lines by default.

Returns

 `VisualSvgOptions` An independent export policy. 

 `public VisualSvgOptions WithSharedDesignRoles(VisualTheme? theme = null, ThemeMode mode = Light)` [#](#method-withshareddesignroles-chartforgex-themes-visualtheme-chartforgex-thememode) 

[VisualSvgOptions.PageTheme.cs:55](https://github.com/EvotecIT/ChartForgeX/blob/main/ChartForgeX/Rendering/VisualSvgOptions.PageTheme.cs#L55)

Follows the shared design roles that CanopyX and HtmlForgeX pages define: colours are written as the --hfx-* role properties (see [SvgColorVariables.SharedRoles](/api/chartforgex-themes-svgcolorvariables/)) with this theme's colours as fallbacks, and text uses var(--hfx-font-sans, inherit) while keeping its prepared sizes.

Parameters

**theme ChartForgeX.Themes.VisualTheme? = null optional**

The theme the visual was prepared with; null uses [VisualTheme.Graphite](/api/chartforgex-themes-visualtheme/).

**mode ChartForgeX.ThemeMode = Light optional**

The mode the visual was prepared in.

Returns

 `VisualSvgOptions` An independent export policy retaining the other settings. 

## Inherited Methods

 `public virtual bool Equals(object? obj)` [#](#method-equals-object) 

Inherited from object

Parameters

**obj object? required**

Returns

 `bool` 

 `public virtual int GetHashCode()` [#](#method-gethashcode) 

Inherited from object

Returns

 `int` 

 `public Type GetType()` [#](#method-gettype) 

Inherited from object

Returns

 `Type` 

 `public virtual string? ToString()` [#](#method-tostring) 

Inherited from object

Returns

 `string?` 

## Properties

 `public bool CompactMarkup { get; }` [#](#property-compactmarkup) 

[VisualSvgOptions.Compact.cs:15](https://github.com/EvotecIT/ChartForgeX/blob/main/ChartForgeX/Rendering/VisualSvgOptions.Compact.cs#L15)

Gets whether the SVG leaves out what only scripts read.

 `public bool PatternTiles { get; }` [#](#property-patterntiles) 

[VisualSvgOptions.cs:25](https://github.com/EvotecIT/ChartForgeX/blob/main/ChartForgeX/Rendering/VisualSvgOptions.cs#L25)

Gets whether native hatch marks serialize as user-space SVG tiles instead of individual clipped lines.

 `public VisualSvgEffectProfile EffectProfile { get; }` [#](#property-effectprofile) 

[VisualSvgOptions.cs:67](https://github.com/EvotecIT/ChartForgeX/blob/main/ChartForgeX/Rendering/VisualSvgOptions.cs#L67)

Gets how retained typed scene effects lower. Explicit captured images remain images.

 `public VisualRenderOptions? EffectRasterOptions { get; }` [#](#property-effectrasteroptions) 

[VisualSvgOptions.cs:69](https://github.com/EvotecIT/ChartForgeX/blob/main/ChartForgeX/Rendering/VisualSvgOptions.cs#L69)

Gets immutable density/coverage/cap options for baked effects; null resolves native defaults only when needed.

 `public string? IdScope { get; private set; }` [#](#property-idscope) 

[VisualSvgOptions.cs:71](https://github.com/EvotecIT/ChartForgeX/blob/main/ChartForgeX/Rendering/VisualSvgOptions.cs#L71)

Gets the host ID namespace, or null for a deterministic content namespace.

 `public SvgColorVariables? ColorVariables { get; }` [#](#property-colorvariables) 

[VisualSvgOptions.cs:73](https://github.com/EvotecIT/ChartForgeX/blob/main/ChartForgeX/Rendering/VisualSvgOptions.cs#L73)

Gets an independent copy of the host color mapping.

 `public VisualSvgLinkTarget LinkTarget { get; }` [#](#property-linktarget) 

[VisualSvgOptions.cs:75](https://github.com/EvotecIT/ChartForgeX/blob/main/ChartForgeX/Rendering/VisualSvgOptions.cs#L75)

Gets the safe link target policy.

 `public bool Responsive { get; }` [#](#property-responsive) 

[VisualSvgOptions.cs:77](https://github.com/EvotecIT/ChartForgeX/blob/main/ChartForgeX/Rendering/VisualSvgOptions.cs#L77)

Gets whether the SVG carries self-contained responsive sizing for inline hosts.

 `public bool EnhanceHooks { get; }` [#](#property-enhancehooks) 

[VisualSvgOptions.Enhance.cs:8](https://github.com/EvotecIT/ChartForgeX/blob/main/ChartForgeX/Rendering/VisualSvgOptions.Enhance.cs#L8)

Gets whether the SVG carries the root and legend hooks the optional enhance runtime reads.

 `public bool EnhanceData { get; }` [#](#property-enhancedata) 

[VisualSvgOptions.Enhance.cs:11](https://github.com/EvotecIT/ChartForgeX/blob/main/ChartForgeX/Rendering/VisualSvgOptions.Enhance.cs#L11)

Gets whether the SVG also carries a compact JSON data island for shared-X tooltips and large key sets.

 `public bool FluidWidth { get; }` [#](#property-fluidwidth) 

[VisualSvgOptions.Fluid.cs:7](https://github.com/EvotecIT/ChartForgeX/blob/main/ChartForgeX/Rendering/VisualSvgOptions.Fluid.cs#L7)

Gets whether horizontal positions fill the host while height, text and marker sizes remain in CSS pixels.

<!-- PowerForge markdown artifact sha256:873C67DC92182A4D72B71D79733EC7A98BB5EFD660E7FD77B40866F4CE54004C -->
