Skip to main content
A newer version of this page is available. .

How to: Export a Chart to HTML and MHT

  • 3 minutes to read

The following example demonstrates how to export a chart to HTML and MHT files.

To export the chart, use the appropriate ExportTo~ method (e.g., ChartControlBase.ExportToHtml, ChartControlBase.ExportToPdf, ChartControlBase.ExportToMht etc.).

View Example

        xmlns:dxc="" x:Class="Export.MainWindow"
        Title="MainWindow" Height="350" Width="525">

        <dxc:ChartControl x:Name="chartControl" >
                <dxc:BarSideBySideSeries2D DisplayName="Series 1">
                    <dxc:SeriesPoint Argument="A" Value="2"/>
                    <dxc:SeriesPoint Argument="B" Value="13"/>
                    <dxc:SeriesPoint Argument="C" Value="15"/>
                    <dxc:SeriesPoint Argument="D" Value="17"/>
        <StackPanel Orientation="Horizontal">
            <Button Content="Export To HTML"   VerticalAlignment="Top" Width="95" Click="Button_Click"/>
            <Button Content="Export To MHT"   VerticalAlignment="Top"  Width="95" Click="Button_Click_1"/>