Sparkline

A sparkline widget.

Included in: dx.chartjs.js, dx.all.js

The dxSparkline widget represents a small chart that contains only one series. Due to its size, the data represented by a sparkline is visualized in a highly condensed way. Since sparklines are compact, they are usually placed in a table or embedded in text.

You can create a widget using one of the following approaches.

  • jQuery
    Use the dxSparkline jQuery plug-in.

    HTML
    <div id="sparklineContainer"></div>
    JavaScript
    $("#sparklineContainer").dxSparkline({
        dataSource: dataSource,
        argumentField: 'month',
        valueField: '2010',
        type: 'spline'
    });
  • Knockout
    Add a div element and apply the dxSparkline binding to this element.

    HTML
    <div data-bind="dxSparkline: {
        dataSource: dataSource,
        argumentField: 'month',
        valueField: '2010',
        type: 'spline'
    }"></div>
  • Angular
    Add a div element and apply the dx-sparkline directive to this element.

    HTML
    <div dx-sparkline="{
        dataSource: dataSource,
        argumentField: 'month',
        valueField: '2010',
        type: 'spline'
    }"></div>

Note that DevExtreme widgets require you to link the jQuery and Globalize libraries to your application. If you use the Knockout or Angular approach, the Knockout or Angular library is also required.

See Also

View Demo Watch Video

Configuration

An object that specifies configuration options for the dxSparkline widget.

Methods

This section describes the methods that can be used in code to manipulate objects related to the dxSparkline widget.

Events

This section describes events exposed by this widget.