Created
December 8, 2017 15:17
-
-
Save gdbassett/178a0506ffd7c05cb67e5c8c144ddce1 to your computer and use it in GitHub Desktop.
A DBIR bar chart in VEGA
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"$schema": "https://vega.github.io/schema/vega/v3.0.json", | |
"width": 500, | |
"height": 309, | |
"autosize": "pad", | |
"data": [ | |
{ | |
"name": ".", | |
"format": { | |
"type": "csv", | |
"parse": { | |
"x": "number", | |
"n": "number", | |
"freq": "number" | |
} | |
}, | |
"values": "\"enum\",\"x\",\"n\",\"freq\"\n\"Use of backdoor or C2\",679,895,0.75866\n\"Use of stolen creds\",643,895,0.71844\n\"Brute force\",80,895,0.08939\n\"SQLi\",26,895,0.02905\n\"Footprinting\",18,895,0.02011\n\"Abuse of functionality\",6,895,0.0067\n\"DoS\",5,895,0.00559\n\"Forced browsing\",4,895,0.00447\n\"RFI\",4,895,0.00447\n\"Other\",2,895,0.00223\n\"Session prediction\",2,895,0.00223" | |
} | |
], | |
"marks": [ | |
{ | |
"type": "rect", | |
"clip": false, | |
"encode": { | |
"update": { | |
"x": { | |
"scale": "y", | |
"value": 0 | |
}, | |
"x2": { | |
"field": "freq", | |
"scale": "y" | |
}, | |
"y": { | |
"field": "enum", | |
"scale": "x" | |
}, | |
"height": { | |
"scale": "x", | |
"band": "1" | |
} | |
} | |
}, | |
"from": { | |
"data": "." | |
}, | |
"interactive": true, | |
"name": "mark_791883058" | |
} | |
], | |
"scales": [ | |
{ | |
"name": "x", | |
"type": "band", | |
"domain": { | |
"data": ".", | |
"field": "enum" | |
}, | |
"paddingInner": 0.1, | |
"paddingOuter": 0, | |
"range": "height", | |
"round": true | |
}, | |
{ | |
"name": "y", | |
"type": "linear", | |
"domain": { | |
"data": ".", | |
"field": "freq" | |
}, | |
"range": "width", | |
"round": true | |
} | |
], | |
"axes": [ | |
{ | |
"scale": "y", | |
"orient": "bottom", | |
"format": "%", | |
"grid": true | |
}, | |
{ | |
"scale": "x", | |
"orient": "left" | |
} | |
], | |
"config": { | |
"autosize": "pad", | |
"events": { | |
"defaults": null | |
}, | |
"mark": { | |
"fill": "#0088CE" | |
}, | |
"axis": { | |
"ticks": false | |
}, | |
"title": { | |
"anchor": "start" | |
} | |
}, | |
"title": "Top Hacking varieties in breaches", | |
"mark": [ | |
{ | |
"type": "rect", | |
"clip": false, | |
"encode": { | |
"update": { | |
"x": { | |
"scale": "y", | |
"value": 0 | |
}, | |
"x2": { | |
"field": "freq", | |
"scale": "y" | |
}, | |
"y": { | |
"field": "enum", | |
"scale": "x" | |
}, | |
"height": { | |
"scale": "x", | |
"band": "1" | |
} | |
} | |
}, | |
"from": { | |
"data": "." | |
}, | |
"interactive": true, | |
"name": "mark_791883058", | |
"update": { | |
"strokeWidth": 0 | |
} | |
} | |
] | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment