Building on the Quick Start example, you can use a more complex array of data objects, and specify the data field using the seriesList option's bind attribute.
Script |
Copy Code |
---|---|
<script id="scriptInit" type="text/javascript"> require(["wijmo.wijsparkline"], function () { $(document).ready(function () { var data = [{ name: "Januray", score: 73 }, { name: "February", score: 95 }, { name: "March", score: 89 }, { name: "April", score: 66 }, { name: "May", score: 50 }, { name: "June", score: 65 }, { name: "July", score: 70 }, { name: "August", score: 43 }, { name: "September", score: 65 }, { name: "October", score: 27 }, { name: "November", score: 77 }, { name: "December", score: 58 }]; $("#wijsparkline").wijsparkline({ data: data, seriesList: [{ bind: "score" }] }); }); }); </script> |