Wijmo UI for the Web
stacked Option

Default value: false

Sets a value that determines whether to stack bars in the chart to show how each value in a series contributes to the total.

Syntax
Javascript (Usage) 
$(function () {
    
    // Get value
    var value; // Type:  boolean
    value = $(".selector").wijbarchart("option", "stacked");
    
    // Set value
    var newValue; // Type:  boolean
    $(".selector").wijbarchart("option", "stacked", newValue);
        
});
Javascript (Specification) 
var stacked : boolean;
Example
// set the chart to stacked bar chart.
 $("#wijbarchart").wijbarchart({
    stacked: true,
    seriesList: [{
        label: "US",
        data: { x: ['PS3', 'XBOX360', 'Wii'], y: [12.35, 21.50, 30.56] }
    }, {
        label: "Japan",
        data: { x: ['PS3', 'XBOX360', 'Wii'], y: [4.58, 1.23, 9.67] }
    }, {
        label: "Other",
        data: { x: ['PS3', 'XBOX360', 'Wii'], y: [31.59, 37.14, 65.32] }
    }]
});
Remarks
If you want each bar to fill up 100 percet of the chart area, you can also set the is100Percent option to true. See Clustering Data for more information on the concept of using the same X values with multiple Y series.
Browser Compatibility
7
5
5

See Also

Reference

options type
wijbarchart jQuery Widget

 

 


© 2013 All Rights Reserved.

Send comments on this topic.