Search results

Print and Export

Print

The rendered TreeMap can be printed directly from the browser by calling the public method Print. You can get the TreeMap component object using @ref="treemap".

@using Syncfusion.EJ2.Blazor.TreeMap

<button @onclick="PrintTreeMap">Print</button>
<EjsTreeMap @ref="treemap" WeightValuePath="Count" TValue="Fruit" DataSource="@fruits">
    <TreeMapLeafItemSettings LabelPath="Name" Gap="2"></TreeMapLeafItemSettings>
</EjsTreeMap>

@code {
    EjsTreeMap<Fruit> treemap;
    void PrintTreeMap()
    {
        treemap.Print();
    }
    public class Fruit
    {
        public string Name;
        public int Count;
    };

    private List<Fruit> fruits = new List<Fruit> {
        new Fruit { Name="Apple", Count=5000 },
        new Fruit { Name="Mango", Count=3000 },
        new Fruit { Name="Orange", Count=2300 },
        new Fruit { Name="Banana", Count=500 },
        new Fruit { Name="Grape", Count=4300 },
        new Fruit { Name="Papaya", Count=1200 },
        new Fruit { Name="Melon", Count=4500 }
    };

}

TreeMap with print option

Export

The rendered TreeMap can be exported to following formats by using export method. Input parameters for this method are export type for format and file name of result.

Supported formats

  1. PNG
  2. JPEG
  3. SVG
  4. PDF
@using Syncfusion.EJ2.Blazor.TreeMap

<button @onclick="ExportTreeMap">Export</button>
<EjsTreeMap @ref="treemap" WeightValuePath="Count" TValue="Fruit" DataSource="@fruits">
    <TreeMapLeafItemSettings LabelPath="Name" Gap="2"></TreeMapLeafItemSettings>
</EjsTreeMap>

@code {
    EjsTreeMap<Fruit> treemap;
    void ExportTreeMap()
    {
        treemap.Export(ExportType.PDF, "Fruits details");
    }
}

Refer code block to know the property value of fruits.

TreeMap with export option

Contents
Contents