JSON Hero only works on desktop

👇

(For now!)

Back to Home

by

Save

  1. 10.8k

root

source

https://www.sec.gov/modules/custom/sec_custom_blocks/js/oasb_raising_capital_map/main.js?v=1.2

snippet

const formatNumber = (num, convertToMillions = false) => { num = Number(num); const oneB = 1000000000; const oneM = 1000000; const oneK = 1000; if (num > 0) { // convert to thousand if (convertToMillions) { num = num / oneM; } num = num * oneK; if (num >= oneM) { return Highcharts.numberFormat(num / oneM, 2) + "B"; } else if (num >= oneK) { return Highcharts.numberFormat(num / oneK, 2) + "M"; } else { return Highcharts.numberFormat(num, 2) + "K"; } } else { return num; } }, shadow: false, colorKey: "color_code", tooltip: { pointFormatter: function () { const point = this; const [county, state] = this.series.mapMap[point.code].name.split(","); return `<strong>${county},${state.toUpperCase()}</strong> <br/> <strong>Offerings Count:</strong> ${ point.offerings } <br/> <strong>USD Raised:</strong> $${formatNumber(point.usd, true)}`; }, },

root

Copy

object

Copy