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 data = [{ Income: 7931, LifeExpectancy: 73, Population: 1340 }, { Income: 2972, LifeExpectancy: 65, Population: 1150 }, { Income: 42066, LifeExpectancy: 78, Population: 309 }, { Income: 30866, LifeExpectancy: 83, Population: 126 }, { Income: 14318, LifeExpectancy: 69, Population: 140 }, { Income: 374, LifeExpectancy: 48, Population: 72 }, { Income: 9284, LifeExpectancy: 52, Population: 43 }, { Income: 11754, LifeExpectancy: 77, Population: 112 }, { Income: 31217, LifeExpectancy: 80, Population: 61 }]; require(["wijmo.wijbubblechart"], function () { $(document).ready(function () { $("#wijbubblechart").wijbubblechart({ dataSource: data, legend: {visible: false}, seriesList: [{ data: { x: {bind: "Income"}, y: {bind: "LifeExpectancy"}, y1: {bind: "Population"} } },{ isTrendline: true, order: 4, label: "Trend", data: { x: {bind: "Income"}, y: {bind: "LifeExpectancy"}, } } ] }); }); }); </script> |