Bubble chart
Integration with Highcharts
by Ravi A
HTML
<link rel="stylesheet" href="https://s3.amazonaws.com/flexmonster/2.3/demo.css">
<script src="https://cdn.flexmonster.com/flexmonster.js"></script>
<script src="https://cdn.flexmonster.com/lib/flexmonster.highcharts.js"></script>
<script src="https://code.highcharts.com/highcharts.js"></script>
<script src="https://code.highcharts.com/highcharts-more.js"></script>
<div id="pivot-container"></div>
<br/>
<div id="highcharts-container"></div>
JavaScript
var pivot = new Flexmonster({
container: "#pivot-container",
componentFolder: "https://cdn.flexmonster.com/",
toolbar: false,
report: {
dataSource: {
dataSourceType: "json",
data: getData1()
},
slice: {
rows: [{
uniqueName: "State"
}],
columns: [{
uniqueName: "[Measures]"
}],
measures: [{
uniqueName: "Net Sales ($)"
}, {
uniqueName: "Check Count"
}, {
uniqueName: "Gross Sales ($)"
}]
},
options: {
viewType: "grid",
configuratorActive: false
}
},
height: 300,
reportcomplete: function() {
pivot.off("reportcomplete");
bubbleChart();
}
});
function bubbleChart() {
pivot.highcharts.getData({
type: "bubble"
},
function(data) {
Highcharts.chart('highcharts-container', data);
},
function(data) {
Highcharts.chart('highcharts-container', data);
}
);
}
function getData1(){
return [
{
"City": {
"type": "string"
},
"State": {
"type": "string"
},
"Net Sales ($)": {
"type": "number"
},
"Check Count": {
"type": "number"
},
"Gross Sales ($)": {
"type": "number"
}
},
{
"City": "Los Angeles",
"State": "CA",
"Net Sales ($)": 9385906.82999723,
"Check Count": 585526,
"Gross Sales ($)": 10197739.2999964
},
{
"City": "Seattle",
"State": "WA",
"Net Sales ($)": 4727230.80000096,
"Check Count": 269100,
"Gross Sales ($)": 4968690.90000104
},
{
"City": "San Jose",
...