Skip to content

Instantly share code, notes, and snippets.

View dinhung85's full-sized avatar

Hung Truong dinhung85

  • Bloomberg
  • Singapore
View GitHub Profile
@dinhung85
dinhung85 / index.html
Created March 10, 2018 05:28 — forked from diethardsteiner/index.html
Simple D3JS Dashboard
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-type" content="text/html; charset=utf-8">
<title>Testing Pie Chart</title>
<!--<script type="text/javascript" src="d3/d3.v2.js"></script>-->
<script src="http://d3js.org/d3.v2.js"></script>
<!-- Note: I made good use of the sample code provided by the D3JS community and extended it to fit my needs to create this simple dashboard -->
<style type="text/css">
{
"name": "MA",
"description" : "flare",
"children": [
{
"name" : "Australia",
"description": "Australia",
"children" : [
{"name" : "Building&Construct-Misc", "description" : "Building&Construct-Misc", "size" : 29.82},
{"name" : "Commercial Serv-Finance", "description" : "Commercial Serv-Finance", "size" : 33.52},
(function() {
// Inspired by http://informationandvisualization.de/blog/box-plot
d3.box = function() {
var width = 1,
height = 1,
duration = 0,
domain = null,
value = Number,
whiskers = boxWhiskers,
@dinhung85
dinhung85 / README.md
Last active March 20, 2016 09:05 — forked from jensgrubert/README.md
D3.js Boxplot with Axes and Labels

A box-and-whisker plot with axes. Based on Mike Bostock's implementation. Instead of using individual svg elements as in Mike's implementation, here all boxplots are rendered with in one root element. This makes it easy to add axes.

Further differences between the two implementations are:

  • visibility of boxplot labels can be switched with the labels variable
  • CSV files are supported in which each column is an independent variable and each row contains measurements for all variables (see data.csv)
  • transitions are not used here but can be easily added again
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Diverging Stacked Bar Chart with D3.js</title>
<style>
body {
font: 10px sans-serif;
}
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Diverging Stacked Bar Chart with D3.js</title>
<style>
body {
font: 10px sans-serif;
}
@dinhung85
dinhung85 / README.md
Last active January 20, 2016 03:28 — forked from vgrocha/README.md

d3-bilevelLabelTooltip

This is a modified d3js bilevel partition in which labels and tooltips were added.

The idea is to have an abbreviation of the partition displayed and a tooltip with a fancier description and the size of that partition.

The base for this chart was Mike's Bilevel Partition. Tooltips thanks to Sharon Howard