Skip to content

Instantly share code, notes, and snippets.

@davidbjourno
Last active August 29, 2015 14:25
Show Gist options
  • Save davidbjourno/92095af3247f62b1e363 to your computer and use it in GitHub Desktop.
Save davidbjourno/92095af3247f62b1e363 to your computer and use it in GitHub Desktop.
Bubble chart with five-dimensional key-bound data

Bubble chart with five-dimensional key-bound data.

Dimensions

  1. Fiscal quarter (transition state)
  2. Standard Industrial Classification (x-axis)
  3. Political party (bubble colour)
  4. Amount of donation (bubble size)
  5. Change on previous quarter (y-axis)
[
{
"key":0,
"sicCode":28922,
"sicText":"Manufacture of earthmoving equipment",
"sicSection":"Manufacturing",
"party":"Conservative Party",
"qAmounts":[750000,50000,50000,215000,27500,8500,0,70000,60000,8500,50000,87500,32500,61500,23367,180000,255400,297780,346501,359852,140000],
"qChangesPc":[260.6,-93.3,0,330,-87.2,-69.1,-100,0,-14.3,-85.8,488.2,75,-62.9,89.2,-62,670.3,41.9,16.6,16.4,3.9,-61.1],
"qChangesLog":[2.42,-1.97,0,2.52,-1.94,-1.84,-2,0,-1.16,-1.93,2.69,1.88,-1.8,1.95,-1.79,2.83,1.62,1.22,1.21,0.59,-1.79]
},
{
"key":1,
"sicCode":28922,
"sicText":"Manufacture of earthmoving equipment",
"sicSection":"Manufacturing",
"party":"Green Party",
"qAmounts":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],
"qChangesPc":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],
"qChangesLog":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]
},
{
"key":2,
"sicCode":28922,
"sicText":"Manufacture of earthmoving equipment",
"sicSection":"Manufacturing",
"party":"Labour Party",
"qAmounts":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],
"qChangesPc":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],
"qChangesLog":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]
},
{
"key":3,
"sicCode":28922,
"sicText":"Manufacture of earthmoving equipment",
"sicSection":"Manufacturing",
"party":"Liberal Democrats",
"qAmounts":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],
"qChangesPc":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],
"qChangesLog":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]
},
{
"key":4,
"sicCode":28922,
"sicText":"Manufacture of earthmoving equipment",
"sicSection":"Manufacturing",
"party":"SNP",
"qAmounts":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],
"qChangesPc":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],
"qChangesLog":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]
},
{
"key":5,
"sicCode":28922,
"sicText":"Manufacture of earthmoving equipment",
"sicSection":"Manufacturing",
"party":"UKIP",
"qAmounts":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],
"qChangesPc":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],
"qChangesLog":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]
},
{
"key":6,
"sicCode":41100,
"sicText":"Development of building projects",
"sicSection":"Construction",
"party":"Conservative Party",
"qAmounts":[0,5000,6800,96000,5000,65000,15000,115500,65000,11500,31500,64000,27270,33500,65900,119100,45785,87838,41762,138467,28584],
"qChangesPc":[-100,0,36,1311.8,-94.8,1200,-76.9,670,-43.7,-82.3,173.9,103.2,-57.4,22.8,96.7,80.7,-61.6,91.9,-52.5,231.6,-79.4],
"qChangesLog":[-2,0,1.56,3.12,-1.98,3.08,-1.89,2.83,-1.64,-1.92,2.24,2.01,-1.76,1.36,1.99,1.91,-1.79,1.96,-1.72,2.36,-1.9]
},
{
"key":7,
"sicCode":41100,
"sicText":"Development of building projects",
"sicSection":"Construction",
"party":"Green Party",
"qAmounts":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],
"qChangesPc":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],
"qChangesLog":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]
},
{
"key":8,
"sicCode":41100,
"sicText":"Development of building projects",
"sicSection":"Construction",
"party":"Labour Party",
"qAmounts":[0,0,0,0,2000,0,2720,0,50000,0,0,0,0,0,8220,0,5300,3760,5610,4800,0],
"qChangesPc":[0,0,0,0,0,-100,0,-100,0,-100,0,0,0,0,0,-100,0,-29.1,49.2,-14.4,-100],
"qChangesLog":[0,0,0,0,0,-2,0,-2,0,-2,0,0,0,0,0,-2,0,-1.46,1.69,-1.16,-2]
},
{
"key":9,
"sicCode":41100,
"sicText":"Development of building projects",
"sicSection":"Construction",
"party":"Liberal Democrats",
"qAmounts":[0,0,0,2000,0,0,0,15000,0,0,7000,5000,4300,0,0,10000,0,0,16300,0,0],
"qChangesPc":[-100,0,0,0,-100,0,0,0,-100,0,0,-28.6,-14,-100,0,0,-100,0,0,-100,0],
"qChangesLog":[-2,0,0,0,-2,0,0,0,-2,0,0,-1.46,-1.15,-2,0,0,-2,0,0,-2,0]
},
{
"key":10,
"sicCode":41100,
"sicText":"Development of building projects",
"sicSection":"Construction",
"party":"SNP",
"qAmounts":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],
"qChangesPc":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],
"qChangesLog":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]
},
{
"key":11,
"sicCode":41100,
"sicText":"Development of building projects",
"sicSection":"Construction",
"party":"UKIP",
"qAmounts":[0,0,0,2500,0,5000,1800,0,0,35000,0,0,0,0,0,0,12500,0,5000,12500,0],
"qChangesPc":[0,0,0,0,-100,0,-64,-100,0,0,-100,0,0,0,0,0,0,-100,0,150,-100],
"qChangesLog":[0,0,0,0,-2,0,-1.81,-2,0,0,-2,0,0,0,0,0,0,-2,0,2.18,-2]
},
{
"key":12,
"sicCode":46390,
"sicText":"Non-specialised wholesale of food, beverages and tobacco",
"sicSection":"Wholesale and retail trade",
"party":"Conservative Party",
"qAmounts":[0,0,4000,50000,7000,0,9000,61950,10000,5000,0,69000,0,7500,10000,72500,10000,7500,8000,101900,0],
"qChangesPc":[-100,0,0,1150,-86,-100,0,588.3,-83.9,-50,-100,0,-100,0,33.3,625,-86.2,-25,6.7,1173.8,-100],
"qChangesLog":[-2,0,0,3.06,-1.93,-2,0,2.77,-1.92,-1.7,-2,0,-2,0,1.52,2.8,-1.94,-1.4,0.83,3.07,-2]
},
{
"key":13,
"sicCode":46390,
"sicText":"Non-specialised wholesale of food, beverages and tobacco",
"sicSection":"Wholesale and retail trade",
"party":"Green Party",
"qAmounts":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],
"qChangesPc":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],
"qChangesLog":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]
},
{
"key":14,
"sicCode":46390,
"sicText":"Non-specialised wholesale of food, beverages and tobacco",
"sicSection":"Wholesale and retail trade",
"party":"Labour Party",
"qAmounts":[0,0,0,0,10000,0,10000,0,25000,8900,10750,8900,8900,11866,9583,8900,8900,8900,2967,12800,0],
"qChangesPc":[0,0,0,0,0,-100,0,-100,0,-64.4,20.8,-17.2,0,33.3,-19.2,-7.1,0,0,-66.7,331.5,-100],
"qChangesLog":[0,0,0,0,0,-2,0,-2,0,-1.81,1.32,-1.24,0,1.52,-1.28,-0.85,0,0,-1.82,2.52,-2]
},
{
"key":15,
"sicCode":46390,
"sicText":"Non-specialised wholesale of food, beverages and tobacco",
"sicSection":"Wholesale and retail trade",
"party":"Liberal Democrats",
"qAmounts":[0,0,0,0,0,0,5000,0,0,0,0,0,0,0,0,0,0,0,0,0,0],
"qChangesPc":[0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0],
"qChangesLog":[0,0,0,0,0,0,0,-2,0,0,0,0,0,0,0,0,0,0,0,0,0]
},
{
"key":16,
"sicCode":46390,
"sicText":"Non-specialised wholesale of food, beverages and tobacco",
"sicSection":"Wholesale and retail trade",
"party":"SNP",
"qAmounts":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],
"qChangesPc":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],
"qChangesLog":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]
},
{
"key":17,
"sicCode":46390,
"sicText":"Non-specialised wholesale of food, beverages and tobacco",
"sicSection":"Wholesale and retail trade",
"party":"UKIP",
"qAmounts":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],
"qChangesPc":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],
"qChangesLog":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]
},
{
"key":18,
"sicCode":46460,
"sicText":"Wholesale of pharmaceutical goods",
"sicSection":"Wholesale and retail trade",
"party":"Conservative Party",
"qAmounts":[0,0,0,0,0,0,50000,25000,100000,0,0,0,0,0,0,0,0,0,0,0,0],
"qChangesPc":[0,0,0,0,0,0,0,-50,300,-100,0,0,0,0,0,0,0,0,0,0,0],
"qChangesLog":[0,0,0,0,0,0,0,-1.7,2.48,-2,0,0,0,0,0,0,0,0,0,0,0]
},
{
"key":19,
"sicCode":46460,
"sicText":"Wholesale of pharmaceutical goods",
"sicSection":"Wholesale and retail trade",
"party":"Green Party",
"qAmounts":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],
"qChangesPc":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],
"qChangesLog":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]
},
{
"key":20,
"sicCode":46460,
"sicText":"Wholesale of pharmaceutical goods",
"sicSection":"Wholesale and retail trade",
"party":"Labour Party",
"qAmounts":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2000,0],
"qChangesPc":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100],
"qChangesLog":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-2]
},
{
"key":21,
"sicCode":46460,
"sicText":"Wholesale of pharmaceutical goods",
"sicSection":"Wholesale and retail trade",
"party":"Liberal Democrats",
"qAmounts":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,82574,121733,121183,117675,115947,107751,0],
"qChangesPc":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,47.4,-0.5,-2.9,-1.5,-7.1,-100],
"qChangesLog":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1.68,0.3,-0.46,-0.18,-0.85,-2]
},
{
"key":22,
"sicCode":46460,
"sicText":"Wholesale of pharmaceutical goods",
"sicSection":"Wholesale and retail trade",
"party":"SNP",
"qAmounts":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],
"qChangesPc":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],
"qChangesLog":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]
},
{
"key":23,
"sicCode":46460,
"sicText":"Wholesale of pharmaceutical goods",
"sicSection":"Wholesale and retail trade",
"party":"UKIP",
"qAmounts":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],
"qChangesPc":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],
"qChangesLog":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]
},
{
"key":24,
"sicCode":61900,
"sicText":"Other telecommunications activities",
"sicSection":"Information and communication",
"party":"Conservative Party",
"qAmounts":[0,0,0,0,0,40000,136180,131612,0,17100,110000,0,0,8600,0,105020,15000,26000,255250,371800,124450],
"qChangesPc":[0,0,0,0,0,0,240.5,-3.4,-100,0,543.3,-100,0,0,-100,0,-85.7,73.3,881.7,45.7,-66.5],
"qChangesLog":[0,0,0,0,0,0,2.38,-0.53,-2,0,2.74,-2,0,0,-2,0,-1.93,1.87,2.95,1.66,-1.82]
},
{
"key":25,
"sicCode":61900,
"sicText":"Other telecommunications activities",
"sicSection":"Information and communication",
"party":"Green Party",
"qAmounts":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],
"qChangesPc":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],
"qChangesLog":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]
},
{
"key":26,
"sicCode":61900,
"sicText":"Other telecommunications activities",
"sicSection":"Information and communication",
"party":"Labour Party",
"qAmounts":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],
"qChangesPc":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],
"qChangesLog":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]
},
{
"key":27,
"sicCode":61900,
"sicText":"Other telecommunications activities",
"sicSection":"Information and communication",
"party":"Liberal Democrats",
"qAmounts":[0,0,0,0,0,0,0,0,0,10000,0,0,0,0,0,0,0,0,0,0,0],
"qChangesPc":[0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0],
"qChangesLog":[0,0,0,0,0,0,0,0,0,0,-2,0,0,0,0,0,0,0,0,0,0]
},
{
"key":28,
"sicCode":61900,
"sicText":"Other telecommunications activities",
"sicSection":"Information and communication",
"party":"SNP",
"qAmounts":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],
"qChangesPc":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],
"qChangesLog":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]
},
{
"key":29,
"sicCode":61900,
"sicText":"Other telecommunications activities",
"sicSection":"Information and communication",
"party":"UKIP",
"qAmounts":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],
"qChangesPc":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],
"qChangesLog":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]
},
{
"key":30,
"sicCode":64209,
"sicText":"Activities of other holding companies (NEC)",
"sicSection":"Financial and insurance activities",
"party":"Conservative Party",
"qAmounts":[36267,23450,54900,92000,15000,13000,950,82723,49248,22500,18947,76171,15000,27600,15727,56623,20000,35000,60500,95000,10000],
"qChangesPc":[-89,-35.3,134.1,67.6,-83.7,-13.3,-92.7,8607.7,-40.5,-54.3,-15.8,302,-80.3,84,-43,260,-64.7,75,72.9,57,-89.5],
"qChangesLog":[-1.95,-1.55,2.13,1.83,-1.92,-1.12,-1.97,3.93,-1.61,-1.73,-1.2,2.48,-1.9,1.92,-1.63,2.41,-1.81,1.88,1.86,1.76,-1.95]
},
{
"key":31,
"sicCode":64209,
"sicText":"Activities of other holding companies (NEC)",
"sicSection":"Financial and insurance activities",
"party":"Green Party",
"qAmounts":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],
"qChangesPc":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],
"qChangesLog":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]
},
{
"key":32,
"sicCode":64209,
"sicText":"Activities of other holding companies (NEC)",
"sicSection":"Financial and insurance activities",
"party":"Labour Party",
"qAmounts":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4000,0,0,0],
"qChangesPc":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0],
"qChangesLog":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-2,0,0]
},
{
"key":33,
"sicCode":64209,
"sicText":"Activities of other holding companies (NEC)",
"sicSection":"Financial and insurance activities",
"party":"Liberal Democrats",
"qAmounts":[0,0,0,0,0,0,0,0,0,0,0,0,10000,0,0,0,0,0,0,0,0],
"qChangesPc":[0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,0,0],
"qChangesLog":[0,0,0,0,0,0,0,0,0,0,0,0,0,-2,0,0,0,0,0,0,0]
},
{
"key":34,
"sicCode":64209,
"sicText":"Activities of other holding companies (NEC)",
"sicSection":"Financial and insurance activities",
"party":"SNP",
"qAmounts":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],
"qChangesPc":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],
"qChangesLog":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]
},
{
"key":35,
"sicCode":64209,
"sicText":"Activities of other holding companies (NEC)",
"sicSection":"Financial and insurance activities",
"party":"UKIP",
"qAmounts":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],
"qChangesPc":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],
"qChangesLog":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]
},
{
"key":36,
"sicCode":64999,
"sicText":"Financial intermediation (NEC)",
"sicSection":"Financial and insurance activities",
"party":"Conservative Party",
"qAmounts":[133500,18800,25000,10843,150000,10800,41000,12500,57450,116810,24000,0,50000,13760,10600,17500,1580,13476,20500,49900,10000],
"qChangesPc":[0.4,-85.9,33,-56.6,1283.4,-92.8,279.6,-69.5,359.6,103.3,-79.5,-100,0,-72.5,-23,65.1,-91,752.9,52.1,143.4,-80],
"qChangesLog":[-0.4,-1.93,1.52,-1.75,3.11,-1.97,2.45,-1.84,2.56,2.01,-1.9,-2,0,-1.86,-1.36,1.81,-1.96,2.88,1.72,2.16,-1.9]
},
{
"key":37,
"sicCode":64999,
"sicText":"Financial intermediation (NEC)",
"sicSection":"Financial and insurance activities",
"party":"Green Party",
"qAmounts":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],
"qChangesPc":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],
"qChangesLog":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]
},
{
"key":38,
"sicCode":64999,
"sicText":"Financial intermediation (NEC)",
"sicSection":"Financial and insurance activities",
"party":"Labour Party",
"qAmounts":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],
"qChangesPc":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],
"qChangesLog":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]
},
{
"key":39,
"sicCode":64999,
"sicText":"Financial intermediation (NEC)",
"sicSection":"Financial and insurance activities",
"party":"Liberal Democrats",
"qAmounts":[12000,2000,0,0,0,0,3500,0,0,0,0,0,0,0,0,0,0,0,7603,18000,0],
"qChangesPc":[0,-83.3,-100,0,0,0,0,-100,0,0,0,0,0,0,0,0,0,0,0,136.8,-100],
"qChangesLog":[0,-1.92,-2,0,0,0,0,-2,0,0,0,0,0,0,0,0,0,0,0,2.14,-2]
},
{
"key":40,
"sicCode":64999,
"sicText":"Financial intermediation (NEC)",
"sicSection":"Financial and insurance activities",
"party":"SNP",
"qAmounts":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],
"qChangesPc":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],
"qChangesLog":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]
},
{
"key":41,
"sicCode":64999,
"sicText":"Financial intermediation (NEC)",
"sicSection":"Financial and insurance activities",
"party":"UKIP",
"qAmounts":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],
"qChangesPc":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],
"qChangesLog":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]
},
{
"key":42,
"sicCode":66120,
"sicText":"Security and commodity contracts dealing activities",
"sicSection":"Financial and insurance activities",
"party":"Conservative Party",
"qAmounts":[0,0,0,0,0,0,69200,0,0,0,0,0,50000,72500,0,0,0,50000,0,0,0],
"qChangesPc":[0,0,0,0,0,0,0,-100,0,0,0,0,0,45,-100,0,0,0,-100,0,0],
"qChangesLog":[0,0,0,0,0,0,0,-2,0,0,0,0,0,1.65,-2,0,0,0,-2,0,0]
},
{
"key":43,
"sicCode":66120,
"sicText":"Security and commodity contracts dealing activities",
"sicSection":"Financial and insurance activities",
"party":"Green Party",
"qAmounts":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],
"qChangesPc":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],
"qChangesLog":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]
},
{
"key":44,
"sicCode":66120,
"sicText":"Security and commodity contracts dealing activities",
"sicSection":"Financial and insurance activities",
"party":"Labour Party",
"qAmounts":[0,0,0,0,18500,0,60000,0,0,67000,0,15000,0,60000,0,0,0,60000,0,0,0],
"qChangesPc":[0,0,0,0,0,-100,0,-100,0,0,-100,0,-100,0,-100,0,0,0,-100,0,0],
"qChangesLog":[0,0,0,0,0,-2,0,-2,0,0,-2,0,-2,0,-2,0,0,0,-2,0,0]
},
{
"key":45,
"sicCode":66120,
"sicText":"Security and commodity contracts dealing activities",
"sicSection":"Financial and insurance activities",
"party":"Liberal Democrats",
"qAmounts":[0,25000,0,0,0,53500,0,0,0,50000,0,0,0,50000,0,0,0,60000,0,0,0],
"qChangesPc":[0,0,-100,0,0,0,-100,0,0,0,-100,0,0,0,-100,0,0,0,-100,0,0],
"qChangesLog":[0,0,-2,0,0,0,-2,0,0,0,-2,0,0,0,-2,0,0,0,-2,0,0]
},
{
"key":46,
"sicCode":66120,
"sicText":"Security and commodity contracts dealing activities",
"sicSection":"Financial and insurance activities",
"party":"SNP",
"qAmounts":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],
"qChangesPc":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],
"qChangesLog":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]
},
{
"key":47,
"sicCode":66120,
"sicText":"Security and commodity contracts dealing activities",
"sicSection":"Financial and insurance activities",
"party":"UKIP",
"qAmounts":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,20000,0,0,0,0,0,0],
"qChangesPc":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0],
"qChangesLog":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-2,0,0,0,0,0]
},
{
"key":48,
"sicCode":66220,
"sicText":"Activities of insurance agents and brokers",
"sicSection":"Financial and insurance activities",
"party":"Conservative Party",
"qAmounts":[0,0,0,30000,15000,9000,0,25000,15000,8500,22500,28462,0,13500,7500,83100,9017,0,0,305000,20000],
"qChangesPc":[-100,0,0,0,-50,-40,-100,0,-40,-43.3,164.7,26.5,-100,0,-44.4,1008,-89.1,-100,0,0,-93.4],
"qChangesLog":[-2,0,0,0,-1.7,-1.6,-2,0,-1.6,-1.64,2.22,1.42,-2,0,-1.65,3,-1.95,-2,0,0,-1.97]
},
{
"key":49,
"sicCode":66220,
"sicText":"Activities of insurance agents and brokers",
"sicSection":"Financial and insurance activities",
"party":"Green Party",
"qAmounts":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],
"qChangesPc":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],
"qChangesLog":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]
},
{
"key":50,
"sicCode":66220,
"sicText":"Activities of insurance agents and brokers",
"sicSection":"Financial and insurance activities",
"party":"Labour Party",
"qAmounts":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],
"qChangesPc":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],
"qChangesLog":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]
},
{
"key":51,
"sicCode":66220,
"sicText":"Activities of insurance agents and brokers",
"sicSection":"Financial and insurance activities",
"party":"Liberal Democrats",
"qAmounts":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],
"qChangesPc":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],
"qChangesLog":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]
},
{
"key":52,
"sicCode":66220,
"sicText":"Activities of insurance agents and brokers",
"sicSection":"Financial and insurance activities",
"party":"SNP",
"qAmounts":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],
"qChangesPc":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],
"qChangesLog":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]
},
{
"key":53,
"sicCode":66220,
"sicText":"Activities of insurance agents and brokers",
"sicSection":"Financial and insurance activities",
"party":"UKIP",
"qAmounts":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],
"qChangesPc":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],
"qChangesLog":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]
},
{
"key":54,
"sicCode":68100,
"sicText":"Buying and selling of own real estate",
"sicSection":"Real estate activities",
"party":"Conservative Party",
"qAmounts":[17500,23119,4909,0,16750,33000,44000,5000,35000,0,0,22883,25000,34600,18600,95000,97600,108250,115500,189599,150841],
"qChangesPc":[-77.3,32.1,-78.8,-100,0,97,33.3,-88.6,600,-100,0,0,9.3,38.4,-46.2,410.8,2.7,10.9,6.7,64.2,-20.4],
"qChangesLog":[-1.89,1.51,-1.9,-2,0,1.99,1.52,-1.95,2.78,-2,0,0,0.97,1.58,-1.66,2.61,0.43,1.04,0.83,1.81,-1.31]
},
{
"key":55,
"sicCode":68100,
"sicText":"Buying and selling of own real estate",
"sicSection":"Real estate activities",
"party":"Green Party",
"qAmounts":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],
"qChangesPc":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],
"qChangesLog":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]
},
{
"key":56,
"sicCode":68100,
"sicText":"Buying and selling of own real estate",
"sicSection":"Real estate activities",
"party":"Labour Party",
"qAmounts":[0,0,0,2000,2515,0,0,0,0,0,0,5700,0,0,0,0,0,0,0,0,0],
"qChangesPc":[-100,0,0,0,25.8,-100,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0],
"qChangesLog":[-2,0,0,0,1.41,-2,0,0,0,0,0,0,-2,0,0,0,0,0,0,0,0]
},
{
"key":57,
"sicCode":68100,
"sicText":"Buying and selling of own real estate",
"sicSection":"Real estate activities",
"party":"Liberal Democrats",
"qAmounts":[258500,0,0,0,250000,7000,27000,0,250000,0,0,70000,0,0,277326,0,5850,292400,287000,5000,200000],
"qChangesPc":[0,-100,0,0,0,-97.2,285.7,-100,0,-100,0,0,-100,0,0,-100,0,4898.3,-1.8,-98.3,3900],
"qChangesLog":[0,-2,0,0,0,-1.99,2.46,-2,0,-2,0,0,-2,0,0,-2,0,3.69,-0.26,-1.99,3.59]
},
{
"key":58,
"sicCode":68100,
"sicText":"Buying and selling of own real estate",
"sicSection":"Real estate activities",
"party":"SNP",
"qAmounts":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],
"qChangesPc":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],
"qChangesLog":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]
},
{
"key":59,
"sicCode":68100,
"sicText":"Buying and selling of own real estate",
"sicSection":"Real estate activities",
"party":"UKIP",
"qAmounts":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,17500,0,0,0,0],
"qChangesPc":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0],
"qChangesLog":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-2,0,0,0]
},
{
"key":60,
"sicCode":68209,
"sicText":"Other letting and operating of own or leased real estate",
"sicSection":"Real estate activities",
"party":"Conservative Party",
"qAmounts":[17500,40500,12000,99693,129571,22875,15875,81875,79975,40875,53225,89375,60875,48875,82975,98375,95875,32500,96500,229950,60000],
"qChangesPc":[-85.1,131.4,-70.4,730.8,30,-82.3,-30.6,415.7,-2.3,-48.9,30.2,67.9,-31.9,-19.7,69.8,18.6,-2.5,-66.1,196.9,138.3,-73.9],
"qChangesLog":[-1.93,2.12,-1.85,2.86,1.48,-1.92,-1.49,2.62,-0.36,-1.69,1.48,1.83,-1.5,-1.29,1.84,1.27,-0.4,-1.82,2.29,2.14,-1.87]
},
{
"key":61,
"sicCode":68209,
"sicText":"Other letting and operating of own or leased real estate",
"sicSection":"Real estate activities",
"party":"Green Party",
"qAmounts":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],
"qChangesPc":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],
"qChangesLog":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]
},
{
"key":62,
"sicCode":68209,
"sicText":"Other letting and operating of own or leased real estate",
"sicSection":"Real estate activities",
"party":"Labour Party",
"qAmounts":[2225,0,0,2243,2500,0,0,0,0,0,0,0,0,0,4300,0,3500,3000,20455,118316,0],
"qChangesPc":[39.1,-100,0,0,11.5,-100,0,0,0,0,0,0,0,0,0,-100,0,-14.3,581.8,478.4,-100],
"qChangesLog":[1.59,-2,0,0,1.06,-2,0,0,0,0,0,0,0,0,0,-2,0,-1.16,2.76,2.68,-2]
},
{
"key":63,
"sicCode":68209,
"sicText":"Other letting and operating of own or leased real estate",
"sicSection":"Real estate activities",
"party":"Liberal Democrats",
"qAmounts":[4077,0,0,8317,7317,8817,2317,4317,2303,2317,7303,2394,7394,6395,6395,2000,13239,11845,16395,14895,10000],
"qChangesPc":[0,-100,0,0,-12,20.5,-73.7,86.3,-46.6,0.6,215.2,-67.2,208.8,-13.5,0,-68.7,562,-10.5,38.4,-9.1,-32.9],
"qChangesLog":[0,-2,0,0,-1.08,1.31,-1.87,1.94,-1.67,-0.22,2.33,-1.83,2.32,-1.13,0,-1.84,2.75,-1.02,1.58,-0.96,-1.52]
},
{
"key":64,
"sicCode":68209,
"sicText":"Other letting and operating of own or leased real estate",
"sicSection":"Real estate activities",
"party":"SNP",
"qAmounts":[0,1547,6000,3000,2000,0,0,0,0,0,2080,0,0,0,2080,0,0,0,2080,0,0],
"qChangesPc":[0,0,287.9,-50,-33.3,-100,0,0,0,0,0,-100,0,0,0,-100,0,0,0,-100,0],
"qChangesLog":[0,0,2.46,-1.7,-1.52,-2,0,0,0,0,0,-2,0,0,0,-2,0,0,0,-2,0]
},
{
"key":65,
"sicCode":68209,
"sicText":"Other letting and operating of own or leased real estate",
"sicSection":"Real estate activities",
"party":"UKIP",
"qAmounts":[0,0,0,0,0,0,0,0,0,0,0,32500,3400,6500,42320,4200,45770,17650,87700,42178,7896],
"qChangesPc":[0,0,0,0,0,0,0,0,0,0,0,0,-89.5,91.2,551.1,-90.1,989.8,-61.4,396.9,-51.9,-81.3],
"qChangesLog":[0,0,0,0,0,0,0,0,0,0,0,0,-1.95,1.96,2.74,-1.95,3,-1.79,2.6,-1.72,-1.91]
},
{
"key":66,
"sicCode":68320,
"sicText":"Management of real estate on a fee or contract basis",
"sicSection":"Real estate activities",
"party":"Conservative Party",
"qAmounts":[0,0,0,1851,0,50000,0,0,0,26930,8600,0,50000,12000,0,10000,110000,10000,46700,230400,110000],
"qChangesPc":[-100,0,0,0,-100,0,-100,0,0,0,-68.1,-100,0,-76,-100,0,1000,-90.9,367,393.4,-52.3],
"qChangesLog":[-2,0,0,0,-2,0,-2,0,0,0,-1.83,-2,0,-1.88,-2,0,3,-1.96,2.56,2.59,-1.72]
},
{
"key":67,
"sicCode":68320,
"sicText":"Management of real estate on a fee or contract basis",
"sicSection":"Real estate activities",
"party":"Green Party",
"qAmounts":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],
"qChangesPc":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],
"qChangesLog":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]
},
{
"key":68,
"sicCode":68320,
"sicText":"Management of real estate on a fee or contract basis",
"sicSection":"Real estate activities",
"party":"Labour Party",
"qAmounts":[0,0,0,5000,0,0,0,0,0,0,2000,0,0,0,0,0,0,0,0,0,0],
"qChangesPc":[0,0,0,0,-100,0,0,0,0,0,0,-100,0,0,0,0,0,0,0,0,0],
"qChangesLog":[0,0,0,0,-2,0,0,0,0,0,0,-2,0,0,0,0,0,0,0,0,0]
},
{
"key":69,
"sicCode":68320,
"sicText":"Management of real estate on a fee or contract basis",
"sicSection":"Real estate activities",
"party":"Liberal Democrats",
"qAmounts":[0,0,0,2500,0,0,0,2640,1760,0,0,0,0,4950,0,0,0,3600,0,0,0],
"qChangesPc":[0,0,0,0,-100,0,0,0,-33.3,-100,0,0,0,0,-100,0,0,0,-100,0,0],
"qChangesLog":[0,0,0,0,-2,0,0,0,-1.52,-2,0,0,0,0,-2,0,0,0,-2,0,0]
},
{
"key":70,
"sicCode":68320,
"sicText":"Management of real estate on a fee or contract basis",
"sicSection":"Real estate activities",
"party":"SNP",
"qAmounts":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,50000,0],
"qChangesPc":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100],
"qChangesLog":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-2]
},
{
"key":71,
"sicCode":68320,
"sicText":"Management of real estate on a fee or contract basis",
"sicSection":"Real estate activities",
"party":"UKIP",
"qAmounts":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],
"qChangesPc":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],
"qChangesLog":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]
},
{
"key":72,
"sicCode":70100,
"sicText":"Activities of head offices",
"sicSection":"Professional, scientific and technical activities",
"party":"Conservative Party",
"qAmounts":[93343,97515,222848,57636,219510,78560,191260,132410,107410,39175,83234,30410,280960,50720,9625,18450,157825,60850,154900,400075,10000],
"qChangesPc":[-86.5,4.5,128.5,-74.1,280.9,-64.2,143.5,-30.8,-18.9,-63.5,112.5,-63.5,823.9,-81.9,-81,91.7,755.4,-61.4,154.6,158.3,-97.5],
"qChangesLog":[-1.94,0.65,2.11,-1.87,2.45,-1.81,2.16,-1.49,-1.28,-1.8,2.05,-1.8,2.92,-1.91,-1.91,1.96,2.88,-1.79,2.19,2.2,-1.99]
},
{
"key":73,
"sicCode":70100,
"sicText":"Activities of head offices",
"sicSection":"Professional, scientific and technical activities",
"party":"Green Party",
"qAmounts":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,20000,0,0,0,0,0,0],
"qChangesPc":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0],
"qChangesLog":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-2,0,0,0,0,0]
},
{
"key":74,
"sicCode":70100,
"sicText":"Activities of head offices",
"sicSection":"Professional, scientific and technical activities",
"party":"Labour Party",
"qAmounts":[0,0,8225,2938,0,8730,8400,0,0,0,8400,5000,0,8400,0,0,110000,0,8400,208000,300000],
"qChangesPc":[0,0,0,-64.3,-100,0,-3.8,-100,0,0,0,-40.5,-100,0,-100,0,0,-100,0,2376.2,44.2],
"qChangesLog":[0,0,0,-1.81,-2,0,-0.58,-2,0,0,0,-1.61,-2,0,-2,0,0,-2,0,3.38,1.65]
},
{
"key":75,
"sicCode":70100,
"sicText":"Activities of head offices",
"sicSection":"Professional, scientific and technical activities",
"party":"Liberal Democrats",
"qAmounts":[0,0,120000,0,200000,0,0,0,0,0,0,0,30000,9993,32500,0,10000,52000,7450,55000,30000],
"qChangesPc":[0,0,0,-100,0,-100,0,0,0,0,0,0,0,-66.7,225.2,-100,0,420,-85.7,638.3,-45.5],
"qChangesLog":[0,0,0,-2,0,-2,0,0,0,0,0,0,0,-1.82,2.35,-2,0,2.62,-1.93,2.81,-1.66]
},
{
"key":76,
"sicCode":70100,
"sicText":"Activities of head offices",
"sicSection":"Professional, scientific and technical activities",
"party":"SNP",
"qAmounts":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],
"qChangesPc":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],
"qChangesLog":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]
},
{
"key":77,
"sicCode":70100,
"sicText":"Activities of head offices",
"sicSection":"Professional, scientific and technical activities",
"party":"UKIP",
"qAmounts":[0,0,0,0,0,0,0,0,2000,0,5000,5000,5000,5000,5000,246200,1084567,2000,302000,0,1000000],
"qChangesPc":[0,0,0,0,0,0,0,0,0,-100,0,0,0,0,0,4824,340.5,-99.8,15000,-100,0],
"qChangesLog":[0,0,0,0,0,0,0,0,0,-2,0,0,0,0,0,3.68,2.53,-2,4.18,-2,0]
},
{
"key":78,
"sicCode":70221,
"sicText":"Financial management",
"sicSection":"Professional, scientific and technical activities",
"party":"Conservative Party",
"qAmounts":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,21200,50000,0,5000,15000,0],
"qChangesPc":[-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,135.8,-100,0,200,-100],
"qChangesLog":[-2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2.13,-2,0,2.3,-2]
},
{
"key":79,
"sicCode":70221,
"sicText":"Financial management",
"sicSection":"Professional, scientific and technical activities",
"party":"Green Party",
"qAmounts":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],
"qChangesPc":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],
"qChangesLog":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]
},
{
"key":80,
"sicCode":70221,
"sicText":"Financial management",
"sicSection":"Professional, scientific and technical activities",
"party":"Labour Party",
"qAmounts":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,50000,0,0,0,0],
"qChangesPc":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0,0],
"qChangesLog":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-2,0,0,0]
},
{
"key":81,
"sicCode":70221,
"sicText":"Financial management",
"sicSection":"Professional, scientific and technical activities",
"party":"Liberal Democrats",
"qAmounts":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4000,0,5000,0],
"qChangesPc":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,-100],
"qChangesLog":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-2,0,-2]
},
{
"key":82,
"sicCode":70221,
"sicText":"Financial management",
"sicSection":"Professional, scientific and technical activities",
"party":"SNP",
"qAmounts":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],
"qChangesPc":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],
"qChangesLog":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]
},
{
"key":83,
"sicCode":70221,
"sicText":"Financial management",
"sicSection":"Professional, scientific and technical activities",
"party":"UKIP",
"qAmounts":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,50000,30000,5000,5000,0,500000],
"qChangesPc":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-40,-83.3,0,-100,0],
"qChangesLog":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-1.6,-1.92,0,-2,0]
},
{
"key":84,
"sicCode":73110,
"sicText":"Advertising agencies",
"sicSection":"Professional, scientific and technical activities",
"party":"Conservative Party",
"qAmounts":[150000,0,0,0,0,0,0,0,0,0,0,2000,0,0,0,0,7970,6340,5000,4000,0],
"qChangesPc":[0,-100,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,0,-20.5,-21.1,-20,-100],
"qChangesLog":[0,-2,0,0,0,0,0,0,0,0,0,0,-2,0,0,0,0,-1.31,-1.32,-1.3,-2]
},
{
"key":85,
"sicCode":73110,
"sicText":"Advertising agencies",
"sicSection":"Professional, scientific and technical activities",
"party":"Green Party",
"qAmounts":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],
"qChangesPc":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],
"qChangesLog":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]
},
{
"key":86,
"sicCode":73110,
"sicText":"Advertising agencies",
"sicSection":"Professional, scientific and technical activities",
"party":"Labour Party",
"qAmounts":[322605,0,0,0,0,0,0,0,0,0,0,0,0,16551,4000,0,0,0,0,55647,0],
"qChangesPc":[250.7,-100,0,0,0,0,0,0,0,0,0,0,0,0,-75.8,-100,0,0,0,0,-100],
"qChangesLog":[2.4,-2,0,0,0,0,0,0,0,0,0,0,0,0,-1.88,-2,0,0,0,0,-2]
},
{
"key":87,
"sicCode":73110,
"sicText":"Advertising agencies",
"sicSection":"Professional, scientific and technical activities",
"party":"Liberal Democrats",
"qAmounts":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],
"qChangesPc":[-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],
"qChangesLog":[-2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]
},
{
"key":88,
"sicCode":73110,
"sicText":"Advertising agencies",
"sicSection":"Professional, scientific and technical activities",
"party":"SNP",
"qAmounts":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],
"qChangesPc":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],
"qChangesLog":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]
},
{
"key":89,
"sicCode":73110,
"sicText":"Advertising agencies",
"sicSection":"Professional, scientific and technical activities",
"party":"UKIP",
"qAmounts":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],
"qChangesPc":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],
"qChangesLog":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]
},
{
"key":90,
"sicCode":74990,
"sicText":"Non-trading company",
"sicSection":"Professional, scientific and technical activities",
"party":"Conservative Party",
"qAmounts":[0,0,2000,0,0,0,0,0,0,0,0,0,0,28000,0,0,0,5000,0,0,0],
"qChangesPc":[0,0,0,-100,0,0,0,0,0,0,0,0,0,0,-100,0,0,0,-100,0,0],
"qChangesLog":[0,0,0,-2,0,0,0,0,0,0,0,0,0,0,-2,0,0,0,-2,0,0]
},
{
"key":91,
"sicCode":74990,
"sicText":"Non-trading company",
"sicSection":"Professional, scientific and technical activities",
"party":"Green Party",
"qAmounts":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],
"qChangesPc":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],
"qChangesLog":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]
},
{
"key":92,
"sicCode":74990,
"sicText":"Non-trading company",
"sicSection":"Professional, scientific and technical activities",
"party":"Labour Party",
"qAmounts":[0,0,0,0,10800,0,0,0,0,13192,0,0,50000,50000,10000,30000,20000,30000,160000,200000,110000],
"qChangesPc":[0,0,0,0,0,-100,0,0,0,0,-100,0,0,0,-80,200,-33.3,50,433.3,25,-45],
"qChangesLog":[0,0,0,0,0,-2,0,0,0,0,-2,0,0,0,-1.9,2.3,-1.52,1.7,2.64,1.4,-1.65]
},
{
"key":93,
"sicCode":74990,
"sicText":"Non-trading company",
"sicSection":"Professional, scientific and technical activities",
"party":"Liberal Democrats",
"qAmounts":[1805,0,0,0,5920,1460,1460,2460,2240,3305,1460,6805,4805,4805,9805,19200,16200,26200,16200,2200,0],
"qChangesPc":[-93.3,-100,0,0,0,-75.3,0,68.5,-8.9,47.5,-55.8,366.1,-29.4,0,104.1,95.8,-15.6,61.7,-38.2,-86.4,-100],
"qChangesLog":[-1.97,-2,0,0,0,-1.88,0,1.84,-0.95,1.68,-1.75,2.56,-1.47,0,2.02,1.98,-1.19,1.79,-1.58,-1.94,-2]
},
{
"key":94,
"sicCode":74990,
"sicText":"Non-trading company",
"sicSection":"Professional, scientific and technical activities",
"party":"SNP",
"qAmounts":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],
"qChangesPc":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],
"qChangesLog":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]
},
{
"key":95,
"sicCode":74990,
"sicText":"Non-trading company",
"sicSection":"Professional, scientific and technical activities",
"party":"UKIP",
"qAmounts":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],
"qChangesPc":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],
"qChangesLog":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]
},
{
"key":96,
"sicCode":82990,
"sicText":"Other business support service activities (NEC)",
"sicSection":"Administrative and support service activities",
"party":"Conservative Party",
"qAmounts":[0,11900,0,0,0,10200,0,3300,0,0,0,0,0,0,0,0,0,0,0,0,0],
"qChangesPc":[0,0,-100,0,0,0,-100,0,-100,0,0,0,0,0,0,0,0,0,0,0,0],
"qChangesLog":[0,0,-2,0,0,0,-2,0,-2,0,0,0,0,0,0,0,0,0,0,0,0]
},
{
"key":97,
"sicCode":82990,
"sicText":"Other business support service activities (NEC)",
"sicSection":"Administrative and support service activities",
"party":"Green Party",
"qAmounts":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],
"qChangesPc":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],
"qChangesLog":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]
},
{
"key":98,
"sicCode":82990,
"sicText":"Other business support service activities (NEC)",
"sicSection":"Administrative and support service activities",
"party":"Labour Party",
"qAmounts":[0,0,0,0,0,2685,0,0,0,0,23484,0,0,0,0,0,0,0,0,0,0],
"qChangesPc":[-100,0,0,0,0,0,-100,0,0,0,0,-100,0,0,0,0,0,0,0,0,0],
"qChangesLog":[-2,0,0,0,0,0,-2,0,0,0,0,-2,0,0,0,0,0,0,0,0,0]
},
{
"key":99,
"sicCode":82990,
"sicText":"Other business support service activities (NEC)",
"sicSection":"Administrative and support service activities",
"party":"Liberal Democrats",
"qAmounts":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],
"qChangesPc":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],
"qChangesLog":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]
},
{
"key":100,
"sicCode":82990,
"sicText":"Other business support service activities (NEC)",
"sicSection":"Administrative and support service activities",
"party":"SNP",
"qAmounts":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],
"qChangesPc":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],
"qChangesLog":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]
},
{
"key":101,
"sicCode":82990,
"sicText":"Other business support service activities (NEC)",
"sicSection":"Administrative and support service activities",
"party":"UKIP",
"qAmounts":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],
"qChangesPc":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],
"qChangesLog":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]
},
{
"key":102,
"sicCode":93290,
"sicText":"Other amusement and recreation activities (NEC)",
"sicSection":"Arts, entertainment and recreation",
"party":"Conservative Party",
"qAmounts":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],
"qChangesPc":[-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],
"qChangesLog":[-2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]
},
{
"key":103,
"sicCode":93290,
"sicText":"Other amusement and recreation activities (NEC)",
"sicSection":"Arts, entertainment and recreation",
"party":"Green Party",
"qAmounts":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],
"qChangesPc":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],
"qChangesLog":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]
},
{
"key":104,
"sicCode":93290,
"sicText":"Other amusement and recreation activities (NEC)",
"sicSection":"Arts, entertainment and recreation",
"party":"Labour Party",
"qAmounts":[0,9000,0,0,0,0,8000,10000,0,0,10000,0,10000,0,0,0,10000,0,0,10000,0],
"qChangesPc":[-100,0,-100,0,0,0,0,25,-100,0,0,-100,0,-100,0,0,0,-100,0,0,-100],
"qChangesLog":[-2,0,-2,0,0,0,0,1.4,-2,0,0,-2,0,-2,0,0,0,-2,0,0,-2]
},
{
"key":105,
"sicCode":93290,
"sicText":"Other amusement and recreation activities (NEC)",
"sicSection":"Arts, entertainment and recreation",
"party":"Liberal Democrats",
"qAmounts":[0,0,0,29484,53973,61342,153267,97378,53250,50000,79271,80000,65000,65500,76052,90000,72157,0,27000,0,0],
"qChangesPc":[0,0,0,0,83.1,13.7,149.9,-36.5,-45.3,-6.1,58.5,0.9,-18.8,0.8,16.1,18.3,-19.8,-100,0,-100,0],
"qChangesLog":[0,0,0,0,1.92,1.14,2.18,-1.56,-1.66,-0.79,1.77,-0.05,-1.27,-0.1,1.21,1.26,-1.3,-2,0,-2,0]
},
{
"key":106,
"sicCode":93290,
"sicText":"Other amusement and recreation activities (NEC)",
"sicSection":"Arts, entertainment and recreation",
"party":"SNP",
"qAmounts":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],
"qChangesPc":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],
"qChangesLog":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]
},
{
"key":107,
"sicCode":93290,
"sicText":"Other amusement and recreation activities (NEC)",
"sicSection":"Arts, entertainment and recreation",
"party":"UKIP",
"qAmounts":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2735,0,0,0],
"qChangesPc":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-100,0,0],
"qChangesLog":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-2,0,0]
},
{
"key":108,
"sicCode":94920,
"sicText":"Activities of political organizations",
"sicSection":"Other service activities",
"party":"Conservative Party",
"qAmounts":[9524,3000,0,0,3524,5706,3450,0,0,0,0,3000,0,125000,0,137600,12000,20500,29500,168500,0],
"qChangesPc":[-57.6,-68.5,-100,0,0,61.9,-39.5,-100,0,0,0,0,-100,0,-100,0,-91.3,70.8,43.9,471.2,-100],
"qChangesLog":[-1.76,-1.84,-2,0,0,1.79,-1.6,-2,0,0,0,0,-2,0,-2,0,-1.96,1.85,1.64,2.67,-2]
},
{
"key":109,
"sicCode":94920,
"sicText":"Activities of political organizations",
"sicSection":"Other service activities",
"party":"Green Party",
"qAmounts":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],
"qChangesPc":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],
"qChangesLog":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]
},
{
"key":110,
"sicCode":94920,
"sicText":"Activities of political organizations",
"sicSection":"Other service activities",
"party":"Labour Party",
"qAmounts":[0,0,0,26000,36000,5896,18648,32938,24726,29376,28495,14459,41641,9802,4063,52912,28704,2160,37264,0,0],
"qChangesPc":[0,0,0,0,38.5,-83.6,216.3,76.6,-24.9,18.8,-3,-49.3,188,-76.5,-58.5,1202.3,-45.8,-92.5,1625.2,-100,0],
"qChangesLog":[0,0,0,0,1.59,-1.92,2.34,1.88,-1.4,1.27,-0.48,-1.69,2.27,-1.88,-1.77,3.08,-1.66,-1.97,3.21,-2,0]
},
{
"key":111,
"sicCode":94920,
"sicText":"Activities of political organizations",
"sicSection":"Other service activities",
"party":"Liberal Democrats",
"qAmounts":[3163,0,0,7708,4125,17726,12549,22003,26928,29730,16477,44595,98742,170998,177930,174167,173767,174407,172016,160500,0],
"qChangesPc":[0,-100,0,0,-46.5,329.7,-29.2,75.3,22.4,10.4,-44.6,170.7,121.4,73.2,4.1,-2.1,-0.2,0.4,-1.4,-6.7,-100],
"qChangesLog":[0,-2,0,0,-1.67,2.52,-1.47,1.88,1.35,1.02,-1.65,2.23,2.08,1.86,0.61,-0.32,0.7,-0.4,-0.15,-0.83,-2]
},
{
"key":112,
"sicCode":94920,
"sicText":"Activities of political organizations",
"sicSection":"Other service activities",
"party":"SNP",
"qAmounts":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],
"qChangesPc":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],
"qChangesLog":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]
},
{
"key":113,
"sicCode":94920,
"sicText":"Activities of political organizations",
"sicSection":"Other service activities",
"party":"UKIP",
"qAmounts":[0,0,0,0,0,0,0,0,0,0,0,3351,3680,4798,6626,7313,5155,10750,8870,9000,0],
"qChangesPc":[0,0,0,0,0,0,0,0,0,0,0,0,9.8,30.4,38.1,10.4,-29.5,108.5,-17.5,1.5,-100],
"qChangesLog":[0,0,0,0,0,0,0,0,0,0,0,0,0.99,1.48,1.58,1.02,-1.47,2.04,-1.24,0.18,-2]
},
{
"key":114,
"sicCode":96090,
"sicText":"Other service activities (NEC)",
"sicSection":"Other service activities",
"party":"Conservative Party",
"qAmounts":[9750,88000,12554,54600,0,9500,6600,60000,0,7000,50000,0,77500,1720,52000,10000,52500,7000,67500,219235,0],
"qChangesPc":[0,802.6,-85.7,334.9,-100,0,-30.5,809.1,-100,0,614.3,-100,0,-97.8,2923.3,-80.8,425,-86.7,864.3,224.8,-100],
"qChangesLog":[0,2.9,-1.93,2.52,-2,0,-1.48,2.91,-2,0,2.79,-2,0,-1.99,3.47,-1.91,2.63,-1.94,2.94,2.35,-2]
},
{
"key":115,
"sicCode":96090,
"sicText":"Other service activities (NEC)",
"sicSection":"Other service activities",
"party":"Green Party",
"qAmounts":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],
"qChangesPc":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],
"qChangesLog":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]
},
{
"key":116,
"sicCode":96090,
"sicText":"Other service activities (NEC)",
"sicSection":"Other service activities",
"party":"Labour Party",
"qAmounts":[0,0,10000,12500,13500,1000,20202,40888,12500,0,0,12500,12500,0,1875,12500,15000,12500,56000,27500,0],
"qChangesPc":[0,0,0,25,8,-92.6,1920.2,102.4,-69.4,-100,0,0,0,-100,0,566.7,20,-16.7,348,-50.9,-100],
"qChangesLog":[0,0,0,1.4,0.9,-1.97,3.28,2.01,-1.84,-2,0,0,0,-2,0,2.75,1.3,-1.22,2.54,-1.71,-2]
},
{
"key":117,
"sicCode":96090,
"sicText":"Other service activities (NEC)",
"sicSection":"Other service activities",
"party":"Liberal Democrats",
"qAmounts":[15606,0,0,0,0,0,0,0,0,0,2000,0,0,10000,0,0,0,2500,0,10000,0],
"qChangesPc":[56.3,-100,0,0,0,0,0,0,0,0,0,-100,0,0,-100,0,0,0,-100,0,-100],
"qChangesLog":[1.75,-2,0,0,0,0,0,0,0,0,0,-2,0,0,-2,0,0,0,-2,0,-2]
},
{
"key":118,
"sicCode":96090,
"sicText":"Other service activities (NEC)",
"sicSection":"Other service activities",
"party":"SNP",
"qAmounts":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],
"qChangesPc":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],
"qChangesLog":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]
},
{
"key":119,
"sicCode":96090,
"sicText":"Other service activities (NEC)",
"sicSection":"Other service activities",
"party":"UKIP",
"qAmounts":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,511254,412978,0],
"qChangesPc":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-19.2,-100],
"qChangesLog":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-1.28,-2]
}
]
<!DOCTYPE html>
<meta charset="utf-8">
<style>
body {
font-family: sans-serif;
}
.axis path,
line {
fill: none;
stroke: #666;
opacity: 0.3;
shape-rendering: crispEdges;
}
.y.axis path {
display: none;
}
.axis text {
fill: #666;
font-size: 11px;
}
.axis-label {
fill: #666;
font-size: 11px;
}
.chart-title {
font-size:78px;
fill: #666;
}
#tooltip {
position: relative;
width: 210px;
height: auto;
padding: 10px;
background-color: white;
-webkit-border-radius: 10px;
-moz-border-radius: 10px;
border-radius: 10px;
-webkit-box-shadow: 0 2px 5px 0 rgba(0, 0, 0, 0.16), 0 2px 10px 0 rgba(0, 0, 0, 0.12);
-moz-box-shadow: 0 2px 5px 0 rgba(0, 0, 0, 0.16), 0 2px 10px 0 rgba(0, 0, 0, 0.12);
box-shadow: 0 2px 5px 0 rgba(0, 0, 0, 0.16), 0 2px 10px 0 rgba(0, 0, 0, 0.12);
pointer-events: none;
text-align: center;
z-index: 1;
}
#tooltip.hidden {
display: none;
}
#tooltip p {
margin: 0;
line-height: 1;
}
#tooltip small {
font-size: 75%;
}
#tooltip hr {
fill: none;
stroke: #666;
shape-rendering: crispEdges;
}
</style>
<body>
<h2>Navigate fiscal quarters Q2 2010-Q2 2015</h2>
<button type="button" id="first" disabled="disabled">First</button>
<button type="button" id="prev" disabled="disabled"></i>Prev</button>
<button type="button" id="next"></i>Next</button>
<button type="button" id="last">Last</button>
<div style="max-height: 0px">
<div id="tooltip" class="hidden">
<p><span id="value"></span></p>
</div>
</div>
<div id="datavis"></div>
<script src="https://cdnjs.cloudflare.com/ajax/libs/d3/3.5.6/d3.min.js" charset="utf-8"></script>
<script>
//Declare global data variable
var data;
//Define global currentQuarter variable
var currentQuarter = 0;
//Define margins and SVG size according to Mike Bostock's convention
var margin = {top: 30, right: 10, bottom: 35, left: 23},
width = 960 - margin.left - margin.right,
height = 415 - margin.top - margin.bottom;
//Define custom categorical colour scale
var colour = d3.scale.ordinal()
.domain(["Conservative Party", "Green Party",
"Labour Party", "Liberal Democrats", "SNP", "UKIP"
])
.range(["#2979ff", "#00e676", "#ff1744", "#ffc400",
"#ffea00", "#d500f9"]);
//Define quarterText array
var quarterText = ["Q2 2010", "Q3 2010", "Q4 2010", "Q1 2011", "Q2 2011",
"Q3 2011", "Q4 2011", "Q1 2012", "Q2 2012", "Q3 2012", "Q4 2012",
"Q1 2013", "Q2 2013", "Q3 2013", "Q4 2013", "Q1 2014", "Q2 2014",
"Q3 2014", "Q4 2014", "Q1 2015", "Q2 2015"];
//Begin main script
d3.json("data.json", function(error, json) {
//Define data variable
data = json;
//Create scale functions
var xScale = d3.scale.ordinal()
.domain(data.sort(function(a, b) {
return d3.ascending(a.sicCode, b.sicCode);
})
.map(function(d) {
return d.sicCode;
}))
.rangePoints([92, width - 69]);
var yScale = d3.scale.linear()
.clamp(true)
.domain([-2, 4])
.range([height, 40]);
var rScale = d3.scale.linear()
.domain([0, d3.max(data, function(d) {
return d.qAmounts[currentQuarter];
})])
.range([0, 114]);
//Define key function, to be used when binding data
var key = function(d) {
return d.key;
};
//Create SVG element
var svg = d3.select("#datavis")
.append("svg")
.attr("width", width + margin.left + margin.right)
.attr("height", height + margin.top + margin.bottom)
.append("g")
.attr("transform", "translate(" + margin.left + "," +
margin.top + ")")
.style("display", "block")
.style("margin-left", "auto")
.style("margin-right", "auto");
//Define X axis
var x = d3.svg.axis()
.scale(xScale)
.orient("bottom")
.tickFormat("");
//Define Y axis
var y = d3.svg.axis()
.scale(yScale)
.orient("right")
.ticks(4)
.tickSize((width - 161), 0)
.tickFormat(function(value) {
var labels = {"-2":"-100%", 0:"0%", 2:"+100%",
4:"+10,000% or higher"};
return labels[value];
});
//Define mouseover behaviour
var mouseover = function(d) {
//Show the circle stroke
d3.select(this)
.transition()
.duration(200)
.attr("stroke-width", 2);
};
//Define mousemove (tooltip) behaviour
var mousemove = function(d) {
//Get the mouse pointer's x/y values, then augment for the tooltip
var xPosition = parseFloat(d3.mouse(this)[0]) - 82;
var yPosition = parseFloat(d3.mouse(this)[1]) - 187;
//Update the tooltip position and value div content
d3.select("#tooltip")
.style("left", xPosition + "px")
.style("top", yPosition + "px")
.select("#value")
.html("<p><small>" + d.sicSection + "</small></p><hr><h4>" +
d.sicText + "</h4><h3>£" +
d3.format(",")(d.qAmounts[currentQuarter]) + "</h3><p><i>" +
d.party + "</i></p><p><small>" +
d3.format("+")(d.qChangesPc[currentQuarter]) +
"% on previous quarter</small></p>");
//Show the tooltip
d3.select("#tooltip").classed("hidden", false);
};
//Define mouseout behaviour
var mouseout = function(d) {
//Hide the circle stroke
d3.select(this)
.transition()
.duration(200)
.attr("stroke-width", 0);
//Hide the tooltip
d3.select("#tooltip").classed("hidden", true);
};
//Create circles
svg.selectAll("circle")
.data(data.sort(function(a, b) {
return d3.descending(a.qAmounts[currentQuarter],
b.qAmounts[currentQuarter]);
}), key)
.enter()
.append("circle")
.attr("cx", function(d) {
return xScale(d.sicCode);
})
.attr("r", function(d) {
return rScale(d.qAmounts[currentQuarter]);
})
.attr("cy", -50)
.attr("stroke", "#666")
.attr("stroke-width", 0)
.style("opacity", 0.6)
.attr("fill", function(d) {
return colour(d.party);
})
.transition()
.ease("elastic")
.duration(1200)
.attr("cy", function(d) {
return yScale(d.qChangesLog[currentQuarter]);
})
//Bind event listeners
.each("end", function() {
d3.select(this)
.on("mouseover", mouseover)
.on("mousemove", mousemove)
.on("mouseout", mouseout)
});
//Create X axis
svg.append("g")
.attr("class", "x axis")
.attr("transform", "translate(0," + height + ")")
.call(x);
//Create Y axis
svg.append("g")
.attr("class", "y axis")
.attr("transform", "translate(" + 92 + ",0)")
.call(y)
.selectAll("text")
.attr("x", -95);
//Create Y axis label
svg.append("text")
.attr("class", "axis-label")
.attr("text-anchor", "end")
.attr("x", (-height / 2 + 67))
.attr("y", -5)
.attr("transform", "rotate(-90)")
.text("Change on previous quarter");
//Create currentQuarter label
svg.append("text")
.data(data)
.attr("class", "chart-title")
.attr("id", "current-quarter")
.attr("x", width - width / 3)
.attr("y", 72)
.text(function(d) {
return quarterText[currentQuarter];
});
//Define chart update function
function update() {
//Update all circles
svg.selectAll("circle")
.on("mouseover", null)
.on("mousemove", null)
.on("mouseout", null)
.sort(function(a, b) {
return d3.descending(a.qAmounts[currentQuarter],
b.qAmounts[currentQuarter]);
})
.transition()
.duration(1200)
.attr("cy", function(d) {
return yScale(d.qChangesLog[currentQuarter]);
})
.attr("r", function(d) {
return rScale(d.qAmounts[currentQuarter]);
})
.each("end", function() {
//Bind event listeners
d3.select(this)
.on("mouseover", mouseover)
.on("mousemove", mousemove)
.on("mouseout", mouseout)
});
//Update currentQuarter label
d3.select("#current-quarter")
.data(data)
.text(function(d) {
return quarterText[currentQuarter];
});
};
//On #next button click, update chart and nav elements
d3.select("#next")
.on("click", function() {
if (currentQuarter < 20) {
//Update currentQuarter
currentQuarter = currentQuarter + 1;
//Perform update function
update();
//Disable this and #last button if currentQuarter is now 20
if (currentQuarter == 20) {
d3.selectAll("#next, #last")
.attr("disabled", "disabled");
};
//Enable #prev and #first button
d3.selectAll("#prev, #first")
.attr("disabled", null);
};
});
//On #prev button click, update chart and nav elements
d3.select("#prev")
.on("click", function() {
if (currentQuarter > 0) {
//Update currentQuarter variable
currentQuarter = currentQuarter - 1;
//Perform update function
update();
//Disable this and #first button if currentQuarter is now 0
if (currentQuarter == 0) {
d3.selectAll("#prev, #first")
.attr("disabled", "disabled");
};
//Enable #next and #last button
d3.selectAll("#next, #last")
.attr("disabled", null);
};
});
//On #last button click, update chart and nav elements
d3.select("#last")
.on("click", function() {
if (currentQuarter < 20) {
//Update currentQuarter
currentQuarter = 20;
//Perform update function
update();
//Disable this and #next button
d3.selectAll("#last, #next")
.attr("disabled", "disabled");
//Enable #prev and #first buttons
d3.selectAll("#prev, #first")
.attr("disabled", null);
};
});
//On #first button click, update chart and nav elements
d3.select("#first")
.on("click", function() {
if (currentQuarter > 0) {
//Update currentQuarter
currentQuarter = 0;
//Perform update function
update();
//Disable this and #prev button
d3.selectAll("#first, #prev")
.attr("disabled", "disabled");
//Enable #next and #last buttons
d3.selectAll("#next, #last")
.attr("disabled", null);
};
});
});
</script>
</body>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment