jQuery Chart API

A chart component is initialized with the shieldChart constructor, passing it a dictionary of properties as shown below:

<script type="text/javascript">
    $('#container').shieldChart({
        axisX: {
            drawColor: "red"
        },
        exportOptions: {
            image: true,
            print: false
        },
        tooltipSettings: {
            enabled: false,
            axisMarkers: {
                enabled: true,
                mode: 'xy',
                color: 'red',
                width: 1,
                zIndex: 3
            }
        },
        seriesSettings: {
            pie: {
                addToLegend: true
            }
        },
        dataSeries: [
            {
                collectionAlias: "Annual Report",
                seriesType: "pie",
                data: [2, 1, 3, 3, null, 5, 2, 7, 1, 4, 3, 5]
            }
        ],
        theme: "dark"
    });
</script>

For changing the theme, one should destroy and re-initialize the chart component as the following snippet shows:

<script type="text/javascript">
var chart = $('#container').swidget(),
    initialOptions = chart.initialOptions;

// set the theme to dark
initialOptions.theme = "dark";

// destroy the old chart object
chart.destroy();

// initialize a new chart object for that element, passing the new options
$('#container').shieldChart(initialOptions);
</script>