{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "Highstock Demos\n", "================\n", "52,000 points with data grouping: http://www.highcharts.com/stock/demo/data-grouping\n", "-------------------------------------------------------------------------------------" ] }, { "cell_type": "code", "execution_count": 1, "metadata": { "collapsed": false }, "outputs": [ { "data": { "text/html": [ "" ], "text/plain": [ "" ] }, "execution_count": 1, "metadata": {}, "output_type": "execute_result" } ], "source": [ "from highcharts import Highstock\n", "from highcharts.highstock.highstock_helper import jsonp_loader\n", "H = Highstock()\n", "\n", "data_url = 'http://www.highcharts.com/samples/data/jsonp.php?filename=large-dataset.json&callback=?'\n", "data = jsonp_loader(data_url, sub_d = r'(\\/\\*.*\\*\\/)')\n", "\n", "H.add_data_set(data['data'], 'line', 'Temperature', pointStart = data['pointStart'],\n", " pointInterval = data['pointInterval'],\n", " tooltip = {\n", " 'valueDecimals': 1,\n", " 'valueSuffix': u'°C'\n", " })\n", "\n", "options = {\n", " 'chart': {\n", " 'zoomType': 'x'\n", " },\n", "\n", " 'rangeSelector': {\n", "\n", " 'buttons': [{\n", " 'type': 'day',\n", " 'count': 3,\n", " 'text': '3d'\n", " }, {\n", " 'type': 'week',\n", " 'count': 1,\n", " 'text': '1w'\n", " }, {\n", " 'type': 'month',\n", " 'count': 1,\n", " 'text': '1m'\n", " }, {\n", " 'type': 'month',\n", " 'count': 6,\n", " 'text': '6m'\n", " }, {\n", " 'type': 'year',\n", " 'count': 1,\n", " 'text': '1y'\n", " }, {\n", " 'type': 'all',\n", " 'text': 'All'\n", " }],\n", " 'selected': 3\n", " },\n", "\n", " 'yAxis': {\n", " 'title': {\n", " 'text': u'Temperature (°C)'\n", " }\n", " },\n", "\n", " 'title': {\n", " 'text': 'Hourly temperatures in Vik i Sogn, Norway, 2009-2015'\n", " },\n", "\n", "}\n", "\n", "H.set_dict_options(options)\n", "\n", "H" ] } ], "metadata": { "kernelspec": { "display_name": "Python 2", "language": "python", "name": "python2" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 2 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython2", "version": "2.7.6" } }, "nbformat": 4, "nbformat_minor": 0 }