Widgets > Chart Widgets > wijbubblechart > wijbubblechart Tutorial > wijbubblechart Step 2 of 3: Initializing the Widget |
In the previous step, you added markup to add the content that will appear in the bubble chart. Now you can add the jQuery script to initialize the widget as well as set the text of the X and Y axes, add a tooltip to the chart labels, add a chart header called, “Hardware Distribution”, and use the seriesList to create three data series with string data for the X-Axis and numerical data for the Y-Axis.
After the closing </div>
tags you added in the previous step, enter the following jQuery script to initialize the wijbubblechart widget:
<script type="text/javascript">
$(document).ready(function () {
$("#wijbubblechart").wijbubblechart({
minimumSize: 3,
MaximumSize: 15,
axis: {
y: {
text: "Total Hardware"
},
x: {
text: ""
}
},
hint: {
content: function () {
return 'x:' + this.x + ',y:' + this.y + ",y1:" + this.data.y1;
}
},
header: {
text: "Hardware Distribution"
},
seriesList: [{
label: "West",
legendEntry: true,
data: { x: [5, 14, 20, 18, 22], y: [5500, 12200, 60000, 24400, 32000], y1: [3, 12, 33, 10, 42] }
// markers: {
// type: 'tri'
// }
}]
});
});
</script>