bubble series chart example

jqWidgets Bubble Series Chart

by jqwidgets

HTML

<script src="http://www.jqwidgets.com/public/2.3.1/jqxcore.js"></script>
<script src="http://www.jqwidgets.com/public/2.3.1/jqxchart.js"></script>
<link rel="stylesheet" href="http://www.jqwidgets.com/public/2.3.1/styles/jqx.base.css">
<script src="http://www.jqwidgets.com/public/2.3.1/jqxdata.js"></script>
<div id='container' style="width: 700px; height: 400px;"/>

JavaScript

// jqWidgets Bubble Series Chart Example
// Copyright(c) 2012
// www.jqwidgets.com

// prepare chart data as an array
var sampleData = [
    {
    City: 'New York',
    SalesQ1: 310500,
    SalesQ2: 210500,
    YoYGrowthQ1: 1.05,
    YoYGrowthQ2: 1.25},
{
    City: 'London',
    SalesQ1: 120000,
    SalesQ2: 169000,
    YoYGrowthQ1: 1.15,
    YoYGrowthQ2: 0.95},
{
    City: 'Paris',
    SalesQ1: 205000,
    SalesQ2: 275500,
    YoYGrowthQ1: 1.45,
    YoYGrowthQ2: 1.15},
{
    City: 'Tokyo',
    SalesQ1: 187000,
    SalesQ2: 130100,
    YoYGrowthQ1: 0.45,
    YoYGrowthQ2: 0.55},
{
    City: 'Berlin',
    SalesQ1: 187000,
    SalesQ2: 113000,
    YoYGrowthQ1: 1.65,
    YoYGrowthQ2: 1.05},
{
    City: 'San Francisco',
    SalesQ1: 142000,
    SalesQ2: 102000,
    YoYGrowthQ1: 0.75,
    YoYGrowthQ2: 0.15},
{
    City: 'Chicago',
    SalesQ1: 171000,
    SalesQ2: 124000,
    YoYGrowthQ1: 0.75,
    YoYGrowthQ2: 0.65}
                  ];

// prepare jqxChart settings
var chartSettings = {
    title: "Sales by City in Q1 and Q2, and YoY sales growth",
    description: "(the size of the circles represents relative YoY growth)",
    enableAnimations: true,
    showLegend: true,
    padding: {
        left: 5,
        top: 5,
        right: 5,
        bottom: 5
    },
    titlePadding: {
        left: 90,
        top: 0,
        right: 0,
        bottom: 10
    },
    source: sampleData,
    categoryAxis: {
        dataField: 'City',
        valuesOnTicks: false
    },
    colorScheme: 'scheme04',
    seriesGroups: [
        {
        type: 'bubble',
        valueAxis: {
            valuesOnTicks: false,
            unitInterval: 50000,
            minValue: 50000,
            maxValue: 350000,
            description: 'Sales ($)',
            formatSettings: {
                prefix: '$',
                thousandsSeparator: ','
            }
        },
        series: [
            {
            dataField: 'SalesQ1',
            radiusDataField: 'YoYGrowthQ1',
           ...