alexa
menu

Blazor

  • Code Examples
  • Upgrade Guide
  • User Guide
  • Demos
  • Support
  • Forums
  • Download
Search Results for

    Show / Hide Table of Contents

    Class DataVizCommonHelper

    Provides static utility methods for SVG chart rendering, including theme color palettes, unit conversion, data type detection, and event invocation helpers.

    Inheritance
    object
    DataVizCommonHelper
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: Syncfusion.Blazor.DataVizCommon
    Assembly: Syncfusion.Blazor.dll
    Syntax
    public static class DataVizCommonHelper

    Methods

    PixelToNumber(string, Regex)

    Converts a CSS size string with a unit suffix (px, rem, em, pt) to a numeric pixel value.

    Declaration
    public static double PixelToNumber(string size, Regex regex)
    Parameters
    Type Name Description
    string size

    The size string to convert (e.g., "16px", "1.5rem", "12pt").

    Regex regex

    An optional Regex used to parse the numeric portion; defaults to the internal number pattern if null.

    Returns
    Type Description
    double

    The equivalent pixel value as a double, or 0 if the unit is unrecognized or the input is empty.

    StringToNumber(string, double)

    Converts a size string (e.g., "50%" or "100px") to a numeric value relative to the given container size.

    Declaration
    public static double StringToNumber(string size, double containerSize)
    Parameters
    Type Name Description
    string size

    The size string to convert. Supports percentage and pixel units.

    double containerSize

    The container size used to resolve percentage values.

    Returns
    Type Description
    double

    The numeric size value, or NaN if the input is null, empty, or "auto".

    In this article
    Back to top Generated by DocFX
    Copyright © 2001 - 2026 Syncfusion Inc. All Rights Reserved