Building on the Quick Start example, you can add a trend line to your chart using attributes of the seriesList option.
Script |
Copy Code |
---|---|
<script id="scriptInit" type="text/javascript"> var data1 = [{ type: "Desktops", west: 5, central: 2, east: 3, Steam1: 3 }, { type: "Notebooks", west: 3, central: 2, east: 4, Steam1: 6 }, { type: "Tablets", west: 7, central: 2, east: 2, Steam1: 9 }, { type: "Phones", west: 2, central: 1, east: 5, Steam1: 5 }], pieData = [{ label: "MacBook Pro", legendEntry: true, data: 46.78, offset: 15 }, { label: "iMac", legendEntry: true, data: 23.18, offset: 0 }, { label: "MacBook", legendEntry: true, data: 20.25, offset: 0 }]; require(["wijmo.wijcompositechart"], function () { $(document).ready(function () { $("#wijcompositechart").wijcompositechart({ dataSource: data1, data: {x: {bind: "type"}}, seriesList: [{ type: "column", label: "West", data: { y: {bind: "west"} } },{ type: "pie", center: {x: 70, y: 70}, radius: 30, dataSource: pieData, data: { label: {bind: "label"}, value: {bind: "data"}, offset: {bind: "offset"} } },{ type: "line", label: "Steam1", data: { y: {bind: "Steam1"} } },{ isTrendline: true, label: "Trendline for West", order: 4, data: { y: {bind: "west"} } } ] }); }); }); </script> |