Exporting/Printing Menu

This feature allows a user to print a chart displayed by the control or export it to one of the supported document formats. The control displays an "Exporting/Printing" button when exporting is enabled, which invokes a drop-down menu that lists exporting and printing commands. The following document formats are supported: PNG, PDF, JPEG, SVG and GIF.

@model IEnumerable
@(Html.DevExpress()
    .BootstrapPieChart("chartExportingPrintingMenu")
    .Type(PieChartType.Doughnut)
    .TitleText("Confections Sales")
    .InnerRadius(0.3m)
    .SettingsExport(settings =>settings
        .Enabled(true)
        .Formats("JPEG", "PNG", "SVG", "GIF", "PDF")
        .FileName("confections_sales"))
    .SeriesCollection(series => series
        .Add()
            .ArgumentField("ProductName")
            .ValueField("ProductSales")
            .Label(label => label
                .Visible(true)
                .Format(format => format
                    .Type(DevExpress.AspNetCore.Bootstrap.FormatType.Currency))))
    .Bind(Model))

Export and Printing API

This demo illustrates the ExportTo and Print client API methods used to initiate exporting and printing from code using the Print and Export buttons above the Chart. Clicking the Print button invokes the browser's Print dialog and clicking the Export button saves the chart as a PNG file to your local storage.

@(Html.DevExpress()
    .BootstrapChart("exportAndPrintingAPI")
    .TitleText("Relative Masses of the Heaviest Solar System Objects")
    .ArgumentAxis(axis => axis
        .Visible(true)
        .Label(label => label
            .OverlappingBehavior(OverlappingBehavior.Rotate)
            .RotationAngle(30)))
    .ValueAxisCollection(axis => axis
        .AddValueAxis()
            .Type(AxisScaleType.Logarithmic)
            .TitleText("Mass Relative to the Earth")
            .Visible(true))
    .SeriesCollection(series => series
        .AddScatterSeries()
            .ArgumentField("name")
            .ValueField("mass")
            .TagField("type")
            .Point(point => point
                .Size(20)))
    .Bind("jsondata/solarsystem.json"))
function onExportClick() {
    exportAndPrintingAPI.exportTo("png", "mass_chart");
}
function onPritClick() {
    exportAndPrintingAPI.print();
}
Screen Size
Color Themes
Demo QR Code