Wijmo UI for the Web
stacked Option
wijmo.chart.wijbarchart Namespace > options type : stacked Option

Sets a value that determines whether to stack bars in the chart to show how each value in a series contributes to the total. If you want each bar to fill up 100 percet of the chart area, you can also set the is100Percent option to true.

Type: Boolean

Default value: false

Syntax
$(function () {
    
    // Get value
    var returnsValue; // Type:  boolean
    returnsValue = $(".selector").wijbarchart("option", "stacked");
    
    // Set value
    var newValue; // Type:  boolean
    $(".selector").wijbarchart("option", "stacked", newValue);
        
});
var stacked : boolean;
Example

This example sets the stacked option to true, producing a chart like the one in the image below.

<script id="scriptInit" type="text/javascript">
    $(document).ready(function () {
        $("#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] }
            }],
        });
    });
</script>
Remarks

See Clustering Data for more information on the concept of using the same X values with multiple Y series.

The chart label for each bar shows a running total, with the value at the end of the bar showing the grand total. To change the numeric formatting of these labels, see chartLabelFormatString, or to change the color or font, see chartLabelStyle. To rotate these labels, see Rotate Bar Labels, or to hide them, see showChartLabels.

See Also

Reference

options type
wijbarchart Method