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

Sets a value that determines whether to present stacked bars as a total value of 100 percent, illustrating how each value contributes to the total.

Type: Boolean

Default value: false

 

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

This code results in bars with data for three countries stacked to fill 100% of the chart area, with each series in a different color representing its percentage of the total.

<script id="scriptInit" type="text/javascript">
    $(document).ready(function () {
        $("#wijbarchart").wijbarchart({
            stacked: true,
            is100Percent: true,
            seriesList: [{
                label: "US",
                legendEntry: true,
                data: { x: ['PS3', 'XBOX360', 'Wii'], y: [12.35, 21.50, 30.56] }
            }, {
                label: "Japan",
                legendEntry: true,
                data: { x: ['PS3', 'XBOX360', 'Wii'], y: [4.58, 1.23, 9.67] }
            }, {
                label: "Other",
                legendEntry: true,
                data: { x: ['PS3', 'XBOX360', 'Wii'], y: [31.59, 37.14, 65.32] }
            }],
        });
    });
</script>
Remarks

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.

Note: This value has no effect if you do not set the stacked option to true.

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

 

See Also

Reference

options type
wijbarchart Method