Data Source Controls

The Chart control can obtain data from one of ASP.NET data source controls (such as EntityDataSource) on the server side. It is the easiest way to provide large amounts of data from the database to the control, and it is the right choice if you do not need to get data from third-party sources.

<dx:BootstrapPieChart runat="server" DataSourceID="ChartDataSource" TitleText="Meat/Poultry Sales">
    <SeriesCollection>
        <dx:BootstrapPieChartSeries ArgumentField="ProductName" ValueField="ProductSales">
            <Label Visible="true">
                <Format Type="Currency" />
            </Label>
        </dx:BootstrapPieChartSeries>
    </SeriesCollection>
</dx:BootstrapPieChart>
<ef:EntityDataSource runat="server" ID="ChartDataSource" ContextTypeName="DevExpress.Web.Demos.NorthwindContextSL" EntitySetName="SalesByCategory"
    Select="it.[ProductName], it.[ProductSales]" Where="it.[CategoryName] = 'Meat/Poultry'">
</ef:EntityDataSource>

JSON Files

If your server stores data in JSON, performing AJAX requests is inevitable. But instead of configuring these requests manually, assign the URL of your data storage (in this demo, a JSON file) to the DataSourceUrl property, and the Chart will do the rest. This URL may specify an absolute or relative path to the resource.

<dx:BootstrapChart runat="server" DataSourceUrl="~/jsondata/simple.json" TitleText="Daily Sales" Rotated="true">
    <ArgumentAxis ArgumentType="System.DateTime" MaxValue="2017-01-10" />
    <ValueAxisCollection>
        <dx:BootstrapChartValueAxis TickInterval="1" />
    </ValueAxisCollection>
    <SeriesCollection>
        <dx:BootstrapChartBarSeries ArgumentField="date" ValueField="sales" />
    </SeriesCollection>
    <SettingsLegend Visible="false" />
</dx:BootstrapChart>

JSONP

You can use a JSONP callback parameter supported by jQuery.ajax() to access a web service that implements a JSONP (JSON with padding) endpoint.

<dx:BootstrapChart runat="server" DataSourceUrl="~/Charts/DataBinding.aspx?callback=?" TitleText="Olympic Medals in 2016" Rotated="true" CustomPalette="#ffd700, #c0c0c0, #cd7f32">
    <SettingsCommonSeries ArgumentField="country">
        <Label Visible="true" />
    </SettingsCommonSeries>
    <SeriesCollection>
        <dx:BootstrapChartStackedBarSeries ValueField="gold" Name="Gold Medals" />
        <dx:BootstrapChartStackedBarSeries ValueField="silver" Name="Silver Medals" />
        <dx:BootstrapChartStackedBarSeries ValueField="bronze" Name="Bronze Medals" />
    </SeriesCollection>
    <SettingsLegend VerticalAlignment="Bottom" HorizontalAlignment="Center" />
</dx:BootstrapChart>
Screen Size
Color Themes
Demo QR Code