The SVG element to inject patterns into
Get or create a pattern with the specified configuration. Returns the pattern ID to use in fill="url(#id)".
Pattern configuration
Pattern ID string for use in fill attribute
Apply a pattern to an SVG element. Handles both style attribute and fill attribute cases.
The element to apply the pattern to
Pattern configuration
Remove pattern from an element and restore original fill.
The element to remove the pattern from
The original fill value to restore
Get all available pattern types. Useful for cycling through patterns for different data series. Note: order determines assignment, eg the first series gets the first pattern and so on.
Get pattern type by index (wraps around if index > number of patterns). Useful for assigning patterns to data series.
Zero-based index
Clean up all patterns created by this service.
Initialize the pattern service with a target SVG element. Ensures a element exists for pattern definitions.