Search results

Print and Export

Print

The rendered chart can be printed directly from the browser by calling the public method print.

print.razor
<EjsAccumulationChart  @ref="ChartObj" Title="Mobile Browser Statistics" EnableSmartLabels="true">
            <AccumulationChartLegendSettings Visible="false"></AccumulationChartLegendSettings>
  
            <AccumulationChartSeriesCollection>
                <AccumulationChartSeries DataSource="@StatisticsDetails" XName="Browser" YName="Users" Name="RIO" GroupTo="10">
                    <AccumulationDataLabelSettings Visible="true" Name="Text" Position="AccumulationLabelPosition.Outside">
                    </AccumulationDataLabelSettings>
                </AccumulationChartSeries>
            </AccumulationChartSeriesCollection>
</EjsAccumulationChart>


<Syncfusion.EJ2.Blazor.Buttons.EjsButton Id="button" Content="Print" @Onclick="@Click" IsPrimary="true" CssClass="e-flat"></Syncfusion.EJ2.Blazor.Buttons.EjsButton>

@code{
EjsAccumulationChart ChartObj;

   private void Click(UIMouseEventArgs args)
    {
        ChartObj.Print();
    }

    public class Statistics
    {
        public string Browser;
        public double Users;
    }

    public List<Statistics> StatisticsDetails = new List<Statistics> 
    {
        new Statistics { Browser = "Chrome", Users = 37 },
        new Statistics { Browser = "UC Browser", Users = 17 },
        new Statistics { Browser = "iPhone", Users = 19 },
        new Statistics { Browser = "Others", Users = 4  },
        new Statistics { Browser = "Opera", Users = 11 },
        new Statistics { Browser = "Android", Users = 12 },
    };
    
}

Export

The rendered chart can be exported to Image(jpeg or png) or SVG or PDF format by using the export method. Input parameters for this method are Export Type for format and FileName of result.

export.razor
<EjsAccumulationChart  @ref="AccChartObj" Title="Mobile Browser Statistics" EnableSmartLabels="true">
            <AccumulationChartLegendSettings Visible="false"></AccumulationChartLegendSettings>
  
            <AccumulationChartSeriesCollection>
                <AccumulationChartSeries DataSource="@StatisticsDetails" XName="Browser" YName="Users" Name="RIO" GroupTo="10">
                    <AccumulationDataLabelSettings Visible="true" Name="Text" Position="AccumulationLabelPosition.Outside">
                    </AccumulationDataLabelSettings>
                </AccumulationChartSeries>
            </AccumulationChartSeriesCollection>
</EjsAccumulationChart>

<Syncfusion.EJ2.Blazor.Buttons.EjsButton Id="button" Content="Export" @Onclick="@Click" IsPrimary="true" CssClass="e-flat"></Syncfusion.EJ2.Blazor.Buttons.EjsButton>

@code{
    
    EjsAccumulationChart AccChartObj;

    private void Click(UIMouseEventArgs args)
    {
        AccChartObj.Export(ExportType.PNG, "pngImage");
    }

    public class Statistics
    {
        public string Browser;
        public double Users;
    }

    public List<Statistics> StatisticsDetails = new List<Statistics> 
    {
        new Statistics { Browser = "Chrome", Users = 37 },
        new Statistics { Browser = "UC Browser", Users = 17 },
        new Statistics { Browser = "iPhone", Users = 19 },
        new Statistics { Browser = "Others", Users = 4  },
        new Statistics { Browser = "Opera", Users = 11 },
        new Statistics { Browser = "Android", Users = 12 },
    };

}
Contents
Contents