Skip to content
CityAM
Main navigation
  • News
    • News
      • Latest Business News
      • Economics
      • Politics
      • Tech
      • Banking
      • FTSE 100 Live
      • Retail
      • Insurance
      • Legal
      • Property
      • Transport
      • Markets
    • From our partners
      • AON
      • Bayes Business School
      • Canada BIDs
      • Central London Alliance CIC
      • Destination City
      • Halkin
      • Olympia
      • Inside Saudi
      • Tottenham Hotspur Stadium
      • Santander X
      • YEAR SIX Dividend
    • Featured

      Burnham’s focused on spending but at least Streeting’s thinking about growth

      Labour leadership hopeful Wes Streeting

      Submit a story

      Tell us your story.

      Submit
  • Opinion
  • Sport
    • Latest Sports News
      • Sport
      • Sport Business
    • From our partners
      • The Morning Briefing: SBS x CityAM
      • Aramco Team Series
      • LIV Golf
    • Featured

      England’s secret weapon against World Cup heat? British company’s £26 product

      Breaking news scene with journalists interviewing a business leader in front of corporate headquarters, microphones and ca...

      Submit a story

      Tell us your story.

      Submit
  • Life&Style
    • Life&Style
      • Life&Style
      • Toast the City Awards
      • The Magazine
      • Travel
      • Culture
      • Motoring
      • Wellness
      • The RED BULLETiN
      • Do it with Shared Ownership
      • Media Speak Hub
    • Featured

      Old Pulteney releases 50-year-old whisky for 200th anniversary

      Old Pulteney 50-Year-Old single malt Scotch whisky bottle with elegant packaging on display, highlighting luxury and craft...

      Submit a story

      Tell us your story.

      Submit
  • Investec
  • Events
  • Latest Paper
Thursday 04 June 2015 10:41 am

governmnet budget test

By: Billy Ehrenberg

Add as a preferred source on Google

 

 

#cam-d3-unembub {margin:0px;} #cam-d3-unembub .h,.v{stroke:black;stroke-dasharray:4 4;stroke-width:1;stroke-opacity:.5;} #cam-d3-unembub .axis path, #cam-d3-unembub .axis line { fill: none; stroke: black; shape-rendering: crispEdges; } #cam-d3-unembub .axis text { font-family: source sans pro, sans-serif; font-size: 12px; } body div.tooltip { position: absolute; text-align: left; padding: 5px; font: 12px source sans pro, sans-serif; background: lightsteelblue; border: 0px; border-radius: 8px; pointer-events: none; } body div.tooltip p { margin: 0; padding: 0; } body div.tooltip strong { font-size: 14px; }

 

var formattot = d3.format(",");

var svg = d3.select("#cam-d3-unembub").append("svg") .attr("width", width) .attr("height", height);

var x = d3.scale.linear() .domain([0,10]) .range([margin, width-margin]);

var y = d3.scale.linear() .domain ([120,0]) .range ([margin,height-margin]);

var r = d3.scale.linear() .domain ([0,22.4]) .range ([5,17]);

var c = d3.scale.category20() .domain(["Defence", "Education non-schools", "Business, Innovation and Skills", "Justice", "CLG Communities", "Department for Health non-NHS", "Transport inc. King’s Cross property", "Work and Pensions", "Environment, Food and Rural Affairs", "HM Revenue and Customs", "Energy and Climate Change", "Home Office", "Culture, Media and Sport", "Foreign and Commonwealth Office", "Cabinet Office", "HM Treasury" ]);

var xAxis = d3.svg.axis() .scale(x) .orient("bottom");

var yAxis = d3.svg.axis() .scale(y) .orient("left");

svg.append("g") .attr("class", "axis") .attr("transform", "translate(0," + (height - margin) + ")") .call(xAxis) .append("text") .attr("y", -16) .attr("dy", ".71em") .attr ("x",width -50) .style("text-anchor", "end") .text("% of under 25s unemployed");

svg.append("g") .attr("class", "axis") .attr("transform", "translate(" + margin + ",0)") .call(yAxis) .append("text") .attr("transform", "rotate(-90)") .attr("y", 6) .attr("dy", ".71em") .attr ("x",-56) .style("text-anchor", "end") .text("% of total unemployed out of work for 12 months or more");

svg.append("circle") .attr("cx",width -190) .attr("cy", height -100) .attr ("r", 17) .style ("fill","rgba(3,78,161,0.7) ");

svg.append("text") .attr("x", width -160) .attr("y", height -95) .attr("class", "legend") .style("fill", "gray") .style ("font-family", "open sans") .style ("font-size", "12px") .text("tot. num. unemplyd");

// Define 'div' for tooltips var tooltip = d3.select("body") .append("div") // declare the tooltip div .attr("class", "tooltip") // apply the 'tooltip' class .style("opacity", 0); // set the opacity to nil

d3.csv("https://cityam.ca/wp-content/uploads/2015/06/data-5570638953554.csv",function(csv) {

/* set up variables for nesting our shapes */

/* create svg group for circles and text */ var g = svg.append("g").attr("class","bubbleGroup");

/* create variable for our circles */ var circles = g.selectAll("circle") .data(csv) .enter() .append("circle") .attr("class","countryBubble");

circles.attr("cx",function(d) {return 50;}) .attr("cy",function(d) {return y(0);}) .attr("r",function(d) {return r(0);}) .style("stroke","#ffffff") .style("stroke-width", 1) .style("fill", function(d) {return c(d.country)} ) .style("opacity", 0.8) .on("mouseover", mouseover) .on("mouseout", mouseout);

circles.transition() .duration(2000) .attr("cx",function(d) { return x(+d.all); }) .attr("cy",function(d) { return y(+d.lt); }) .attr("r",function(d) { return r((+d.lt)*1); })

/* create svg group for all the text, and assign an id make sure we set it all up after the circles are printed, so the text shows on top of the circles

*/ var textgroup = g.append("g").attr("id","countryText");

var texts = textgroup.selectAll("text") .data(csv) .enter() .append("text");

texts.text(function(d) { return (d.country); }) .attr("x",function(d) { return (x(+d.all)+r((+d.tot)*100))+5; }) .attr("y",function(d) { return (y(+d.lt)+r((+d.tot)*100))+2; }) .attr("font-family", "sans-serif") .attr("font-size", "14px") .attr("fill", function(d) { return "#c44b81"; })

// Add the show/hide text svg.append("text") .attr("x", 200) .attr("y", 50) .attr("class", "legend") .style("fill", "gray") .style ("font-family", "open sans") .style ("font-size", "12px")

.on("click", function(){ // Determine if current line is visible // false is on, true is off /* var active = countryText.active ? false : true , newOpacity = active ? 1 : 0; */

if (countryText.active==true) { active = false; } else { active = true; } // newOpacity = active ? 1 : 0;

if (active==true) { newOpacity = 1; } else { newOpacity = 0; }

// Hide or show the elements d3.select("#countryText").style("opacity", newOpacity); // Update whether or not the elements are active countryText.active = active; }) .text("Show/Hide");

function mouseover(d) { // show tooltip fade in tooltip.transition() .duration(500) .style("opacity", 0) .style("stroke-width", 9); tooltip.transition() .duration(200) .style("opacity", .9) .style("stroke-width", 3); tooltip.html("

"+d.country+"
Unemployment rate:&nbsp"+d.all+"%
Of which long-term unemployed:&nbsp"+d.lt+"%
Pc of under 25s unem.:&nbsp"+d.under+"%
Total number:&nbsp"+ formattot(d.totnum)+"

"); tooltip.style("left", (d3.event.pageX) + "px") .style("top", (d3.event.pageY - 28) + "px"); }

function mouseout(p) { // show tooltip fadeout tooltip.transition().duration(200).style("opacity", .9); tooltip.transition().duration(500).style("opacity", 0); }

}) var the_chart = jQuery("#cam-chart-unem"), aspect = the_chart.width() / the_chart.height(), container = the_chart.parent(); jQuery(window).on("resize", function() { var targetWidth = container.width(); the_chart.attr("width", targetWidth); the_chart.attr("height", Math.round(targetWidth / aspect)); }).trigger("resize");

Share this article

  • Facebook
  • X
  • LinkedIn
  • WhatsApp
  • Email

Similarly tagged content:

Sections

  • News

Categories

  • Business

Trending Articles

  • As it happened: FTSE 100 relief rally runs out of steam as BP and Shell weigh; Oil hits three-month low

  • Rathbones to suspend thousands of client account inflows after FCA probe deals £530m blow

  • Rolls-Royce shares surge as SMR unit bags multi-billion pound Swedish nuclear contract

  • More Big Four blues as Deloitte plans to slash UK audit roles

  • London Tech Week sums up everything wrong with UK tech

More from CityAM

  • Local growth is not a zero-sum game

    Opinion
    Oxford cityscape featuring historic architecture under clear skies, highlighting iconic landmarks and vibrant autumn foliage
  • New London rooftop bar will be biggest ever with 1,000 capacity

    Life&Style
    Freight Brixton rooftop bar in New London with city skyline views, modern decor, and patrons enjoying cocktails at sunset
  • Alkermes Showcases Data From Psychiatry Portfolio and Sleep Research into Real World Patient Experience at Spring 2026 Scientific Conferences

    Business Wire
  • Alkermes to Showcase Leadership in Psychiatry and Orexin Biology With New Data at the American Society of Clinical Psychopharmacology Annual Meeting

    Business Wire
  • Enhanced Games isn’t sport but a product placement exercise

    Sport Business
    Getty Images logo on a digital screen, symbolizing media and stock photography, in a business and technology context.
  • Motive Unveils the Future of Physical Operations at Vision 26: A New Era of Integrated Hardware and AI Innovations

    Business Wire
  • M&S boss says supermarket price caps ‘completely preposterous’

    Retail
    Stuart Machin, the chief of Marks and Spencer
  • Our honest review of the brand new Aston Martin DB12 S

    Life&Style
    Aston Martin BD12 luxury sports car showcasing sleek design and high-performance features on a scenic road

CityAM Canada — business, markets and opinion for Canadian readers.

Sections

  • Business
  • Markets
  • Tech
  • AI
  • Economics
  • Opinion
  • Cities

Company

  • About
  • Contact

Legal

  • Terms of Use
  • Privacy Policy
  • Cookie Policy
© 2026 CityAM Canada. All rights reserved.
Terms · Privacy · Cookies