dojox/mvc/Bind.StatefulSeries (version 1.10)

Summary

Chart data plugin ("series") that watches for properties specified in dojox/mvc/at handles in the given data. At initialization, and when the properties are updated, creates the data from data given and updates the chart.

Usage

var foo = new Bind.StatefulSeries(items);
dojox/mvc/StatefulSeries
Parameter Type Description
items Anything[]

See the dojox/mvc/Bind.StatefulSeries reference documentation for more information.

Examples

Example 1

Two seconds later, the chart changes from 25%/25%/50% to 10%/10%/80%, as the data model changes:

<html>
    <head>
        <script type="text/javascript" src="/path/to/dojo/dojo.js"></script>
        <script>
            require([
                "dojo/Stateful", "dojox/mvc/at", "dojox/mvc/StatefulSeries",
                "dojox/charting/Chart", "dojox/charting/themes/PlotKit/blue", "dojox/charting/plot2d/Pie",
                "dojo/domReady!"
            ], function(Stateful, at, StatefulSeries, Chart, blue){
                var model = new Stateful({First: 25, Second: 25, Third: 50});
                new Chart("chart")
                 .setTheme(blue)
                 .addPlot("default", {type: "Pie"})
                 .addSeries("default", new StatefulSeries([at(model, "First"), at(model, "Second"), at(model, "Third")])).render();
                setTimeout(function(){ model.set("First", 10); model.set("Second", 10); model.set("Third", 80); }, 2000);
            });
        </script>
    </head>
    <body>
        <div id="chart"></div>
    </body>
</html>

Method Summary

Methods

destroy()
setSeriesObject(series)
Parameter Type Description
series undefined
Error in the documentation? Can’t find what you are looking for? Let us know!