Created
October 24, 2014 18:06
-
-
Save jakebrinkmann/42abddd866701b314457 to your computer and use it in GitHub Desktop.
This file contains 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
{ | |
"metadata": { | |
"name": "", | |
"signature": "sha256:deb949db3c41a587ea8529340597b6f871cb7d9c90d73972d8f03534e08eef82" | |
}, | |
"nbformat": 3, | |
"nbformat_minor": 0, | |
"worksheets": [ | |
{ | |
"cells": [ | |
{ | |
"cell_type": "code", | |
"collapsed": false, | |
"input": [ | |
"import random\n", | |
"from IPython import display as d\n", | |
"import nvd3\n", | |
"nvd3.ipynb.initialize_javascript(use_remote=True)" | |
], | |
"language": "python", | |
"metadata": {}, | |
"outputs": [ | |
{ | |
"output_type": "stream", | |
"stream": "stdout", | |
"text": [ | |
"loaded nvd3 IPython extension\n", | |
"run nvd3.IPython_wrapper.initialize_javascript() to set up the notebook\n", | |
"help(nvd3.IPython_wrapper.initialize_javascript) for options\n" | |
] | |
}, | |
{ | |
"html": [ | |
"<link media=\"all\" href=\"http://nvd3.org/assets/css/nv.d3.css\" type=\"text/css\"\n", | |
" rel=\"stylesheet\"/>" | |
], | |
"metadata": {}, | |
"output_type": "display_data", | |
"text": [ | |
"<IPython.core.display.HTML at 0x2b177c4a2190>" | |
] | |
}, | |
{ | |
"javascript": [ | |
"$.getScript(\"http://nvd3.org/assets/js/nv.d3.js\")" | |
], | |
"metadata": {}, | |
"output_type": "display_data", | |
"text": [ | |
"<IPython.core.display.Javascript at 0x2b177cb59790>" | |
] | |
}, | |
{ | |
"javascript": [ | |
"$.getScript(\"http://nvd3.org/assets/lib/d3.v3.js\", function() {\n", | |
" $.getScript(\"http://nvd3.org/assets/js/nv.d3.js\", function() {})});" | |
], | |
"metadata": {}, | |
"output_type": "display_data", | |
"text": [ | |
"<IPython.core.display.Javascript at 0x2b177cb59810>" | |
] | |
}, | |
{ | |
"html": [ | |
"<script src=\"http://nvd3.org/assets/lib/d3.v3.js\"></script>" | |
], | |
"metadata": {}, | |
"output_type": "display_data", | |
"text": [ | |
"<IPython.core.display.HTML at 0x2b177cb59a50>" | |
] | |
}, | |
{ | |
"html": [ | |
"<script src=\"http://nvd3.org/assets/js/nv.d3.js\"></script>" | |
], | |
"metadata": {}, | |
"output_type": "display_data", | |
"text": [ | |
"<IPython.core.display.HTML at 0x2b177cb59710>" | |
] | |
} | |
], | |
"prompt_number": 1 | |
}, | |
{ | |
"cell_type": "code", | |
"collapsed": false, | |
"input": [ | |
"type = 'stackedAreaChart'\n", | |
"chart2 = nvd3.stackedAreaChart(name=type,height=450,use_interactive_guideline=True)\n", | |
"nb_element = 50\n", | |
"xdata = range(nb_element)\n", | |
"ydata = [i * random.randint(1, 10) for i in range(nb_element)]\n", | |
"ydata2 = [x * 2 for x in ydata]\n", | |
"ydata3 = [x * 5 for x in ydata]\n", | |
"chart2.add_serie(name=\"serie 1\", y=ydata, x=xdata)\n", | |
"chart2.add_serie(name=\"serie 2\", y=ydata2, x=xdata)\n", | |
"chart2.add_serie(name=\"serie 3\", y=ydata3, x=xdata)\n", | |
"chart2.buildhtml()\n", | |
"chart2" | |
], | |
"language": "python", | |
"metadata": {}, | |
"outputs": [ | |
{ | |
"html": [ | |
"<div id=\"stackedareachart\"><svg style=\"height:450px;\"></svg></div>\n" | |
], | |
"metadata": {}, | |
"output_type": "pyout", | |
"prompt_number": 9, | |
"text": [ | |
"<nvd3.stackedAreaChart.stackedAreaChart at 0x2b177d02a450>" | |
] | |
} | |
], | |
"prompt_number": 9 | |
}, | |
{ | |
"cell_type": "code", | |
"collapsed": false, | |
"input": [], | |
"language": "python", | |
"metadata": {}, | |
"outputs": [], | |
"prompt_number": 2 | |
} | |
], | |
"metadata": {} | |
} | |
] | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment