├── src └── __version__.py ├── highcharts-maps ├── map-data │ ├── logfile.txt │ ├── async_map_data.py │ └── async-map-data.ipynb ├── input-formats │ ├── geojson.ipynb │ └── topojson.ipynb ├── python-features │ └── from-geopandas.ipynb └── heatmaps │ ├── mapbubble-chart.ipynb │ ├── heatmap-chart.ipynb │ └── temperatures.csv ├── .pre-commit-config.yaml ├── highcharts-core ├── python-features │ ├── from-pandas.csv │ └── from-pandas.ipynb ├── line-charts │ ├── tutorial-line.ipynb │ ├── inverted-spline.ipynb │ └── basic-line.ipynb ├── pie-charts │ ├── pie-with-legend.ipynb │ ├── donut-charts.ipynb │ └── pie-with-drilldown.ipynb ├── area-charts │ ├── area-range-with-missing-points.ipynb │ └── stacked-area.ipynb ├── column-and-bar-charts │ ├── basic-column.ipynb │ ├── basic-bar.ipynb │ ├── column-range.ipynb │ └── bar-pyramid.ipynb ├── dynamic-charts │ └── click-to-add-a-point.ipynb ├── other-chart-types │ ├── arcdiagram.ipynb │ └── network-graph.ipynb └── scatter-and-bubble-charts │ └── bubble-chart.ipynb ├── requirements.txt ├── HISTORY.rst ├── .gitignore ├── highcharts-gantt ├── python-features │ └── from-asana.ipynb └── gantt-charts │ └── basic-gantt-chart.ipynb ├── CODE_OF_CONDUCT.md ├── highcharts-stock ├── candlestick-charts │ ├── candlestick-chart.ipynb │ ├── hollow-candlestick-chart.ipynb │ └── hollow-candlestick-vs-heikin-ashi.ipynb ├── hlc-and-ohlc-charts │ ├── ohlc-chart.ipynb │ └── hlc-chart.ipynb └── stock-features │ ├── macd-and-pivot-points.ipynb │ └── stock-tools-gui.ipynb └── README.md /src/__version__.py: -------------------------------------------------------------------------------- 1 | __version__ = '1.1.0' 2 | -------------------------------------------------------------------------------- /highcharts-maps/map-data/logfile.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/highcharts-for-python/highcharts-for-python-demos/HEAD/highcharts-maps/map-data/logfile.txt -------------------------------------------------------------------------------- /.pre-commit-config.yaml: -------------------------------------------------------------------------------- 1 | repos: 2 | - repo: local 3 | hooks: 4 | - id: jupyter-nb-clear-output 5 | name: jupyter-nb-clear-output 6 | files: .*/.*/.*\.ipynb 7 | stages: [commit] 8 | language: system 9 | entry: jupyter-nbconvert --ClearOutputPreprocessor.enabled=True --inplace 10 | -------------------------------------------------------------------------------- /highcharts-core/python-features/from-pandas.csv: -------------------------------------------------------------------------------- 1 | Installation & Developers,Manufacturing,Sales & Distribution,Operations & Maintenance,Other 2 | 43934,24916,11744,,21908 3 | 48656,37941,30000,,5548 4 | 65165,29742,16005,,8105 5 | 81827,29851,19771,,11248 6 | 112143,32490,20185,,8989 7 | 142383,30282,24377,,11816 8 | 171533,38121,32147,,18274 9 | 165174,36885,30912,,17300 10 | 155157,33726,29243,11164,13053 11 | 161454,34243,29213,11218,11906 12 | 154610,31050,25663,10077,10073 13 | -------------------------------------------------------------------------------- /requirements.txt: -------------------------------------------------------------------------------- 1 | asana==3.2.0 2 | esprima==4.0.1 3 | geojson==3.0.1 4 | geopandas==0.12.2 5 | highcharts-core>=1.0.0 6 | highcharts-stock>=1.0.0 7 | highcharts-maps>=1.0.0 8 | highcharts_gantt>=1.0.0 9 | jira==3.5.0 10 | jupyterlab==3.6.1 11 | monday==1.3.3 12 | pandas==1.5.3 13 | pre-commit==3.2.2 14 | python-dotenv==1.0.0 15 | pytz==2023.3 16 | requests==2.28.2 17 | shapely==2.0.1 18 | Sphinx==6.1.3 19 | sphinx-rtd-theme==1.2.0 20 | sphinx-tabs==3.4.1 21 | sphinx-toolbox==3.4.0 22 | topojson==1.5 23 | urllib3==1.26.14 24 | validator-collection==1.5.0 25 | -------------------------------------------------------------------------------- /HISTORY.rst: -------------------------------------------------------------------------------- 1 | Release 1.1.0 2 | ========================================= 3 | 4 | * Added an additional demo. 5 | * Updated ``requirements.txt`` to require later versions of the Highcharts for Python toolkit. 6 | * Added a (hopefully temporary!) warning to the README about the MyBinder service's stability 7 | issues. 8 | 9 | -------------- 10 | 11 | Release 1.0.0-rc2 12 | ========================================= 13 | 14 | * Added additional demos for Highcharts Stock for Python. 15 | * Added additional demos for Highcharts Maps for Python. 16 | * Added additional demos for Highcharts Gantt for Python. 17 | * Updated README. 18 | 19 | ---------- 20 | 21 | Release 1.0.0-rc1 22 | ========================================= 23 | 24 | * Preliminary set of demos, linked to a MyBinder.org binder. -------------------------------------------------------------------------------- /highcharts-core/line-charts/tutorial-line.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "markdown", 5 | "id": "c6dab5e1-7c58-4c71-a286-12cf985393aa", 6 | "metadata": {}, 7 | "source": [ 8 | "# Tutorial Line" 9 | ] 10 | }, 11 | { 12 | "cell_type": "code", 13 | "execution_count": null, 14 | "id": "d97fd530-4317-469a-8693-5aca0f487bc0", 15 | "metadata": { 16 | "tags": [] 17 | }, 18 | "outputs": [], 19 | "source": [ 20 | "from highcharts_core.chart import Chart\n", 21 | "from highcharts_core.options.series.area import LineSeries\n", 22 | "from highcharts_core.global_options.shared_options import SharedOptions\n", 23 | "\n", 24 | "my_chart = Chart(container = 'target_div',\n", 25 | " options = {\n", 26 | " 'series': [\n", 27 | " LineSeries(data = [0, 5, 3, 5])\n", 28 | " ]\n", 29 | " },\n", 30 | " variable_name = 'myChart')\n", 31 | "\n", 32 | "# Now this will render the contents of \"my_chart\" in your Jupyter Notebook\n", 33 | "my_chart.display()" 34 | ] 35 | }, 36 | { 37 | "cell_type": "code", 38 | "execution_count": null, 39 | "id": "d14e449a-5bd1-4bc3-96a9-78c3da46604f", 40 | "metadata": {}, 41 | "outputs": [], 42 | "source": [] 43 | } 44 | ], 45 | "metadata": { 46 | "kernelspec": { 47 | "display_name": "Python 3 (ipykernel)", 48 | "language": "python", 49 | "name": "python3" 50 | }, 51 | "language_info": { 52 | "codemirror_mode": { 53 | "name": "ipython", 54 | "version": 3 55 | }, 56 | "file_extension": ".py", 57 | "mimetype": "text/x-python", 58 | "name": "python", 59 | "nbconvert_exporter": "python", 60 | "pygments_lexer": "ipython3", 61 | "version": "3.10.5" 62 | } 63 | }, 64 | "nbformat": 4, 65 | "nbformat_minor": 5 66 | } 67 | -------------------------------------------------------------------------------- /highcharts-maps/map-data/async_map_data.py: -------------------------------------------------------------------------------- 1 | from highcharts_maps.constants import EnforcedNull 2 | from highcharts_maps.chart import Chart 3 | import requests 4 | import json 5 | 6 | response = requests.get('https://cdn.jsdelivr.net/gh/highcharts/highcharts@c116b6fa6948448/samples/data/us-counties-unemployment.json') 7 | data_as_str = response.text 8 | data_as_obj = json.loads(data_as_str) 9 | 10 | options = { 11 | 'chart': { 12 | 'map': 'https://code.highcharts.com/mapdata/countries/us/us-all-all.topo.json', 13 | 'borderWidth': 1, 14 | 'marginRight': 20 15 | }, 16 | 17 | 'title': { 18 | 'text': 'US Counties unemployment rates, January 2018' 19 | }, 20 | 21 | 'accessibility': { 22 | 'description': 'Demo showing a large dataset.' 23 | }, 24 | 25 | 'legend': { 26 | 'layout': 'vertical', 27 | 'align': 'right', 28 | 'floating': True, 29 | 'backgroundColor': 'rgba(255, 255, 255, 0.85)' 30 | }, 31 | 32 | 'mapNavigation': { 33 | 'enabled': True 34 | }, 35 | 36 | 'colorAxis': { 37 | 'min': 0, 38 | 'max': 25, 39 | 'tickInterval': 5, 40 | 'stops': [[0, '#F1EEF6'], [0.65, '#900037'], [1, '#500007']], 41 | 'labels': { 42 | 'format': '{value}%' 43 | } 44 | }, 45 | 46 | 'plotOptions': { 47 | 'mapline': { 48 | 'showInLegend': False, 49 | 'enableMouseTracking': False 50 | } 51 | }, 52 | 53 | 'series': [{ 54 | 'data': data_as_obj, 55 | 'joinBy': ['hc-key', 'code'], 56 | 'name': 'Unemployment rate', 57 | 'tooltip': { 58 | 'valueSuffix': '%' 59 | }, 60 | 'borderWidth': 0.5, 61 | 'states': { 62 | 'hover': { 63 | 'color': '#a4edba' 64 | } 65 | }, 66 | 'shadow': False, 67 | 'accessibility': { 68 | 'enabled': False 69 | }, 70 | 'type': 'map' 71 | }, { 72 | 'type': 'mapline', 73 | 'name': 'State borders', 74 | 'color': 'white', 75 | 'shadow': False, 76 | 'borderWidth': 2, 77 | 'accessibility': { 78 | 'enabled': False 79 | } 80 | }] 81 | } 82 | 83 | chart = Chart.from_options(options) 84 | chart.is_maps_chart = True 85 | 86 | chart.display() -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Byte-compiled / optimized / DLL files 2 | __pycache__/ 3 | *.py[cod] 4 | *$py.class 5 | 6 | # C extensions 7 | *.so 8 | 9 | # Distribution / packaging 10 | .Python 11 | build/ 12 | develop-eggs/ 13 | dist/ 14 | downloads/ 15 | eggs/ 16 | .eggs/ 17 | lib/ 18 | lib64/ 19 | parts/ 20 | sdist/ 21 | var/ 22 | wheels/ 23 | pip-wheel-metadata/ 24 | share/python-wheels/ 25 | *.egg-info/ 26 | .installed.cfg 27 | *.egg 28 | MANIFEST 29 | 30 | # PyInstaller 31 | # Usually these files are written by a python script from a template 32 | # before PyInstaller builds the exe, so as to inject date/other infos into it. 33 | *.manifest 34 | *.spec 35 | 36 | # Installer logs 37 | pip-log.txt 38 | pip-delete-this-directory.txt 39 | 40 | # Unit test / coverage reports 41 | htmlcov/ 42 | .tox/ 43 | .nox/ 44 | .coverage 45 | .coverage.* 46 | .cache 47 | nosetests.xml 48 | coverage.xml 49 | *.cover 50 | *.py,cover 51 | .hypothesis/ 52 | .pytest_cache/ 53 | 54 | # Translations 55 | *.mo 56 | *.pot 57 | 58 | # Django stuff: 59 | *.log 60 | local_settings.py 61 | db.sqlite3 62 | db.sqlite3-journal 63 | 64 | # Flask stuff: 65 | instance/ 66 | .webassets-cache 67 | 68 | # Scrapy stuff: 69 | .scrapy 70 | 71 | # Sphinx documentation 72 | docs/_build/ 73 | 74 | # PyBuilder 75 | target/ 76 | 77 | # Jupyter Notebook 78 | .ipynb_checkpoints 79 | 80 | # IPython 81 | profile_default/ 82 | ipython_config.py 83 | 84 | # pyenv 85 | .python-version 86 | 87 | # pipenv 88 | # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control. 89 | # However, in case of collaboration, if having platform-specific dependencies or dependencies 90 | # having no cross-platform support, pipenv may install dependencies that don't work, or not 91 | # install all needed dependencies. 92 | #Pipfile.lock 93 | 94 | # PEP 582; used by e.g. github.com/David-OConnor/pyflow 95 | __pypackages__/ 96 | 97 | # Celery stuff 98 | celerybeat-schedule 99 | celerybeat.pid 100 | 101 | # SageMath parsed files 102 | *.sage.py 103 | 104 | # Environments 105 | .env 106 | .venv 107 | env/ 108 | venv/ 109 | ENV/ 110 | env.bak/ 111 | venv.bak/ 112 | .py310/ 113 | 114 | # Spyder project settings 115 | .spyderproject 116 | .spyproject 117 | 118 | # Rope project settings 119 | .ropeproject 120 | 121 | # mkdocs documentation 122 | /site 123 | 124 | # mypy 125 | .mypy_cache/ 126 | .dmypy.json 127 | dmypy.json 128 | 129 | # Pyre type checker 130 | .pyre/ 131 | -------------------------------------------------------------------------------- /highcharts-gantt/python-features/from-asana.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "markdown", 5 | "id": "7bb0c2c9-3aa6-4243-83c7-366cd5e69138", 6 | "metadata": {}, 7 | "source": [ 8 | "# ``.from_asana()`` Demo\n", 9 | "This demonstrates the ``.from_asana()`` method which generates a Gantt chart from an Asana project." 10 | ] 11 | }, 12 | { 13 | "cell_type": "markdown", 14 | "id": "73d6b277-e09a-445a-aa15-5e1930fa6791", 15 | "metadata": {}, 16 | "source": [ 17 | "## Import Dependencies" 18 | ] 19 | }, 20 | { 21 | "cell_type": "code", 22 | "execution_count": null, 23 | "id": "11cad6ef-15d4-4d3d-a369-60f01483b83b", 24 | "metadata": {}, 25 | "outputs": [], 26 | "source": [ 27 | "import os\n", 28 | "from highcharts_gantt.chart import Chart\n", 29 | "from dotenv import load_dotenv\n", 30 | "\n", 31 | "## Load Environment Variables\n", 32 | "load_dotenv()" 33 | ] 34 | }, 35 | { 36 | "cell_type": "markdown", 37 | "id": "dd940927-5f6a-4638-8959-7bdfe184375e", 38 | "metadata": {}, 39 | "source": [ 40 | "## Assemble Chart" 41 | ] 42 | }, 43 | { 44 | "cell_type": "code", 45 | "execution_count": null, 46 | "id": "5844467b-ffeb-46bd-9657-010634cb6b7f", 47 | "metadata": {}, 48 | "outputs": [], 49 | "source": [ 50 | "project_gid = os.getenv('ASANA_PROJECT_GID', None)\n", 51 | "section_gid = os.getenv('ASANA_SECTION_GID', None)\n", 52 | "personal_access_token = os.getenv('ASANA_PERSONAL_ACCESS_TOKEN', None)\n", 53 | "\n", 54 | "kwargs = {}\n", 55 | "kwargs['project_gid'] = project_gid\n", 56 | "kwargs['section_gid'] = section_gid\n", 57 | "kwargs['personal_access_token'] = personal_access_token\n", 58 | "\n", 59 | "chart = Chart.from_asana(**kwargs)" 60 | ] 61 | }, 62 | { 63 | "cell_type": "markdown", 64 | "id": "34ff4dfd-a2d6-49bd-a1c7-ab500d4ce76a", 65 | "metadata": {}, 66 | "source": [ 67 | "## Display Chart" 68 | ] 69 | }, 70 | { 71 | "cell_type": "code", 72 | "execution_count": null, 73 | "id": "a2f63850-1889-49a4-a770-daf092e76beb", 74 | "metadata": {}, 75 | "outputs": [], 76 | "source": [ 77 | "chart.display()" 78 | ] 79 | }, 80 | { 81 | "cell_type": "code", 82 | "execution_count": null, 83 | "id": "de334b24-78dd-49fb-934e-394ede18e60a", 84 | "metadata": {}, 85 | "outputs": [], 86 | "source": [] 87 | } 88 | ], 89 | "metadata": { 90 | "kernelspec": { 91 | "display_name": "Python 3 (ipykernel)", 92 | "language": "python", 93 | "name": "python3" 94 | }, 95 | "language_info": { 96 | "codemirror_mode": { 97 | "name": "ipython", 98 | "version": 3 99 | }, 100 | "file_extension": ".py", 101 | "mimetype": "text/x-python", 102 | "name": "python", 103 | "nbconvert_exporter": "python", 104 | "pygments_lexer": "ipython3", 105 | "version": "3.10.5" 106 | } 107 | }, 108 | "nbformat": 4, 109 | "nbformat_minor": 5 110 | } 111 | -------------------------------------------------------------------------------- /CODE_OF_CONDUCT.md: -------------------------------------------------------------------------------- 1 | # Contributor Covenant Code of Conduct 2 | 3 | ## Our Pledge 4 | 5 | In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation. 6 | 7 | ## Our Standards 8 | 9 | Examples of behavior that contributes to creating a positive environment include: 10 | 11 | * Using welcoming and inclusive language 12 | * Being respectful of differing viewpoints and experiences 13 | * Gracefully accepting constructive criticism 14 | * Focusing on what is best for the community 15 | * Showing empathy towards other community members 16 | 17 | Examples of unacceptable behavior by participants include: 18 | 19 | * The use of sexualized language or imagery and unwelcome sexual attention or advances 20 | * Trolling, insulting/derogatory comments, and personal or political attacks 21 | * Public or private harassment 22 | * Publishing others' private information, such as a physical or electronic address, without explicit permission 23 | * Other conduct which could reasonably be considered inappropriate in a professional setting 24 | 25 | ## Our Responsibilities 26 | 27 | Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior. 28 | 29 | Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful. 30 | 31 | ## Scope 32 | 33 | This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers. 34 | 35 | ## Enforcement 36 | 37 | Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at software@insightindustry.com. The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately. 38 | 39 | Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership. 40 | 41 | ## Attribution 42 | 43 | This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at [http://contributor-covenant.org/version/1/4][version] 44 | 45 | [homepage]: http://contributor-covenant.org 46 | [version]: http://contributor-covenant.org/version/1/4/ 47 | -------------------------------------------------------------------------------- /highcharts-stock/candlestick-charts/candlestick-chart.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "markdown", 5 | "id": "a518f4fc-72a6-40ba-a109-b1ba91640e44", 6 | "metadata": {}, 7 | "source": [ 8 | "# Candlestick Chart\n", 9 | "Renders a Candlestick chart of the AAPL (Apple) stock price for a given period of time." 10 | ] 11 | }, 12 | { 13 | "cell_type": "markdown", 14 | "id": "896b9416-fd0b-4d57-8048-1ede94014c7e", 15 | "metadata": {}, 16 | "source": [ 17 | "## Import Dependencies" 18 | ] 19 | }, 20 | { 21 | "cell_type": "code", 22 | "execution_count": null, 23 | "id": "c6f4b449-9437-4eb9-98fb-99c8e3141f62", 24 | "metadata": { 25 | "tags": [] 26 | }, 27 | "outputs": [], 28 | "source": [ 29 | "from highcharts_stock.chart import Chart\n", 30 | "from highcharts_stock.options.series.candlestick import CandlestickSeries\n", 31 | "import requests" 32 | ] 33 | }, 34 | { 35 | "cell_type": "markdown", 36 | "id": "1ec75703-f9f8-4c54-bdac-5e027780e9f3", 37 | "metadata": {}, 38 | "source": [ 39 | "## Retrieve Data" 40 | ] 41 | }, 42 | { 43 | "cell_type": "code", 44 | "execution_count": null, 45 | "id": "cb492896-d889-4908-98ab-b33dd0ddcf87", 46 | "metadata": { 47 | "tags": [] 48 | }, 49 | "outputs": [], 50 | "source": [ 51 | "stock_response = requests.get('https://demo-live-data.highcharts.com/aapl-ohlcv.json')\n", 52 | "stock_data = stock_response.text" 53 | ] 54 | }, 55 | { 56 | "cell_type": "markdown", 57 | "id": "e0fc56b4-47aa-453f-8c08-2550383b359a", 58 | "metadata": {}, 59 | "source": [ 60 | "## Assemble Options" 61 | ] 62 | }, 63 | { 64 | "cell_type": "code", 65 | "execution_count": null, 66 | "id": "a2bd4550-d823-484f-93bc-1daad7ee1e85", 67 | "metadata": { 68 | "tags": [] 69 | }, 70 | "outputs": [], 71 | "source": [ 72 | "as_dict = {\n", 73 | " 'range_selector': {\n", 74 | " 'selected': 2\n", 75 | " },\n", 76 | " 'title': {\n", 77 | " 'text': 'AAPL Stock Price'\n", 78 | " },\n", 79 | " 'navigator': {\n", 80 | " 'enabled': True\n", 81 | " },\n", 82 | " 'series': [\n", 83 | " {\n", 84 | " 'type': 'candlestick',\n", 85 | " 'name': 'AAPL Stock Price',\n", 86 | " 'data': stock_data\n", 87 | " }\n", 88 | " ]\n", 89 | "}" 90 | ] 91 | }, 92 | { 93 | "cell_type": "markdown", 94 | "id": "57eb864d-43ae-4c6a-8b80-66d8812e8899", 95 | "metadata": {}, 96 | "source": [ 97 | "## Assemble and Display Chart" 98 | ] 99 | }, 100 | { 101 | "cell_type": "code", 102 | "execution_count": null, 103 | "id": "814e9ed9-e70d-4891-8048-e75a86e55c82", 104 | "metadata": { 105 | "tags": [] 106 | }, 107 | "outputs": [], 108 | "source": [ 109 | "chart = Chart.from_options(as_dict)\n", 110 | "chart.display()" 111 | ] 112 | }, 113 | { 114 | "cell_type": "code", 115 | "execution_count": null, 116 | "id": "25abb79d-ca39-4e32-91c5-e176dbffe846", 117 | "metadata": {}, 118 | "outputs": [], 119 | "source": [] 120 | } 121 | ], 122 | "metadata": { 123 | "kernelspec": { 124 | "display_name": "Python 3 (ipykernel)", 125 | "language": "python", 126 | "name": "python3" 127 | }, 128 | "language_info": { 129 | "codemirror_mode": { 130 | "name": "ipython", 131 | "version": 3 132 | }, 133 | "file_extension": ".py", 134 | "mimetype": "text/x-python", 135 | "name": "python", 136 | "nbconvert_exporter": "python", 137 | "pygments_lexer": "ipython3", 138 | "version": "3.10.5" 139 | } 140 | }, 141 | "nbformat": 4, 142 | "nbformat_minor": 5 143 | } 144 | -------------------------------------------------------------------------------- /highcharts-stock/candlestick-charts/hollow-candlestick-chart.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "markdown", 5 | "id": "a518f4fc-72a6-40ba-a109-b1ba91640e44", 6 | "metadata": {}, 7 | "source": [ 8 | "# Hollow Candlestick Chart\n", 9 | "Renders a Hollow Candlestick chart of the AAPL (Apple) stock price for a given period of time." 10 | ] 11 | }, 12 | { 13 | "cell_type": "markdown", 14 | "id": "896b9416-fd0b-4d57-8048-1ede94014c7e", 15 | "metadata": {}, 16 | "source": [ 17 | "## Import Dependencies" 18 | ] 19 | }, 20 | { 21 | "cell_type": "code", 22 | "execution_count": null, 23 | "id": "c6f4b449-9437-4eb9-98fb-99c8e3141f62", 24 | "metadata": { 25 | "tags": [] 26 | }, 27 | "outputs": [], 28 | "source": [ 29 | "from highcharts_stock.chart import Chart\n", 30 | "from highcharts_stock.options.series.candlestick import HollowCandlestickSeries\n", 31 | "import requests" 32 | ] 33 | }, 34 | { 35 | "cell_type": "markdown", 36 | "id": "1ec75703-f9f8-4c54-bdac-5e027780e9f3", 37 | "metadata": {}, 38 | "source": [ 39 | "## Retrieve Data" 40 | ] 41 | }, 42 | { 43 | "cell_type": "code", 44 | "execution_count": null, 45 | "id": "cb492896-d889-4908-98ab-b33dd0ddcf87", 46 | "metadata": { 47 | "tags": [] 48 | }, 49 | "outputs": [], 50 | "source": [ 51 | "stock_response = requests.get('https://demo-live-data.highcharts.com/aapl-ohlcv.json')\n", 52 | "stock_data = stock_response.text" 53 | ] 54 | }, 55 | { 56 | "cell_type": "markdown", 57 | "id": "e0fc56b4-47aa-453f-8c08-2550383b359a", 58 | "metadata": {}, 59 | "source": [ 60 | "## Assemble Options" 61 | ] 62 | }, 63 | { 64 | "cell_type": "code", 65 | "execution_count": null, 66 | "id": "a2bd4550-d823-484f-93bc-1daad7ee1e85", 67 | "metadata": { 68 | "tags": [] 69 | }, 70 | "outputs": [], 71 | "source": [ 72 | "as_dict = {\n", 73 | " 'range_selector': {\n", 74 | " 'selected': 2\n", 75 | " },\n", 76 | " 'title': {\n", 77 | " 'text': 'AAPL Stock Price'\n", 78 | " },\n", 79 | " 'navigator': {\n", 80 | " 'enabled': True\n", 81 | " },\n", 82 | " 'series': [\n", 83 | " {\n", 84 | " 'type': 'hollowcandlestick',\n", 85 | " 'name': 'AAPL Stock Price',\n", 86 | " 'data': stock_data\n", 87 | " }\n", 88 | " ]\n", 89 | "}" 90 | ] 91 | }, 92 | { 93 | "cell_type": "markdown", 94 | "id": "57eb864d-43ae-4c6a-8b80-66d8812e8899", 95 | "metadata": {}, 96 | "source": [ 97 | "## Assemble and Display Chart" 98 | ] 99 | }, 100 | { 101 | "cell_type": "code", 102 | "execution_count": null, 103 | "id": "814e9ed9-e70d-4891-8048-e75a86e55c82", 104 | "metadata": { 105 | "tags": [] 106 | }, 107 | "outputs": [], 108 | "source": [ 109 | "chart = Chart.from_options(as_dict)\n", 110 | "chart.display()" 111 | ] 112 | }, 113 | { 114 | "cell_type": "code", 115 | "execution_count": null, 116 | "id": "25abb79d-ca39-4e32-91c5-e176dbffe846", 117 | "metadata": {}, 118 | "outputs": [], 119 | "source": [] 120 | } 121 | ], 122 | "metadata": { 123 | "kernelspec": { 124 | "display_name": "Python 3 (ipykernel)", 125 | "language": "python", 126 | "name": "python3" 127 | }, 128 | "language_info": { 129 | "codemirror_mode": { 130 | "name": "ipython", 131 | "version": 3 132 | }, 133 | "file_extension": ".py", 134 | "mimetype": "text/x-python", 135 | "name": "python", 136 | "nbconvert_exporter": "python", 137 | "pygments_lexer": "ipython3", 138 | "version": "3.10.5" 139 | } 140 | }, 141 | "nbformat": 4, 142 | "nbformat_minor": 5 143 | } 144 | -------------------------------------------------------------------------------- /highcharts-stock/hlc-and-ohlc-charts/ohlc-chart.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "markdown", 5 | "id": "a518f4fc-72a6-40ba-a109-b1ba91640e44", 6 | "metadata": {}, 7 | "source": [ 8 | "# OHLC Chart\n", 9 | "Renders an OHLC (Open-High-Low-Close) chart of the AAPL (Apple) stock price for a given period of time." 10 | ] 11 | }, 12 | { 13 | "cell_type": "markdown", 14 | "id": "896b9416-fd0b-4d57-8048-1ede94014c7e", 15 | "metadata": {}, 16 | "source": [ 17 | "## Import Dependencies" 18 | ] 19 | }, 20 | { 21 | "cell_type": "code", 22 | "execution_count": null, 23 | "id": "c6f4b449-9437-4eb9-98fb-99c8e3141f62", 24 | "metadata": { 25 | "tags": [] 26 | }, 27 | "outputs": [], 28 | "source": [ 29 | "from highcharts_stock.chart import Chart\n", 30 | "from highcharts_stock.options.series.hlc import OHLCSeries\n", 31 | "import requests" 32 | ] 33 | }, 34 | { 35 | "cell_type": "markdown", 36 | "id": "1ec75703-f9f8-4c54-bdac-5e027780e9f3", 37 | "metadata": {}, 38 | "source": [ 39 | "## Retrieve Data" 40 | ] 41 | }, 42 | { 43 | "cell_type": "code", 44 | "execution_count": null, 45 | "id": "cb492896-d889-4908-98ab-b33dd0ddcf87", 46 | "metadata": { 47 | "tags": [] 48 | }, 49 | "outputs": [], 50 | "source": [ 51 | "stock_response = requests.get('https://demo-live-data.highcharts.com/aapl-ohlc.json')\n", 52 | "stock_data = stock_response.text" 53 | ] 54 | }, 55 | { 56 | "cell_type": "markdown", 57 | "id": "e0fc56b4-47aa-453f-8c08-2550383b359a", 58 | "metadata": {}, 59 | "source": [ 60 | "## Assemble Options" 61 | ] 62 | }, 63 | { 64 | "cell_type": "code", 65 | "execution_count": null, 66 | "id": "a2bd4550-d823-484f-93bc-1daad7ee1e85", 67 | "metadata": { 68 | "tags": [] 69 | }, 70 | "outputs": [], 71 | "source": [ 72 | "as_dict = {\n", 73 | " 'range_selector': {\n", 74 | " 'selected': 2\n", 75 | " },\n", 76 | " 'title': {\n", 77 | " 'text': 'AAPL Stock Price'\n", 78 | " },\n", 79 | " 'series': [\n", 80 | " {\n", 81 | " 'type': 'ohlc',\n", 82 | " 'name': 'AAPL Stock Price',\n", 83 | " 'data': stock_data,\n", 84 | " 'data_grouping': {\n", 85 | " 'units': [[\n", 86 | " 'week',\n", 87 | " [1]\n", 88 | " ],\n", 89 | " [\n", 90 | " 'month',\n", 91 | " [1, 2, 3, 4, 6]\n", 92 | " ]]\n", 93 | " }\n", 94 | " }\n", 95 | " ]\n", 96 | "}" 97 | ] 98 | }, 99 | { 100 | "cell_type": "markdown", 101 | "id": "57eb864d-43ae-4c6a-8b80-66d8812e8899", 102 | "metadata": {}, 103 | "source": [ 104 | "## Assemble and Display Chart" 105 | ] 106 | }, 107 | { 108 | "cell_type": "code", 109 | "execution_count": null, 110 | "id": "814e9ed9-e70d-4891-8048-e75a86e55c82", 111 | "metadata": { 112 | "tags": [] 113 | }, 114 | "outputs": [], 115 | "source": [ 116 | "chart = Chart.from_options(as_dict)\n", 117 | "chart.display()" 118 | ] 119 | }, 120 | { 121 | "cell_type": "code", 122 | "execution_count": null, 123 | "id": "25abb79d-ca39-4e32-91c5-e176dbffe846", 124 | "metadata": {}, 125 | "outputs": [], 126 | "source": [] 127 | } 128 | ], 129 | "metadata": { 130 | "kernelspec": { 131 | "display_name": "Python 3 (ipykernel)", 132 | "language": "python", 133 | "name": "python3" 134 | }, 135 | "language_info": { 136 | "codemirror_mode": { 137 | "name": "ipython", 138 | "version": 3 139 | }, 140 | "file_extension": ".py", 141 | "mimetype": "text/x-python", 142 | "name": "python", 143 | "nbconvert_exporter": "python", 144 | "pygments_lexer": "ipython3", 145 | "version": "3.10.5" 146 | } 147 | }, 148 | "nbformat": 4, 149 | "nbformat_minor": 5 150 | } 151 | -------------------------------------------------------------------------------- /highcharts-core/pie-charts/pie-with-legend.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "markdown", 5 | "id": "0c26872a-fc19-4f08-9fd9-ce0b0d961f27", 6 | "metadata": {}, 7 | "source": [ 8 | "# Pie with Legend\n", 9 | "This pie chart shows how the chart legend can be used to provide information about the individual slices." 10 | ] 11 | }, 12 | { 13 | "cell_type": "markdown", 14 | "id": "6b461423-bdfe-46fd-ac5e-89a8191948e5", 15 | "metadata": {}, 16 | "source": [ 17 | "## Import Dependencies" 18 | ] 19 | }, 20 | { 21 | "cell_type": "code", 22 | "execution_count": null, 23 | "id": "6ebbd6b7-cd27-4304-9d60-5e5cb2950063", 24 | "metadata": {}, 25 | "outputs": [], 26 | "source": [ 27 | "from highcharts_core.chart import Chart\n", 28 | "from highcharts_core.options import HighchartsOptions" 29 | ] 30 | }, 31 | { 32 | "cell_type": "markdown", 33 | "id": "a07d8167-8441-4d14-97e6-f40983f37278", 34 | "metadata": {}, 35 | "source": [ 36 | "## Configure Options" 37 | ] 38 | }, 39 | { 40 | "cell_type": "code", 41 | "execution_count": null, 42 | "id": "2d4b0bda-3c20-4af7-bf76-caff71606fed", 43 | "metadata": {}, 44 | "outputs": [], 45 | "source": [ 46 | "options_as_str = \"\"\"{\n", 47 | " chart: {\n", 48 | " plotShadow: false,\n", 49 | " type: 'pie'\n", 50 | " },\n", 51 | " title: {\n", 52 | " text: 'Browser market shares in March, 2022',\n", 53 | " align: 'left'\n", 54 | " },\n", 55 | " tooltip: {\n", 56 | " pointFormat: '{series.name}: {point.percentage:.1f}%'\n", 57 | " },\n", 58 | " accessibility: {\n", 59 | " point: {\n", 60 | " valueSuffix: '%'\n", 61 | " }\n", 62 | " },\n", 63 | " plotOptions: {\n", 64 | " pie: {\n", 65 | " allowPointSelect: true,\n", 66 | " cursor: 'pointer',\n", 67 | " dataLabels: {\n", 68 | " enabled: false\n", 69 | " },\n", 70 | " showInLegend: true\n", 71 | " }\n", 72 | " },\n", 73 | " series: [{\n", 74 | " name: 'Brands',\n", 75 | " colorByPoint: true,\n", 76 | " data: [{\n", 77 | " name: 'Chrome',\n", 78 | " y: 74.77,\n", 79 | " sliced: true,\n", 80 | " selected: true\n", 81 | " }, {\n", 82 | " name: 'Edge',\n", 83 | " y: 12.82\n", 84 | " }, {\n", 85 | " name: 'Firefox',\n", 86 | " y: 4.63\n", 87 | " }, {\n", 88 | " name: 'Safari',\n", 89 | " y: 2.44\n", 90 | " }, {\n", 91 | " name: 'Internet Explorer',\n", 92 | " y: 2.02\n", 93 | " }, {\n", 94 | " name: 'Other',\n", 95 | " y: 3.28\n", 96 | " }]\n", 97 | " }]\n", 98 | "}\"\"\"\n", 99 | "options = HighchartsOptions.from_js_literal(options_as_str)" 100 | ] 101 | }, 102 | { 103 | "cell_type": "code", 104 | "execution_count": null, 105 | "id": "71cd0e89-da09-4fa0-bdef-8ed5ce5db44a", 106 | "metadata": { 107 | "tags": [] 108 | }, 109 | "outputs": [], 110 | "source": [ 111 | "chart = Chart.from_options(options)\n", 112 | "chart.display()" 113 | ] 114 | }, 115 | { 116 | "cell_type": "code", 117 | "execution_count": null, 118 | "id": "c9526b0f-656c-4019-8e74-dd11ea37370e", 119 | "metadata": {}, 120 | "outputs": [], 121 | "source": [] 122 | } 123 | ], 124 | "metadata": { 125 | "kernelspec": { 126 | "display_name": "Python 3 (ipykernel)", 127 | "language": "python", 128 | "name": "python3" 129 | }, 130 | "language_info": { 131 | "codemirror_mode": { 132 | "name": "ipython", 133 | "version": 3 134 | }, 135 | "file_extension": ".py", 136 | "mimetype": "text/x-python", 137 | "name": "python", 138 | "nbconvert_exporter": "python", 139 | "pygments_lexer": "ipython3", 140 | "version": "3.10.5" 141 | } 142 | }, 143 | "nbformat": 4, 144 | "nbformat_minor": 5 145 | } 146 | -------------------------------------------------------------------------------- /highcharts-core/area-charts/area-range-with-missing-points.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "markdown", 5 | "id": "ece55170-2df8-4765-a5b3-8ea3fb0ed288", 6 | "metadata": {}, 7 | "source": [ 8 | "# Area Range with Missing Points\n", 9 | "An area chart showing a gap in the data. By default, Highcharts treats ``null`` values (modeled as ``constants.EnforcedNull`` in Highcharts for Python) as missing data, and will allow for gaps in datasets." 10 | ] 11 | }, 12 | { 13 | "cell_type": "markdown", 14 | "id": "f36d81fd-85d4-4717-b3e4-ee70512d070e", 15 | "metadata": {}, 16 | "source": [ 17 | "## Import Dependencies" 18 | ] 19 | }, 20 | { 21 | "cell_type": "code", 22 | "execution_count": null, 23 | "id": "a8033a30-4d65-46e0-9fb0-09e80fd2aa81", 24 | "metadata": {}, 25 | "outputs": [], 26 | "source": [ 27 | "from highcharts_core.chart import Chart\n", 28 | "from highcharts_core.constants import EnforcedNull\n", 29 | "import requests" 30 | ] 31 | }, 32 | { 33 | "cell_type": "markdown", 34 | "id": "26d654c8-50ca-4d0a-8fe5-3026939ea48a", 35 | "metadata": {}, 36 | "source": [ 37 | "## Configure Options" 38 | ] 39 | }, 40 | { 41 | "cell_type": "code", 42 | "execution_count": null, 43 | "id": "e06df9fa-ce1b-459e-9d2b-737f44daa3ce", 44 | "metadata": {}, 45 | "outputs": [], 46 | "source": [ 47 | "options = {\n", 48 | " 'chart': {\n", 49 | " 'type': 'area'\n", 50 | " },\n", 51 | " 'title': {\n", 52 | " 'text': \"Born persons, by boys' name\"\n", 53 | " },\n", 54 | " 'subtitle': {\n", 55 | " 'text': '* Missing data for Yasin in 2019',\n", 56 | " 'align': 'right',\n", 57 | " 'verticalAlign': 'bottom'\n", 58 | " },\n", 59 | " 'legend': {\n", 60 | " 'layout': 'vertical',\n", 61 | " 'align': 'left',\n", 62 | " 'verticalAlign': 'top',\n", 63 | " 'x': 150,\n", 64 | " 'y': 60,\n", 65 | " 'floating': True,\n", 66 | " 'borderWidth': 1,\n", 67 | " 'backgroundColor': '#FFFFFF'\n", 68 | " },\n", 69 | " 'yAxis': {\n", 70 | " 'title': {\n", 71 | " 'text': 'Amount'\n", 72 | " }\n", 73 | " },\n", 74 | " 'plotOptions': {\n", 75 | " 'series': {\n", 76 | " 'pointStart': 2014\n", 77 | " },\n", 78 | " 'area': {\n", 79 | " 'fillOpacity': 0.5\n", 80 | " }\n", 81 | " },\n", 82 | " 'credits': {\n", 83 | " 'enabled': False\n", 84 | " },\n", 85 | " 'series': [{\n", 86 | " 'name': 'Arvid',\n", 87 | " 'data': [10, 9, 11, 11, 8, 13, 12, 14]\n", 88 | " }, {\n", 89 | " 'name': 'Yasin',\n", 90 | " 'data': [13, 9, 10, 10, 8, EnforcedNull, 8, 6]\n", 91 | " }]\n", 92 | "}" 93 | ] 94 | }, 95 | { 96 | "cell_type": "markdown", 97 | "id": "48067fda-fcfb-4512-87b5-ea7654a95cee", 98 | "metadata": {}, 99 | "source": [ 100 | "## Assemble and Display Chart" 101 | ] 102 | }, 103 | { 104 | "cell_type": "code", 105 | "execution_count": null, 106 | "id": "f05d003c-a40f-4545-9a28-8f2e1c0f198e", 107 | "metadata": { 108 | "tags": [] 109 | }, 110 | "outputs": [], 111 | "source": [ 112 | "chart = Chart.from_options(options)\n", 113 | "chart.display()" 114 | ] 115 | }, 116 | { 117 | "cell_type": "code", 118 | "execution_count": null, 119 | "id": "26e6a34f-3eda-44f6-9991-1a6174454858", 120 | "metadata": {}, 121 | "outputs": [], 122 | "source": [] 123 | } 124 | ], 125 | "metadata": { 126 | "kernelspec": { 127 | "display_name": "Python 3 (ipykernel)", 128 | "language": "python", 129 | "name": "python3" 130 | }, 131 | "language_info": { 132 | "codemirror_mode": { 133 | "name": "ipython", 134 | "version": 3 135 | }, 136 | "file_extension": ".py", 137 | "mimetype": "text/x-python", 138 | "name": "python", 139 | "nbconvert_exporter": "python", 140 | "pygments_lexer": "ipython3", 141 | "version": "3.10.5" 142 | } 143 | }, 144 | "nbformat": 4, 145 | "nbformat_minor": 5 146 | } 147 | -------------------------------------------------------------------------------- /highcharts-stock/hlc-and-ohlc-charts/hlc-chart.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "markdown", 5 | "id": "a518f4fc-72a6-40ba-a109-b1ba91640e44", 6 | "metadata": {}, 7 | "source": [ 8 | "# HLC Chart\n", 9 | "Renders an HLC (High-Low-Close) chart of the AAPL (Apple) stock price for a given period of time." 10 | ] 11 | }, 12 | { 13 | "cell_type": "markdown", 14 | "id": "896b9416-fd0b-4d57-8048-1ede94014c7e", 15 | "metadata": {}, 16 | "source": [ 17 | "## Import Dependencies" 18 | ] 19 | }, 20 | { 21 | "cell_type": "code", 22 | "execution_count": null, 23 | "id": "c6f4b449-9437-4eb9-98fb-99c8e3141f62", 24 | "metadata": { 25 | "tags": [] 26 | }, 27 | "outputs": [], 28 | "source": [ 29 | "from highcharts_stock.chart import Chart\n", 30 | "from highcharts_stock.options.series.hlc import HLCSeries\n", 31 | "import requests" 32 | ] 33 | }, 34 | { 35 | "cell_type": "markdown", 36 | "id": "1ec75703-f9f8-4c54-bdac-5e027780e9f3", 37 | "metadata": {}, 38 | "source": [ 39 | "## Retrieve Data" 40 | ] 41 | }, 42 | { 43 | "cell_type": "code", 44 | "execution_count": null, 45 | "id": "cb492896-d889-4908-98ab-b33dd0ddcf87", 46 | "metadata": { 47 | "tags": [] 48 | }, 49 | "outputs": [], 50 | "source": [ 51 | "stock_response = requests.get('https://demo-live-data.highcharts.com/aapl-ohlc.json')\n", 52 | "stock_data = stock_response.text" 53 | ] 54 | }, 55 | { 56 | "cell_type": "markdown", 57 | "id": "e0fc56b4-47aa-453f-8c08-2550383b359a", 58 | "metadata": {}, 59 | "source": [ 60 | "## Assemble Options" 61 | ] 62 | }, 63 | { 64 | "cell_type": "code", 65 | "execution_count": null, 66 | "id": "a2bd4550-d823-484f-93bc-1daad7ee1e85", 67 | "metadata": { 68 | "tags": [] 69 | }, 70 | "outputs": [], 71 | "source": [ 72 | "as_dict = {\n", 73 | " 'range_selector': {\n", 74 | " 'selected': 2\n", 75 | " },\n", 76 | " 'title': {\n", 77 | " 'text': 'AAPL Stock Price'\n", 78 | " },\n", 79 | " 'series': [\n", 80 | " {\n", 81 | " 'type': 'hlc',\n", 82 | " 'name': 'AAPL Stock Price',\n", 83 | " 'use_ohlc_data': True,\n", 84 | " 'data': stock_data,\n", 85 | " 'accessibility': {\n", 86 | " 'point': {\n", 87 | " 'value_description_format': '{xDescription}. High: {point.high}, low: {point.low}, close: {point.close}.'\n", 88 | " }\n", 89 | " },\n", 90 | " 'data_grouping': {\n", 91 | " 'units': [[\n", 92 | " 'week',\n", 93 | " [1]\n", 94 | " ],\n", 95 | " [\n", 96 | " 'month',\n", 97 | " [1, 2, 3, 4, 6]\n", 98 | " ]]\n", 99 | " }\n", 100 | " }\n", 101 | " ]\n", 102 | "}" 103 | ] 104 | }, 105 | { 106 | "cell_type": "markdown", 107 | "id": "57eb864d-43ae-4c6a-8b80-66d8812e8899", 108 | "metadata": {}, 109 | "source": [ 110 | "## Assemble and Display Chart" 111 | ] 112 | }, 113 | { 114 | "cell_type": "code", 115 | "execution_count": null, 116 | "id": "814e9ed9-e70d-4891-8048-e75a86e55c82", 117 | "metadata": { 118 | "tags": [] 119 | }, 120 | "outputs": [], 121 | "source": [ 122 | "chart = Chart.from_options(as_dict)\n", 123 | "chart.display()" 124 | ] 125 | }, 126 | { 127 | "cell_type": "code", 128 | "execution_count": null, 129 | "id": "25abb79d-ca39-4e32-91c5-e176dbffe846", 130 | "metadata": {}, 131 | "outputs": [], 132 | "source": [] 133 | } 134 | ], 135 | "metadata": { 136 | "kernelspec": { 137 | "display_name": "Python 3 (ipykernel)", 138 | "language": "python", 139 | "name": "python3" 140 | }, 141 | "language_info": { 142 | "codemirror_mode": { 143 | "name": "ipython", 144 | "version": 3 145 | }, 146 | "file_extension": ".py", 147 | "mimetype": "text/x-python", 148 | "name": "python", 149 | "nbconvert_exporter": "python", 150 | "pygments_lexer": "ipython3", 151 | "version": "3.10.5" 152 | } 153 | }, 154 | "nbformat": 4, 155 | "nbformat_minor": 5 156 | } 157 | -------------------------------------------------------------------------------- /highcharts-core/area-charts/stacked-area.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "markdown", 5 | "id": "0e8dd158-ee17-4d09-af9f-7063befe8c85", 6 | "metadata": {}, 7 | "source": [ 8 | "# Stacked Area Chart\n", 9 | "A demo showing a stacked area chart, also sometimes referred to as a mountain chart. In a stacked chart, the data series values are added together to make up a total." 10 | ] 11 | }, 12 | { 13 | "cell_type": "markdown", 14 | "id": "53867965-78f2-4fb9-b970-df942a8e81ba", 15 | "metadata": {}, 16 | "source": [ 17 | "## Import Dependencies" 18 | ] 19 | }, 20 | { 21 | "cell_type": "code", 22 | "execution_count": null, 23 | "id": "0afd1804-2196-4b8d-9585-42ede12d7a3f", 24 | "metadata": {}, 25 | "outputs": [], 26 | "source": [ 27 | "from highcharts_core.chart import Chart" 28 | ] 29 | }, 30 | { 31 | "cell_type": "markdown", 32 | "id": "9b434d45-a9f7-4068-a598-b9c26fd14aca", 33 | "metadata": {}, 34 | "source": [ 35 | "## Configure Options and Series" 36 | ] 37 | }, 38 | { 39 | "cell_type": "code", 40 | "execution_count": null, 41 | "id": "061bc5eb-ddc2-4268-ac1d-62f05fafddf8", 42 | "metadata": {}, 43 | "outputs": [], 44 | "source": [ 45 | "options = {\n", 46 | " 'chart': {\n", 47 | " 'type': 'area'\n", 48 | " },\n", 49 | " 'title': {\n", 50 | " 'text': 'Greenhouse gases from Norwegian economic activity',\n", 51 | " 'align': 'left'\n", 52 | " },\n", 53 | " 'subtitle': {\n", 54 | " 'text': \"\"\"Source: SSB\"\"\",\n", 55 | " 'align': 'left'\n", 56 | " },\n", 57 | " 'yAxis': {\n", 58 | " 'title': {\n", 59 | " 'useHTML': True,\n", 60 | " 'text': 'Million tonnes CO2-equivalents'\n", 61 | " }\n", 62 | " },\n", 63 | " 'tooltip': {\n", 64 | " 'shared': True,\n", 65 | " 'headerFormat': '{point.key}
'\n", 66 | " },\n", 67 | " 'plotOptions': {\n", 68 | " 'series': {\n", 69 | " 'pointStart': 2012\n", 70 | " },\n", 71 | " 'area': {\n", 72 | " 'stacking': 'normal',\n", 73 | " 'lineColor': '#666666',\n", 74 | " 'lineWidth': 1,\n", 75 | " 'marker': {\n", 76 | " 'lineWidth': 1,\n", 77 | " 'lineColor': '#666666'\n", 78 | " }\n", 79 | " }\n", 80 | " },\n", 81 | " 'series': [{\n", 82 | " 'name': 'Ocean transport',\n", 83 | " 'data': [13234, 12729, 11533, 17798, 10398, 12811, 15483, 16196, 16214]\n", 84 | " }, {\n", 85 | " 'name': 'Households',\n", 86 | " 'data': [6685, 6535, 6389, 6384, 6251, 5725, 5631, 5047, 5039]\n", 87 | "\n", 88 | " }, {\n", 89 | " 'name': 'Agriculture and hunting',\n", 90 | " 'data': [4752, 4820, 4877, 4925, 5006, 4976, 4946, 4911, 4913]\n", 91 | " }, {\n", 92 | " 'name': 'Air transport',\n", 93 | " 'data': [3164, 3541, 3898, 4115, 3388, 3569, 3887, 4593, 1550]\n", 94 | "\n", 95 | " }, {\n", 96 | " 'name': 'Construction',\n", 97 | " 'data': [2019, 2189, 2150, 2217, 2175, 2257, 2344, 2176, 2186]\n", 98 | " }]\n", 99 | "}" 100 | ] 101 | }, 102 | { 103 | "cell_type": "markdown", 104 | "id": "d8d8d111-f770-4734-a81b-d9629e981706", 105 | "metadata": {}, 106 | "source": [ 107 | "## Assemble and Display Chart" 108 | ] 109 | }, 110 | { 111 | "cell_type": "code", 112 | "execution_count": null, 113 | "id": "74baf4b3-b080-49a3-9ef4-73edbecbb599", 114 | "metadata": { 115 | "tags": [] 116 | }, 117 | "outputs": [], 118 | "source": [ 119 | "chart = Chart.from_options(options)\n", 120 | "chart.display()" 121 | ] 122 | } 123 | ], 124 | "metadata": { 125 | "kernelspec": { 126 | "display_name": "Python 3 (ipykernel)", 127 | "language": "python", 128 | "name": "python3" 129 | }, 130 | "language_info": { 131 | "codemirror_mode": { 132 | "name": "ipython", 133 | "version": 3 134 | }, 135 | "file_extension": ".py", 136 | "mimetype": "text/x-python", 137 | "name": "python", 138 | "nbconvert_exporter": "python", 139 | "pygments_lexer": "ipython3", 140 | "version": "3.10.5" 141 | } 142 | }, 143 | "nbformat": 4, 144 | "nbformat_minor": 5 145 | } 146 | -------------------------------------------------------------------------------- /highcharts-core/column-and-bar-charts/basic-column.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "markdown", 5 | "id": "0c26872a-fc19-4f08-9fd9-ce0b0d961f27", 6 | "metadata": {}, 7 | "source": [ 8 | "# Basic Column Chart\n", 9 | "Bar chart showing vertical columns." 10 | ] 11 | }, 12 | { 13 | "cell_type": "markdown", 14 | "id": "6b461423-bdfe-46fd-ac5e-89a8191948e5", 15 | "metadata": {}, 16 | "source": [ 17 | "## Import Dependencies" 18 | ] 19 | }, 20 | { 21 | "cell_type": "code", 22 | "execution_count": null, 23 | "id": "6ebbd6b7-cd27-4304-9d60-5e5cb2950063", 24 | "metadata": {}, 25 | "outputs": [], 26 | "source": [ 27 | "from highcharts_core.chart import Chart\n", 28 | "from highcharts_core.options import HighchartsOptions" 29 | ] 30 | }, 31 | { 32 | "cell_type": "markdown", 33 | "id": "a07d8167-8441-4d14-97e6-f40983f37278", 34 | "metadata": {}, 35 | "source": [ 36 | "## Configure Options" 37 | ] 38 | }, 39 | { 40 | "cell_type": "code", 41 | "execution_count": null, 42 | "id": "2d4b0bda-3c20-4af7-bf76-caff71606fed", 43 | "metadata": {}, 44 | "outputs": [], 45 | "source": [ 46 | "options_as_str = \"\"\"{\n", 47 | " chart: {\n", 48 | " type: 'column'\n", 49 | " },\n", 50 | " title: {\n", 51 | " text: 'Monthly Average Rainfall'\n", 52 | " },\n", 53 | " subtitle: {\n", 54 | " text: 'Source: WorldClimate.com'\n", 55 | " },\n", 56 | " xAxis: {\n", 57 | " categories: [\n", 58 | " 'Jan',\n", 59 | " 'Feb',\n", 60 | " 'Mar',\n", 61 | " 'Apr',\n", 62 | " 'May',\n", 63 | " 'Jun',\n", 64 | " 'Jul',\n", 65 | " 'Aug',\n", 66 | " 'Sep',\n", 67 | " 'Oct',\n", 68 | " 'Nov',\n", 69 | " 'Dec'\n", 70 | " ],\n", 71 | " crosshair: true\n", 72 | " },\n", 73 | " yAxis: {\n", 74 | " min: 0,\n", 75 | " title: {\n", 76 | " text: 'Rainfall (mm)'\n", 77 | " }\n", 78 | " },\n", 79 | " tooltip: {\n", 80 | " headerFormat: '{point.key}',\n", 81 | " pointFormat: '',\n", 82 | " footerFormat: '
{series.name}: {point.y:.1f} mm
',\n", 83 | " shared: true,\n", 84 | " useHTML: true\n", 85 | " },\n", 86 | " plotOptions: {\n", 87 | " column: {\n", 88 | " pointPadding: 0.2,\n", 89 | " borderWidth: 0\n", 90 | " }\n", 91 | " },\n", 92 | " series: [{\n", 93 | " name: 'Tokyo',\n", 94 | " data: [49.9, 71.5, 106.4, 129.2, 144.0, 176.0, 135.6, 148.5, 216.4,\n", 95 | " 194.1, 95.6, 54.4]\n", 96 | "\n", 97 | " }, {\n", 98 | " name: 'New York',\n", 99 | " data: [83.6, 78.8, 98.5, 93.4, 106.0, 84.5, 105.0, 104.3, 91.2, 83.5,\n", 100 | " 106.6, 92.3]\n", 101 | "\n", 102 | " }, {\n", 103 | " name: 'London',\n", 104 | " data: [48.9, 38.8, 39.3, 41.4, 47.0, 48.3, 59.0, 59.6, 52.4, 65.2, 59.3,\n", 105 | " 51.2]\n", 106 | "\n", 107 | " }, {\n", 108 | " name: 'Berlin',\n", 109 | " data: [42.4, 33.2, 34.5, 39.7, 52.6, 75.5, 57.4, 60.4, 47.6, 39.1, 46.8,\n", 110 | " 51.1]\n", 111 | "\n", 112 | " }]\n", 113 | "}\"\"\"\n", 114 | "options = HighchartsOptions.from_js_literal(options_as_str)" 115 | ] 116 | }, 117 | { 118 | "cell_type": "code", 119 | "execution_count": null, 120 | "id": "71cd0e89-da09-4fa0-bdef-8ed5ce5db44a", 121 | "metadata": { 122 | "tags": [] 123 | }, 124 | "outputs": [], 125 | "source": [ 126 | "chart = Chart.from_options(options)\n", 127 | "chart.display()" 128 | ] 129 | } 130 | ], 131 | "metadata": { 132 | "kernelspec": { 133 | "display_name": "Python 3 (ipykernel)", 134 | "language": "python", 135 | "name": "python3" 136 | }, 137 | "language_info": { 138 | "codemirror_mode": { 139 | "name": "ipython", 140 | "version": 3 141 | }, 142 | "file_extension": ".py", 143 | "mimetype": "text/x-python", 144 | "name": "python", 145 | "nbconvert_exporter": "python", 146 | "pygments_lexer": "ipython3", 147 | "version": "3.10.5" 148 | } 149 | }, 150 | "nbformat": 4, 151 | "nbformat_minor": 5 152 | } 153 | -------------------------------------------------------------------------------- /highcharts-core/column-and-bar-charts/basic-bar.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "markdown", 5 | "id": "0c26872a-fc19-4f08-9fd9-ce0b0d961f27", 6 | "metadata": {}, 7 | "source": [ 8 | "# Basic Bar Chart\n", 9 | "Bar chart showing horizontal columns. This chart type is often\n", 10 | "beneficial for smaller screens, as the user can scroll through the data\n", 11 | "vertically, and axis labels are easy to read." 12 | ] 13 | }, 14 | { 15 | "cell_type": "markdown", 16 | "id": "6b461423-bdfe-46fd-ac5e-89a8191948e5", 17 | "metadata": {}, 18 | "source": [ 19 | "## Import Dependencies" 20 | ] 21 | }, 22 | { 23 | "cell_type": "code", 24 | "execution_count": null, 25 | "id": "6ebbd6b7-cd27-4304-9d60-5e5cb2950063", 26 | "metadata": {}, 27 | "outputs": [], 28 | "source": [ 29 | "from highcharts_core.chart import Chart\n", 30 | "from highcharts_core.options import HighchartsOptions" 31 | ] 32 | }, 33 | { 34 | "cell_type": "markdown", 35 | "id": "a07d8167-8441-4d14-97e6-f40983f37278", 36 | "metadata": {}, 37 | "source": [ 38 | "## Configure Options" 39 | ] 40 | }, 41 | { 42 | "cell_type": "code", 43 | "execution_count": null, 44 | "id": "2d4b0bda-3c20-4af7-bf76-caff71606fed", 45 | "metadata": {}, 46 | "outputs": [], 47 | "source": [ 48 | "options_as_str = \"\"\"{\n", 49 | " chart: {\n", 50 | " type: 'bar'\n", 51 | " },\n", 52 | " title: {\n", 53 | " text: 'Historic World Population by Region',\n", 54 | " align: 'left'\n", 55 | " },\n", 56 | " subtitle: {\n", 57 | " text: 'Source: Wikipedia.org',\n", 58 | " align: 'left'\n", 59 | " },\n", 60 | " xAxis: {\n", 61 | " categories: ['Africa', 'America', 'Asia', 'Europe', 'Oceania'],\n", 62 | " title: {\n", 63 | " text: null\n", 64 | " }\n", 65 | " },\n", 66 | " yAxis: {\n", 67 | " min: 0,\n", 68 | " title: {\n", 69 | " text: 'Population (millions)',\n", 70 | " align: 'high'\n", 71 | " },\n", 72 | " labels: {\n", 73 | " overflow: 'justify'\n", 74 | " }\n", 75 | " },\n", 76 | " tooltip: {\n", 77 | " valueSuffix: ' millions'\n", 78 | " },\n", 79 | " plotOptions: {\n", 80 | " bar: {\n", 81 | " dataLabels: {\n", 82 | " enabled: true\n", 83 | " }\n", 84 | " }\n", 85 | " },\n", 86 | " legend: {\n", 87 | " layout: 'vertical',\n", 88 | " align: 'right',\n", 89 | " verticalAlign: 'top',\n", 90 | " x: -40,\n", 91 | " y: 80,\n", 92 | " floating: true,\n", 93 | " borderWidth: 1,\n", 94 | " backgroundColor: '#FFFFFF',\n", 95 | " shadow: true\n", 96 | " },\n", 97 | " credits: {\n", 98 | " enabled: false\n", 99 | " },\n", 100 | " series: [{\n", 101 | " name: 'Year 1990',\n", 102 | " data: [631, 727, 3202, 721, 26]\n", 103 | " }, {\n", 104 | " name: 'Year 2000',\n", 105 | " data: [814, 841, 3714, 726, 31]\n", 106 | " }, {\n", 107 | " name: 'Year 2010',\n", 108 | " data: [1044, 944, 4170, 735, 40]\n", 109 | " }, {\n", 110 | " name: 'Year 2018',\n", 111 | " data: [1276, 1007, 4561, 746, 42]\n", 112 | " }]\n", 113 | "}\"\"\"\n", 114 | "options = HighchartsOptions.from_js_literal(options_as_str)" 115 | ] 116 | }, 117 | { 118 | "cell_type": "code", 119 | "execution_count": null, 120 | "id": "71cd0e89-da09-4fa0-bdef-8ed5ce5db44a", 121 | "metadata": { 122 | "tags": [] 123 | }, 124 | "outputs": [], 125 | "source": [ 126 | "chart = Chart.from_options(options)\n", 127 | "chart.display()" 128 | ] 129 | } 130 | ], 131 | "metadata": { 132 | "kernelspec": { 133 | "display_name": "Python 3 (ipykernel)", 134 | "language": "python", 135 | "name": "python3" 136 | }, 137 | "language_info": { 138 | "codemirror_mode": { 139 | "name": "ipython", 140 | "version": 3 141 | }, 142 | "file_extension": ".py", 143 | "mimetype": "text/x-python", 144 | "name": "python", 145 | "nbconvert_exporter": "python", 146 | "pygments_lexer": "ipython3", 147 | "version": "3.10.5" 148 | } 149 | }, 150 | "nbformat": 4, 151 | "nbformat_minor": 5 152 | } 153 | -------------------------------------------------------------------------------- /highcharts-stock/candlestick-charts/hollow-candlestick-vs-heikin-ashi.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "markdown", 5 | "id": "a518f4fc-72a6-40ba-a109-b1ba91640e44", 6 | "metadata": {}, 7 | "source": [ 8 | "# Hollow Candlestick vs Heikin Ashi Chart\n", 9 | "Compares a Hollow Candlestick visualization of the AAPL (Apple) stock price against a Heikin Ashi visualization of the AAPL stock price." 10 | ] 11 | }, 12 | { 13 | "cell_type": "markdown", 14 | "id": "896b9416-fd0b-4d57-8048-1ede94014c7e", 15 | "metadata": {}, 16 | "source": [ 17 | "## Import Dependencies" 18 | ] 19 | }, 20 | { 21 | "cell_type": "code", 22 | "execution_count": null, 23 | "id": "c6f4b449-9437-4eb9-98fb-99c8e3141f62", 24 | "metadata": { 25 | "tags": [] 26 | }, 27 | "outputs": [], 28 | "source": [ 29 | "from highcharts_stock.chart import Chart\n", 30 | "from highcharts_stock.options.series.candlestick import HollowCandlestickSeries\n", 31 | "from highcharts_stock.options.series.candlestick import HeikinAshiSeries\n", 32 | "import requests" 33 | ] 34 | }, 35 | { 36 | "cell_type": "markdown", 37 | "id": "1ec75703-f9f8-4c54-bdac-5e027780e9f3", 38 | "metadata": {}, 39 | "source": [ 40 | "## Retrieve Data" 41 | ] 42 | }, 43 | { 44 | "cell_type": "code", 45 | "execution_count": null, 46 | "id": "cb492896-d889-4908-98ab-b33dd0ddcf87", 47 | "metadata": { 48 | "tags": [] 49 | }, 50 | "outputs": [], 51 | "source": [ 52 | "stock_response = requests.get('https://demo-live-data.highcharts.com/aapl-ohlcv.json')\n", 53 | "stock_data = stock_response.text" 54 | ] 55 | }, 56 | { 57 | "cell_type": "markdown", 58 | "id": "e0fc56b4-47aa-453f-8c08-2550383b359a", 59 | "metadata": {}, 60 | "source": [ 61 | "## Assemble Options" 62 | ] 63 | }, 64 | { 65 | "cell_type": "code", 66 | "execution_count": null, 67 | "id": "a2bd4550-d823-484f-93bc-1daad7ee1e85", 68 | "metadata": { 69 | "tags": [] 70 | }, 71 | "outputs": [], 72 | "source": [ 73 | "as_dict = {\n", 74 | " 'range_selector': {\n", 75 | " 'selected': 1\n", 76 | " },\n", 77 | " 'title': {\n", 78 | " 'text': 'Candlestick and Heikin Ashi Comparison',\n", 79 | " 'align': 'left'\n", 80 | " },\n", 81 | " 'navigator': {\n", 82 | " 'enabled': True\n", 83 | " },\n", 84 | " 'y_axis': [\n", 85 | " {\n", 86 | " 'title': {\n", 87 | " 'text': 'Candlestick'\n", 88 | " },\n", 89 | " 'height': '50%'\n", 90 | " }, \n", 91 | " {\n", 92 | " 'title': {\n", 93 | " 'text': 'Heikin Ashi'\n", 94 | " },\n", 95 | " 'top': '50%',\n", 96 | " 'height': '50%',\n", 97 | " 'offset': 0\n", 98 | " }\n", 99 | " ],\n", 100 | " 'series': [\n", 101 | " {\n", 102 | " 'type': 'hollowcandlestick',\n", 103 | " 'name': 'AAPL Stock Price',\n", 104 | " 'data': stock_data\n", 105 | " },\n", 106 | " {\n", 107 | " 'type': 'heikinashi',\n", 108 | " 'name': 'Heikin Ashi',\n", 109 | " 'data': stock_data,\n", 110 | " 'y_axis': 1\n", 111 | " }\n", 112 | " ]\n", 113 | "}" 114 | ] 115 | }, 116 | { 117 | "cell_type": "markdown", 118 | "id": "57eb864d-43ae-4c6a-8b80-66d8812e8899", 119 | "metadata": {}, 120 | "source": [ 121 | "## Assemble and Display Chart" 122 | ] 123 | }, 124 | { 125 | "cell_type": "code", 126 | "execution_count": null, 127 | "id": "814e9ed9-e70d-4891-8048-e75a86e55c82", 128 | "metadata": { 129 | "tags": [] 130 | }, 131 | "outputs": [], 132 | "source": [ 133 | "chart = Chart.from_options(as_dict)\n", 134 | "chart.display()" 135 | ] 136 | }, 137 | { 138 | "cell_type": "code", 139 | "execution_count": null, 140 | "id": "25abb79d-ca39-4e32-91c5-e176dbffe846", 141 | "metadata": {}, 142 | "outputs": [], 143 | "source": [] 144 | } 145 | ], 146 | "metadata": { 147 | "kernelspec": { 148 | "display_name": "Python 3 (ipykernel)", 149 | "language": "python", 150 | "name": "python3" 151 | }, 152 | "language_info": { 153 | "codemirror_mode": { 154 | "name": "ipython", 155 | "version": 3 156 | }, 157 | "file_extension": ".py", 158 | "mimetype": "text/x-python", 159 | "name": "python", 160 | "nbconvert_exporter": "python", 161 | "pygments_lexer": "ipython3", 162 | "version": "3.10.5" 163 | } 164 | }, 165 | "nbformat": 4, 166 | "nbformat_minor": 5 167 | } 168 | -------------------------------------------------------------------------------- /highcharts-core/line-charts/inverted-spline.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "markdown", 5 | "id": "31939505-97c1-4609-a34c-2740493ddbbf", 6 | "metadata": {}, 7 | "source": [ 8 | "# Spline with Inverted Axes\n", 9 | "Spline charts are smoothed line charts, and this example\n", 10 | "shows an inverted spline chart. Inverting the chart means the\n", 11 | "X-axis is positioned as the vertical axis, and the Y-axis is\n", 12 | "positioned as the horizontal axis. This can be more intuitive\n", 13 | "for certain data sets, such as in this chart where the X-axis\n", 14 | "represents vertical altitude." 15 | ] 16 | }, 17 | { 18 | "cell_type": "markdown", 19 | "id": "5e403a63-9670-4b44-a1ff-e2971ac5d158", 20 | "metadata": {}, 21 | "source": [ 22 | "## Import Dependencies" 23 | ] 24 | }, 25 | { 26 | "cell_type": "code", 27 | "execution_count": null, 28 | "id": "257dc105-4a15-44af-ab3d-5bbe6239e026", 29 | "metadata": { 30 | "tags": [] 31 | }, 32 | "outputs": [], 33 | "source": [ 34 | "from highcharts_core.options import HighchartsOptions\n", 35 | "from highcharts_core.chart import Chart" 36 | ] 37 | }, 38 | { 39 | "cell_type": "markdown", 40 | "id": "b43b06ec-8c9e-418f-b1e4-d0b9829826cd", 41 | "metadata": {}, 42 | "source": [ 43 | "## Assemble Options" 44 | ] 45 | }, 46 | { 47 | "cell_type": "code", 48 | "execution_count": null, 49 | "id": "3e89a3d6-c1ae-4b85-b7a7-24fa3bcaffc7", 50 | "metadata": { 51 | "tags": [] 52 | }, 53 | "outputs": [], 54 | "source": [ 55 | "as_dict = {\n", 56 | " 'chart': {\n", 57 | " 'type': 'spline',\n", 58 | " 'inverted': True\n", 59 | " },\n", 60 | " 'title': {\n", 61 | " 'text': 'Atmosphere Temperature by Altitude',\n", 62 | " 'align': 'left'\n", 63 | " },\n", 64 | " 'subtitle': {\n", 65 | " 'text': 'According to the Standard Atmosphere Model',\n", 66 | " 'align': 'left'\n", 67 | " },\n", 68 | " 'xAxis': {\n", 69 | " 'reversed': False,\n", 70 | " 'title': {\n", 71 | " 'enabled': True,\n", 72 | " 'text': 'Altitude'\n", 73 | " },\n", 74 | " 'labels': {\n", 75 | " 'format': '{value} km'\n", 76 | " },\n", 77 | " 'accessibility': {\n", 78 | " 'rangeDescription': 'Range: 0 to 80 km.'\n", 79 | " },\n", 80 | " 'maxPadding': 0.05,\n", 81 | " 'showLastLabel': True\n", 82 | " },\n", 83 | " 'yAxis': {\n", 84 | " 'title': {\n", 85 | " 'text': 'Temperature'\n", 86 | " },\n", 87 | " 'labels': {\n", 88 | " 'format': '{value}°'\n", 89 | " },\n", 90 | " 'accessibility': {\n", 91 | " 'rangeDescription': 'Range: -90°C to 20°C.'\n", 92 | " },\n", 93 | " 'lineWidth': 2\n", 94 | " },\n", 95 | " 'legend': {\n", 96 | " 'enabled': False\n", 97 | " },\n", 98 | " 'tooltip': {\n", 99 | " 'headerFormat': '{series.name}
',\n", 100 | " 'pointFormat': '{point.x} km: {point.y}°C'\n", 101 | " },\n", 102 | " 'plotOptions': {\n", 103 | " 'spline': {\n", 104 | " 'marker': {\n", 105 | " 'enable': False\n", 106 | " }\n", 107 | " }\n", 108 | " },\n", 109 | " 'series': [{\n", 110 | " 'name': 'Temperature',\n", 111 | " 'data': [[0, 15], [10, -50], [20, -56.5], [30, -46.5], [40, -22.1],\n", 112 | " [50, -2.5], [60, -27.7], [70, -55.7], [80, -76.5]]\n", 113 | " }]\n", 114 | "}" 115 | ] 116 | }, 117 | { 118 | "cell_type": "markdown", 119 | "id": "da0205f3-be4e-4e60-ae94-de6ca7af2547", 120 | "metadata": {}, 121 | "source": [ 122 | "## Assemble Chart" 123 | ] 124 | }, 125 | { 126 | "cell_type": "code", 127 | "execution_count": null, 128 | "id": "f9838ab6-2663-4fb4-9037-a760862c3b7d", 129 | "metadata": { 130 | "tags": [] 131 | }, 132 | "outputs": [], 133 | "source": [ 134 | "chart = Chart(options = as_dict)\n", 135 | "chart.display()" 136 | ] 137 | }, 138 | { 139 | "cell_type": "code", 140 | "execution_count": null, 141 | "id": "bdd2b7cb-8365-453b-b1ce-e370baa72930", 142 | "metadata": {}, 143 | "outputs": [], 144 | "source": [] 145 | } 146 | ], 147 | "metadata": { 148 | "kernelspec": { 149 | "display_name": "Python 3 (ipykernel)", 150 | "language": "python", 151 | "name": "python3" 152 | }, 153 | "language_info": { 154 | "codemirror_mode": { 155 | "name": "ipython", 156 | "version": 3 157 | }, 158 | "file_extension": ".py", 159 | "mimetype": "text/x-python", 160 | "name": "python", 161 | "nbconvert_exporter": "python", 162 | "pygments_lexer": "ipython3", 163 | "version": "3.10.5" 164 | } 165 | }, 166 | "nbformat": 4, 167 | "nbformat_minor": 5 168 | } 169 | -------------------------------------------------------------------------------- /highcharts-core/dynamic-charts/click-to-add-a-point.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "markdown", 5 | "id": "02cca23b-860a-45e5-9728-17c8212f15a1", 6 | "metadata": {}, 7 | "source": [ 8 | "# Click to Add a Point\n", 9 | "Chart allowing users to update the data by clicking in the chart area.\n", 10 | "Clicking an existing point will remove it." 11 | ] 12 | }, 13 | { 14 | "cell_type": "markdown", 15 | "id": "227424c2-3a0a-4c9f-bee9-5187a49fdde9", 16 | "metadata": {}, 17 | "source": [ 18 | "## Import Dependencies" 19 | ] 20 | }, 21 | { 22 | "cell_type": "code", 23 | "execution_count": null, 24 | "id": "65cdd7bc-06c3-4e03-8df7-aa35bc8df5ae", 25 | "metadata": { 26 | "tags": [] 27 | }, 28 | "outputs": [], 29 | "source": [ 30 | "from highcharts_core.chart import Chart\n", 31 | "from highcharts_core.options import HighchartsOptions" 32 | ] 33 | }, 34 | { 35 | "cell_type": "markdown", 36 | "id": "e0fd01fa-3799-42d7-a647-1024fe3a7f41", 37 | "metadata": {}, 38 | "source": [ 39 | "## Prepare Options" 40 | ] 41 | }, 42 | { 43 | "cell_type": "code", 44 | "execution_count": null, 45 | "id": "e92c8210-02d5-4d7a-9ed7-57f3e3a90a26", 46 | "metadata": { 47 | "tags": [] 48 | }, 49 | "outputs": [], 50 | "source": [ 51 | "as_dict = {\n", 52 | " 'chart': {\n", 53 | " 'type': 'scatter',\n", 54 | " 'margin': [70, 50, 60, 80],\n", 55 | " 'events': {\n", 56 | " 'click': \"\"\"function (e) {\n", 57 | " // find the clicked values and the series\n", 58 | " var x = Math.round(e.xAxis[0].value),\n", 59 | " y = Math.round(e.yAxis[0].value),\n", 60 | " series = this.series[0];\n", 61 | "\n", 62 | " // Add it\n", 63 | " series.addPoint([x, y]);\n", 64 | " }\"\"\"\n", 65 | " }\n", 66 | " },\n", 67 | " 'title': {\n", 68 | " 'text': 'User supplied data',\n", 69 | " 'align': 'left'\n", 70 | " },\n", 71 | " 'subtitle': {\n", 72 | " 'text': 'Click the plot area to add a point. Click a point to remove it.',\n", 73 | " 'align': 'left'\n", 74 | " },\n", 75 | " 'accessibility': {\n", 76 | " 'announceNewData': {\n", 77 | " 'enabled': True\n", 78 | " }\n", 79 | " },\n", 80 | " 'xAxis': {\n", 81 | " 'gridLineWidth': 1,\n", 82 | " 'minPadding': 0.2,\n", 83 | " 'maxPadding': 0.2,\n", 84 | " 'maxZoom': 60\n", 85 | " },\n", 86 | " 'yAxis': {\n", 87 | " 'title': {\n", 88 | " 'text': 'Value'\n", 89 | " },\n", 90 | " 'minPadding': 0.2,\n", 91 | " 'maxPadding': 0.2,\n", 92 | " 'maxZoom': 60,\n", 93 | " 'plotLines': [{\n", 94 | " 'value': 0,\n", 95 | " 'width': 1,\n", 96 | " 'color': '#808080'\n", 97 | " }]\n", 98 | " },\n", 99 | " 'legend': {\n", 100 | " 'enabled': False\n", 101 | " },\n", 102 | " 'exporting': {\n", 103 | " 'enabled': False\n", 104 | " },\n", 105 | " 'plotOptions': {\n", 106 | " 'series': {\n", 107 | " 'lineWidth': 1,\n", 108 | " 'point': {\n", 109 | " 'events': {\n", 110 | " 'click': \"\"\"function () {\n", 111 | " if (this.series.data.length > 1) {\n", 112 | " this.remove();\n", 113 | " }\n", 114 | " }\"\"\"\n", 115 | " }\n", 116 | " }\n", 117 | " }\n", 118 | " },\n", 119 | " 'series': [{\n", 120 | " 'data': [[20, 20], [80, 80]]\n", 121 | " }]\n", 122 | "}\n" 123 | ] 124 | }, 125 | { 126 | "cell_type": "markdown", 127 | "id": "d32e5c25-5602-4d65-a36e-7a9015caedb3", 128 | "metadata": {}, 129 | "source": [ 130 | "## Assemble and Display Chart" 131 | ] 132 | }, 133 | { 134 | "cell_type": "code", 135 | "execution_count": null, 136 | "id": "31173e83-98a7-41f1-85d0-3e6368711507", 137 | "metadata": { 138 | "tags": [] 139 | }, 140 | "outputs": [], 141 | "source": [ 142 | "chart = Chart.from_options(as_dict)\n", 143 | "chart.display()" 144 | ] 145 | }, 146 | { 147 | "cell_type": "code", 148 | "execution_count": null, 149 | "id": "e1affa5b-eb21-4dd7-a82e-753f7ccb0029", 150 | "metadata": {}, 151 | "outputs": [], 152 | "source": [] 153 | } 154 | ], 155 | "metadata": { 156 | "kernelspec": { 157 | "display_name": "Python 3 (ipykernel)", 158 | "language": "python", 159 | "name": "python3" 160 | }, 161 | "language_info": { 162 | "codemirror_mode": { 163 | "name": "ipython", 164 | "version": 3 165 | }, 166 | "file_extension": ".py", 167 | "mimetype": "text/x-python", 168 | "name": "python", 169 | "nbconvert_exporter": "python", 170 | "pygments_lexer": "ipython3", 171 | "version": "3.10.5" 172 | } 173 | }, 174 | "nbformat": 4, 175 | "nbformat_minor": 5 176 | } 177 | -------------------------------------------------------------------------------- /highcharts-gantt/gantt-charts/basic-gantt-chart.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "markdown", 5 | "id": "085034b4-0d83-4c2b-8b2a-d123cfa82446", 6 | "metadata": {}, 7 | "source": [ 8 | "# Basic Gantt Demo\n", 9 | "This notebook demonstrates assembling a basic Gantt chart." 10 | ] 11 | }, 12 | { 13 | "cell_type": "markdown", 14 | "id": "79193a65-ad7a-4e73-8c37-a8c81bbacd76", 15 | "metadata": {}, 16 | "source": [ 17 | "## Import Dependencies" 18 | ] 19 | }, 20 | { 21 | "cell_type": "code", 22 | "execution_count": null, 23 | "id": "6c2c5355-e40a-44e6-ba6e-4269818a4316", 24 | "metadata": {}, 25 | "outputs": [], 26 | "source": [ 27 | "from highcharts_gantt.chart import Chart\n", 28 | "from highcharts_gantt.options.series.gantt import GanttSeries\n", 29 | "import datetime" 30 | ] 31 | }, 32 | { 33 | "cell_type": "markdown", 34 | "id": "cbad4ca8-6538-45a6-8829-6da7ebf8707b", 35 | "metadata": {}, 36 | "source": [ 37 | "## Configure Options" 38 | ] 39 | }, 40 | { 41 | "cell_type": "code", 42 | "execution_count": null, 43 | "id": "c9c83903-99d1-4b17-86b2-5f4ee371e6aa", 44 | "metadata": {}, 45 | "outputs": [], 46 | "source": [ 47 | "options_as_dict = {\n", 48 | " 'title': {\n", 49 | " 'text': 'Gantt Chart with Progress Indicators',\n", 50 | " 'align': 'left'\n", 51 | " },\n", 52 | "\n", 53 | " 'xAxis': {\n", 54 | " 'min': datetime.date(2014, 10, 17),\n", 55 | " 'max': datetime.date(2014, 10, 30)\n", 56 | " },\n", 57 | "\n", 58 | " 'accessibility': {\n", 59 | " 'point': {\n", 60 | " 'descriptionFormatter': \"\"\"function (point) {\n", 61 | " var completedValue = point.completed ?\n", 62 | " point.completed.amount || point.completed : null,\n", 63 | " completed = completedValue ?\n", 64 | " ' Task completed ' + Math.round(completedValue * 1000) / 10 + '%.' :\n", 65 | " '';\n", 66 | " return Highcharts.format(\n", 67 | " '{point.yCategory}.{completed} Start {point.x:%Y-%m-%d}, end {point.x2:%Y-%m-%d}.',\n", 68 | " { point, completed }\n", 69 | " );\n", 70 | " }\"\"\"\n", 71 | " }\n", 72 | " },\n", 73 | "\n", 74 | " 'lang': {\n", 75 | " 'accessibility': {\n", 76 | " 'axis': {\n", 77 | " 'xAxisDescriptionPlural': 'The chart has a two-part X axis showing time in both week numbers and days.'\n", 78 | " }\n", 79 | " }\n", 80 | " },\n", 81 | "\n", 82 | " 'series': [{\n", 83 | " 'type': 'gantt',\n", 84 | " 'name': 'Project 1',\n", 85 | " 'data': [{\n", 86 | " 'name': 'Start prototype',\n", 87 | " 'start': datetime.date(2014, 10, 18),\n", 88 | " 'end': datetime.date(2014, 10, 25),\n", 89 | " 'completed': 0.25\n", 90 | " }, {\n", 91 | " 'name': 'Test prototype',\n", 92 | " 'start': datetime.date(2014, 10, 27),\n", 93 | " 'end': datetime.date(2014, 10, 29)\n", 94 | " }, {\n", 95 | " 'name': 'Develop',\n", 96 | " 'start': datetime.date(2014, 10, 20),\n", 97 | " 'end': datetime.date(2014, 10, 25),\n", 98 | " 'completed': {\n", 99 | " 'amount': 0.12,\n", 100 | " 'fill': '#fa0'\n", 101 | " }\n", 102 | " }, {\n", 103 | " 'name': 'Run acceptance tests',\n", 104 | " 'start': datetime.date(2014, 10, 23),\n", 105 | " 'end': datetime.date(2014, 10, 26)\n", 106 | " }]\n", 107 | " }]\n", 108 | "}" 109 | ] 110 | }, 111 | { 112 | "cell_type": "markdown", 113 | "id": "f575f6d0-16fc-4568-8faa-7c58d3c3b6e8", 114 | "metadata": {}, 115 | "source": [ 116 | "## Assemble and Display Chart" 117 | ] 118 | }, 119 | { 120 | "cell_type": "code", 121 | "execution_count": null, 122 | "id": "43f4325d-d9eb-4c91-b6c8-ec483efb51e9", 123 | "metadata": { 124 | "tags": [] 125 | }, 126 | "outputs": [], 127 | "source": [ 128 | "chart = Chart.from_options(options_as_dict, chart_kwargs = {'is_gantt_chart': True})\n", 129 | "chart.display()" 130 | ] 131 | }, 132 | { 133 | "cell_type": "code", 134 | "execution_count": null, 135 | "id": "926fdce2-e476-46d4-9b11-aaa8ca7086f9", 136 | "metadata": {}, 137 | "outputs": [], 138 | "source": [] 139 | } 140 | ], 141 | "metadata": { 142 | "kernelspec": { 143 | "display_name": "Python 3 (ipykernel)", 144 | "language": "python", 145 | "name": "python3" 146 | }, 147 | "language_info": { 148 | "codemirror_mode": { 149 | "name": "ipython", 150 | "version": 3 151 | }, 152 | "file_extension": ".py", 153 | "mimetype": "text/x-python", 154 | "name": "python", 155 | "nbconvert_exporter": "python", 156 | "pygments_lexer": "ipython3", 157 | "version": "3.10.5" 158 | } 159 | }, 160 | "nbformat": 4, 161 | "nbformat_minor": 5 162 | } 163 | -------------------------------------------------------------------------------- /highcharts-core/column-and-bar-charts/column-range.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "markdown", 5 | "id": "0c26872a-fc19-4f08-9fd9-ce0b0d961f27", 6 | "metadata": {}, 7 | "source": [ 8 | "# Column Range Chart\n", 9 | "Chart showing ranges using horizontal columns. Each range is represented with a low and high value, with a bar between them." 10 | ] 11 | }, 12 | { 13 | "cell_type": "code", 14 | "execution_count": null, 15 | "id": "23fe61da-917b-4ad6-a0c4-df85ff98cd74", 16 | "metadata": {}, 17 | "outputs": [], 18 | "source": [ 19 | "## Import Dependencies" 20 | ] 21 | }, 22 | { 23 | "cell_type": "code", 24 | "execution_count": null, 25 | "id": "6ebbd6b7-cd27-4304-9d60-5e5cb2950063", 26 | "metadata": {}, 27 | "outputs": [], 28 | "source": [ 29 | "from highcharts_core.chart import Chart\n", 30 | "from highcharts_core.options import HighchartsOptions" 31 | ] 32 | }, 33 | { 34 | "cell_type": "markdown", 35 | "id": "a07d8167-8441-4d14-97e6-f40983f37278", 36 | "metadata": {}, 37 | "source": [ 38 | "## Configure Options" 39 | ] 40 | }, 41 | { 42 | "cell_type": "code", 43 | "execution_count": null, 44 | "id": "2d4b0bda-3c20-4af7-bf76-caff71606fed", 45 | "metadata": {}, 46 | "outputs": [], 47 | "source": [ 48 | "options_as_str = \"\"\"{\n", 49 | "\n", 50 | " chart: {\n", 51 | " type: 'columnrange',\n", 52 | " inverted: true\n", 53 | " },\n", 54 | "\n", 55 | " accessibility: {\n", 56 | " description: 'Image description: A column range chart compares the monthly temperature variations throughout 2017 in Vik I Sogn, Norway. The chart is interactive and displays the temperature range for each month when hovering over the data. The temperature is measured in degrees Celsius on the X-axis and the months are plotted on the Y-axis. The lowest temperature is recorded in March at minus 10.2 Celsius. The lowest range of temperatures is found in December ranging from a low of minus 9 to a high of 8.6 Celsius. The highest temperature is found in July at 26.2 Celsius. July also has the highest range of temperatures from 6 to 26.2 Celsius. The broadest range of temperatures is found in May ranging from a low of minus 0.6 to a high of 23.1 Celsius.'\n", 57 | " },\n", 58 | "\n", 59 | " title: {\n", 60 | " text: 'Temperature variation by month'\n", 61 | " },\n", 62 | "\n", 63 | " subtitle: {\n", 64 | " text: 'Observed in Vik i Sogn, Norway, 2021 | Source: Vikjavev'\n", 65 | " },\n", 66 | "\n", 67 | " xAxis: {\n", 68 | " categories: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun',\n", 69 | " 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']\n", 70 | " },\n", 71 | "\n", 72 | " yAxis: {\n", 73 | " title: {\n", 74 | " text: 'Temperature ( °C )'\n", 75 | " }\n", 76 | " },\n", 77 | "\n", 78 | " tooltip: {\n", 79 | " valueSuffix: '°C'\n", 80 | " },\n", 81 | "\n", 82 | " plotOptions: {\n", 83 | " columnrange: {\n", 84 | " dataLabels: {\n", 85 | " enabled: true,\n", 86 | " format: '{y}°C'\n", 87 | " }\n", 88 | " }\n", 89 | " },\n", 90 | "\n", 91 | " legend: {\n", 92 | " enabled: false\n", 93 | " },\n", 94 | "\n", 95 | " series: [{\n", 96 | " name: 'Temperatures',\n", 97 | " data: [\n", 98 | " [-13.9, 5.2],\n", 99 | " [-16.7, 10.6],\n", 100 | " [-4.7, 11.6],\n", 101 | " [-4.4, 16.8],\n", 102 | " [-2.1, 27.2],\n", 103 | " [5.9, 29.4],\n", 104 | " [6.5, 29.1],\n", 105 | " [4.7, 25.4],\n", 106 | " [4.3, 21.6],\n", 107 | " [-3.5, 15.1],\n", 108 | " [-9.8, 12.5],\n", 109 | " [-11.5, 8.4]\n", 110 | " ]\n", 111 | " }]\n", 112 | "\n", 113 | "}\"\"\"\n", 114 | "options = HighchartsOptions.from_js_literal(options_as_str)" 115 | ] 116 | }, 117 | { 118 | "cell_type": "code", 119 | "execution_count": null, 120 | "id": "71cd0e89-da09-4fa0-bdef-8ed5ce5db44a", 121 | "metadata": { 122 | "tags": [] 123 | }, 124 | "outputs": [], 125 | "source": [ 126 | "chart = Chart.from_options(options)\n", 127 | "chart.display()" 128 | ] 129 | }, 130 | { 131 | "cell_type": "code", 132 | "execution_count": null, 133 | "id": "c9526b0f-656c-4019-8e74-dd11ea37370e", 134 | "metadata": {}, 135 | "outputs": [], 136 | "source": [] 137 | } 138 | ], 139 | "metadata": { 140 | "kernelspec": { 141 | "display_name": "Python 3 (ipykernel)", 142 | "language": "python", 143 | "name": "python3" 144 | }, 145 | "language_info": { 146 | "codemirror_mode": { 147 | "name": "ipython", 148 | "version": 3 149 | }, 150 | "file_extension": ".py", 151 | "mimetype": "text/x-python", 152 | "name": "python", 153 | "nbconvert_exporter": "python", 154 | "pygments_lexer": "ipython3", 155 | "version": "3.10.5" 156 | } 157 | }, 158 | "nbformat": 4, 159 | "nbformat_minor": 5 160 | } 161 | -------------------------------------------------------------------------------- /highcharts-core/python-features/from-pandas.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "markdown", 5 | "id": "b61ab4e2-55d4-4159-96c0-b5ab12954d59", 6 | "metadata": {}, 7 | "source": [ 8 | "# ``.from_pandas()`` Demo\n", 9 | "Highcharts for Python includes a super useful ``.from_pandas()`` method which can quickly and easily generate a Highcharts visualization from a Pandas dataframe." 10 | ] 11 | }, 12 | { 13 | "cell_type": "markdown", 14 | "id": "36247b6d-8b86-4c54-9142-b47d3f994eca", 15 | "metadata": { 16 | "tags": [] 17 | }, 18 | "source": [ 19 | "## Import Dependencies" 20 | ] 21 | }, 22 | { 23 | "cell_type": "code", 24 | "execution_count": null, 25 | "id": "03fde0d1-880a-467a-9aac-777ebf7c59f3", 26 | "metadata": { 27 | "tags": [] 28 | }, 29 | "outputs": [], 30 | "source": [ 31 | "from highcharts_core.chart import Chart\n", 32 | "from highcharts_core.options.series.area import LineSeries\n", 33 | "import pandas" 34 | ] 35 | }, 36 | { 37 | "cell_type": "markdown", 38 | "id": "e0000636-b68e-488e-b15f-988ebc1d8b6a", 39 | "metadata": {}, 40 | "source": [ 41 | "## Prepare the Configuration" 42 | ] 43 | }, 44 | { 45 | "cell_type": "code", 46 | "execution_count": null, 47 | "id": "0a5ab4ab-0e15-4cbc-a2fb-83bf97e48d3f", 48 | "metadata": { 49 | "tags": [] 50 | }, 51 | "outputs": [], 52 | "source": [ 53 | "options_kwargs = {\n", 54 | " 'title': {\n", 55 | " 'text': 'U.S Solar Employment Growth by Job Category, 2010-2020',\n", 56 | " 'align': 'left'\n", 57 | " },\n", 58 | " 'subtitle': {\n", 59 | " 'text': 'Source: IREC',\n", 60 | " 'align': 'left'\n", 61 | " },\n", 62 | " 'y_axis': {\n", 63 | " 'title': {\n", 64 | " 'text': 'Number of Employees'\n", 65 | " }\n", 66 | " },\n", 67 | " 'x_axis': {\n", 68 | " 'accessibility': {\n", 69 | " 'range_description': 'Range: 2010 to 2020'\n", 70 | " }\n", 71 | " },\n", 72 | " 'legend': {\n", 73 | " 'layout': 'vertical',\n", 74 | " 'align': 'right',\n", 75 | " 'vertical_align': 'middle'\n", 76 | " },\n", 77 | " 'plot_options': {\n", 78 | " 'series': {\n", 79 | " 'point_start': 2010,\n", 80 | " 'label': {\n", 81 | " 'connector_allowed': False\n", 82 | " }\n", 83 | " }\n", 84 | " }\n", 85 | "}" 86 | ] 87 | }, 88 | { 89 | "cell_type": "markdown", 90 | "id": "83ea7d23-2026-4a15-9144-e30001406eb8", 91 | "metadata": {}, 92 | "source": [ 93 | "## Populate the Dataframe" 94 | ] 95 | }, 96 | { 97 | "cell_type": "code", 98 | "execution_count": null, 99 | "id": "a51b0171-0852-4f72-94a5-af08626144a6", 100 | "metadata": { 101 | "tags": [] 102 | }, 103 | "outputs": [], 104 | "source": [ 105 | "df = pandas.read_csv('from-pandas.csv')\n", 106 | "df" 107 | ] 108 | }, 109 | { 110 | "cell_type": "markdown", 111 | "id": "2294327c-46ec-425d-8f4e-0e618607c037", 112 | "metadata": {}, 113 | "source": [ 114 | "## Create the Series" 115 | ] 116 | }, 117 | { 118 | "cell_type": "code", 119 | "execution_count": null, 120 | "id": "8fb6490d-cb69-4ed3-995b-8df7389caee3", 121 | "metadata": { 122 | "tags": [] 123 | }, 124 | "outputs": [], 125 | "source": [ 126 | "series_columns = ['Installation & Developers',\n", 127 | " 'Manufacturing',\n", 128 | " 'Sales & Distribution',\n", 129 | " 'Operations & Maintenance',\n", 130 | " 'Other']\n", 131 | "series = [LineSeries.from_pandas(df, property_map = {'y': x}, series_kwargs = {'name': x}) for x in series_columns]" 132 | ] 133 | }, 134 | { 135 | "cell_type": "markdown", 136 | "id": "22f593cd-1641-46db-aca3-4aaeec8d59bb", 137 | "metadata": {}, 138 | "source": [ 139 | "## Assemble the Chart" 140 | ] 141 | }, 142 | { 143 | "cell_type": "code", 144 | "execution_count": null, 145 | "id": "d54eeb90-3535-4973-b44e-8109bf480c4e", 146 | "metadata": {}, 147 | "outputs": [], 148 | "source": [ 149 | "chart = Chart(options = options_kwargs)\n", 150 | "chart.add_series(*series)" 151 | ] 152 | }, 153 | { 154 | "cell_type": "markdown", 155 | "id": "da99cefc-d953-4764-8392-a704e34702a8", 156 | "metadata": {}, 157 | "source": [ 158 | "## Display the Chart" 159 | ] 160 | }, 161 | { 162 | "cell_type": "code", 163 | "execution_count": null, 164 | "id": "97eb8175-132f-48ac-bfeb-58d10dae40a6", 165 | "metadata": {}, 166 | "outputs": [], 167 | "source": [ 168 | "chart.display(container = 'highcharts_container')" 169 | ] 170 | }, 171 | { 172 | "cell_type": "code", 173 | "execution_count": null, 174 | "id": "fac19969-4243-4ca3-bee5-32ab4dcf7c97", 175 | "metadata": {}, 176 | "outputs": [], 177 | "source": [] 178 | } 179 | ], 180 | "metadata": { 181 | "kernelspec": { 182 | "display_name": "Python 3 (ipykernel)", 183 | "language": "python", 184 | "name": "python3" 185 | }, 186 | "language_info": { 187 | "codemirror_mode": { 188 | "name": "ipython", 189 | "version": 3 190 | }, 191 | "file_extension": ".py", 192 | "mimetype": "text/x-python", 193 | "name": "python", 194 | "nbconvert_exporter": "python", 195 | "pygments_lexer": "ipython3", 196 | "version": "3.10.5" 197 | } 198 | }, 199 | "nbformat": 4, 200 | "nbformat_minor": 5 201 | } 202 | -------------------------------------------------------------------------------- /highcharts-core/pie-charts/donut-charts.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "markdown", 5 | "id": "0c26872a-fc19-4f08-9fd9-ce0b0d961f27", 6 | "metadata": {}, 7 | "source": [ 8 | "# Donut Charts\n", 9 | "Donut charts tend to be easier to read and reason about than pie charts, due to the human brain's better ability to process relative area." 10 | ] 11 | }, 12 | { 13 | "cell_type": "markdown", 14 | "id": "6b461423-bdfe-46fd-ac5e-89a8191948e5", 15 | "metadata": {}, 16 | "source": [ 17 | "## Import Dependencies" 18 | ] 19 | }, 20 | { 21 | "cell_type": "code", 22 | "execution_count": null, 23 | "id": "6ebbd6b7-cd27-4304-9d60-5e5cb2950063", 24 | "metadata": {}, 25 | "outputs": [], 26 | "source": [ 27 | "from highcharts_core.chart import Chart\n", 28 | "from highcharts_core.options import HighchartsOptions" 29 | ] 30 | }, 31 | { 32 | "cell_type": "markdown", 33 | "id": "a07d8167-8441-4d14-97e6-f40983f37278", 34 | "metadata": {}, 35 | "source": [ 36 | "## Donut Chart\n", 37 | "### Configure Options" 38 | ] 39 | }, 40 | { 41 | "cell_type": "code", 42 | "execution_count": null, 43 | "id": "2d4b0bda-3c20-4af7-bf76-caff71606fed", 44 | "metadata": {}, 45 | "outputs": [], 46 | "source": [ 47 | "options_as_str = \"\"\"{\n", 48 | " chart: {\n", 49 | " plotBackgroundColor: null,\n", 50 | " plotBorderWidth: 0,\n", 51 | " plotShadow: false\n", 52 | " },\n", 53 | " title: {\n", 54 | " text: 'Browser
shares
January
2022',\n", 55 | " align: 'center',\n", 56 | " verticalAlign: 'middle',\n", 57 | " y: 100\n", 58 | " },\n", 59 | " tooltip: {\n", 60 | " pointFormat: '{series.name}: {point.percentage:.1f}%'\n", 61 | " },\n", 62 | " accessibility: {\n", 63 | " point: {\n", 64 | " valueSuffix: '%'\n", 65 | " }\n", 66 | " },\n", 67 | " plotOptions: {\n", 68 | " pie: {\n", 69 | " dataLabels: {\n", 70 | " enabled: true,\n", 71 | " distance: -50,\n", 72 | " style: {\n", 73 | " fontWeight: 'bold',\n", 74 | " color: 'white'\n", 75 | " }\n", 76 | " },\n", 77 | " center: ['50%', '75%']\n", 78 | " }\n", 79 | " },\n", 80 | " series: [{\n", 81 | " type: 'pie',\n", 82 | " name: 'Browser share',\n", 83 | " innerSize: '50%',\n", 84 | " data: [\n", 85 | " ['Chrome', 73.86],\n", 86 | " ['Edge', 11.97],\n", 87 | " ['Firefox', 5.52],\n", 88 | " ['Safari', 2.98],\n", 89 | " ['Internet Explorer', 1.90],\n", 90 | " {\n", 91 | " name: 'Other',\n", 92 | " y: 3.77,\n", 93 | " dataLabels: {\n", 94 | " enabled: false\n", 95 | " }\n", 96 | " }\n", 97 | " ]\n", 98 | " }]\n", 99 | "}\"\"\"\n", 100 | "options = HighchartsOptions.from_js_literal(options_as_str)" 101 | ] 102 | }, 103 | { 104 | "cell_type": "markdown", 105 | "id": "ef6c9a3e-1db1-49c8-b8b9-206e5b4865ed", 106 | "metadata": {}, 107 | "source": [ 108 | "### Assemble and Display the Chart" 109 | ] 110 | }, 111 | { 112 | "cell_type": "code", 113 | "execution_count": null, 114 | "id": "71cd0e89-da09-4fa0-bdef-8ed5ce5db44a", 115 | "metadata": { 116 | "tags": [] 117 | }, 118 | "outputs": [], 119 | "source": [ 120 | "donut_chart = Chart.from_options(options)\n", 121 | "donut_chart.display()" 122 | ] 123 | }, 124 | { 125 | "cell_type": "markdown", 126 | "id": "2b9fc8f6-a066-498b-9a08-3aa67a4dd7e3", 127 | "metadata": {}, 128 | "source": [ 129 | "## Half-donut Chart\n", 130 | "Representing something closer to a gauge chart, with the donut represented as a semi-circle." 131 | ] 132 | }, 133 | { 134 | "cell_type": "markdown", 135 | "id": "01a3101a-be8f-4df2-bfbb-6e01a58e2ee5", 136 | "metadata": {}, 137 | "source": [ 138 | "## Copy Chart, Configure Options, and Display the Chart" 139 | ] 140 | }, 141 | { 142 | "cell_type": "code", 143 | "execution_count": null, 144 | "id": "9e019b74-ef9f-44f5-9e5b-443aa5a95d6b", 145 | "metadata": { 146 | "tags": [] 147 | }, 148 | "outputs": [], 149 | "source": [ 150 | "half_donut_chart = donut_chart.copy(preserve_data = False)\n", 151 | "\n", 152 | "half_donut_chart.options.series[0].inner_size = '50%'\n", 153 | "half_donut_chart.options.plot_options.pie.start_angle = -90\n", 154 | "half_donut_chart.options.plot_options.pie.end_angle = 90\n", 155 | "\n", 156 | "half_donut_chart.display(container = 'half_donut_container')" 157 | ] 158 | }, 159 | { 160 | "cell_type": "code", 161 | "execution_count": null, 162 | "id": "9b67989a-3418-4fee-ac99-388f88c741e1", 163 | "metadata": {}, 164 | "outputs": [], 165 | "source": [] 166 | } 167 | ], 168 | "metadata": { 169 | "kernelspec": { 170 | "display_name": "Python 3 (ipykernel)", 171 | "language": "python", 172 | "name": "python3" 173 | }, 174 | "language_info": { 175 | "codemirror_mode": { 176 | "name": "ipython", 177 | "version": 3 178 | }, 179 | "file_extension": ".py", 180 | "mimetype": "text/x-python", 181 | "name": "python", 182 | "nbconvert_exporter": "python", 183 | "pygments_lexer": "ipython3", 184 | "version": "3.10.5" 185 | } 186 | }, 187 | "nbformat": 4, 188 | "nbformat_minor": 5 189 | } 190 | -------------------------------------------------------------------------------- /highcharts-maps/input-formats/geojson.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "markdown", 5 | "id": "60e0ca3d-2748-4ef0-b70e-f3a6132a0459", 6 | "metadata": { 7 | "tags": [] 8 | }, 9 | "source": [ 10 | "# GeoJSON Demo\n", 11 | "**WARNING:** There is some strange bug in this demo tied to the use of a verbose object representation for ``GeometricData`` in the JS literal representation of the chart configuration. This bug is currently being investigated." 12 | ] 13 | }, 14 | { 15 | "cell_type": "markdown", 16 | "id": "db7258fb-2824-4fcd-9786-6eef9a0f0523", 17 | "metadata": {}, 18 | "source": [ 19 | "## Import Dependencies" 20 | ] 21 | }, 22 | { 23 | "cell_type": "code", 24 | "execution_count": null, 25 | "id": "7baf8929-2abf-4e27-9155-9dd06a316775", 26 | "metadata": { 27 | "tags": [] 28 | }, 29 | "outputs": [], 30 | "source": [ 31 | "from highcharts_maps.chart import Chart\n", 32 | "from highcharts_maps.options.series.data.map_data import MapData\n", 33 | "import requests" 34 | ] 35 | }, 36 | { 37 | "cell_type": "markdown", 38 | "id": "43e3d9c0-b17a-476e-8a42-7a7287974cbf", 39 | "metadata": {}, 40 | "source": [ 41 | "## Configure Data" 42 | ] 43 | }, 44 | { 45 | "cell_type": "code", 46 | "execution_count": null, 47 | "id": "1f4f6edb-a45d-4ecb-80da-495b3b1c3f32", 48 | "metadata": { 49 | "tags": [] 50 | }, 51 | "outputs": [], 52 | "source": [ 53 | "data = [\n", 54 | " ['DE.SH', 728],\n", 55 | " ['DE.BE', 710],\n", 56 | " ['DE.MV', 963],\n", 57 | " ['DE.HB', 541],\n", 58 | " ['DE.HH', 622],\n", 59 | " ['DE.RP', 866],\n", 60 | " ['DE.SL', 398],\n", 61 | " ['DE.BY', 785],\n", 62 | " ['DE.SN', 223],\n", 63 | " ['DE.ST', 605],\n", 64 | " ['DE.NW', 237],\n", 65 | " ['DE.BW', 157],\n", 66 | " ['DE.HE', 134],\n", 67 | " ['DE.NI', 136],\n", 68 | " ['DE.TH', 704],\n", 69 | " ['DE.', 361]\n", 70 | "]\n", 71 | "map_response = requests.get('https://cdn.jsdelivr.net/gh/highcharts/highcharts@v7.0.0/samples/data/germany.geo.json')\n", 72 | "map_data_as_str = map_response.text" 73 | ] 74 | }, 75 | { 76 | "cell_type": "markdown", 77 | "id": "1cd77806-6379-4f1a-b27b-7702f46a9249", 78 | "metadata": {}, 79 | "source": [ 80 | "## Configure Options" 81 | ] 82 | }, 83 | { 84 | "cell_type": "code", 85 | "execution_count": null, 86 | "id": "e8f070b7-87a8-49ec-8f3e-42c65aba320d", 87 | "metadata": { 88 | "tags": [] 89 | }, 90 | "outputs": [], 91 | "source": [ 92 | "options = {\n", 93 | " 'chart': {\n", 94 | " 'map': MapData.from_geojson(map_data_as_str)\n", 95 | " },\n", 96 | "\n", 97 | " 'title': {\n", 98 | " 'text': 'GeoJSON Data for Germany'\n", 99 | " },\n", 100 | "\n", 101 | " 'accessibility': {\n", 102 | " 'typeDescription': 'Map of Germany.'\n", 103 | " },\n", 104 | "\n", 105 | " 'mapNavigation': {\n", 106 | " 'enabled': True,\n", 107 | " 'buttonOptions': {\n", 108 | " 'verticalAlign': 'bottom'\n", 109 | " }\n", 110 | " },\n", 111 | "\n", 112 | " 'colorAxis': {\n", 113 | " 'tickPixelInterval': 100\n", 114 | " },\n", 115 | "\n", 116 | " 'series': [{\n", 117 | " 'type': 'map',\n", 118 | " 'data': data,\n", 119 | " 'keys': ['code_hasc', 'value'],\n", 120 | " 'joinBy': 'code_hasc',\n", 121 | " 'name': 'Random data',\n", 122 | " 'states': {\n", 123 | " 'hover': {\n", 124 | " 'color': '#a4edba'\n", 125 | " }\n", 126 | " },\n", 127 | " 'dataLabels': {\n", 128 | " 'enabled': True,\n", 129 | " 'format': '{point.properties.postal} '\n", 130 | " }\n", 131 | " }]\n", 132 | "}\n", 133 | "options['chart']['map'].force_geojson = True" 134 | ] 135 | }, 136 | { 137 | "cell_type": "markdown", 138 | "id": "2ea908b1-8c55-4ca6-a943-c47c75f4c5d0", 139 | "metadata": {}, 140 | "source": [ 141 | "## Assemble Chart" 142 | ] 143 | }, 144 | { 145 | "cell_type": "code", 146 | "execution_count": null, 147 | "id": "3a509997-f08b-4466-b3c9-ccbadddcdee7", 148 | "metadata": { 149 | "tags": [] 150 | }, 151 | "outputs": [], 152 | "source": [ 153 | "chart = Chart.from_options(options)\n", 154 | "chart.is_maps_chart == True" 155 | ] 156 | }, 157 | { 158 | "cell_type": "markdown", 159 | "id": "00a063d8-d405-4ae9-a59b-20294b68344a", 160 | "metadata": { 161 | "tags": [] 162 | }, 163 | "source": [ 164 | "## Display Chart" 165 | ] 166 | }, 167 | { 168 | "cell_type": "code", 169 | "execution_count": null, 170 | "id": "cad11295-c153-4aca-a131-46f69ae09dec", 171 | "metadata": { 172 | "tags": [] 173 | }, 174 | "outputs": [], 175 | "source": [ 176 | "chart.display()" 177 | ] 178 | }, 179 | { 180 | "cell_type": "code", 181 | "execution_count": null, 182 | "id": "4906eaa6-a5e9-446a-a47b-7789fb1fcac2", 183 | "metadata": {}, 184 | "outputs": [], 185 | "source": [] 186 | } 187 | ], 188 | "metadata": { 189 | "kernelspec": { 190 | "display_name": "Python 3 (ipykernel)", 191 | "language": "python", 192 | "name": "python3" 193 | }, 194 | "language_info": { 195 | "codemirror_mode": { 196 | "name": "ipython", 197 | "version": 3 198 | }, 199 | "file_extension": ".py", 200 | "mimetype": "text/x-python", 201 | "name": "python", 202 | "nbconvert_exporter": "python", 203 | "pygments_lexer": "ipython3", 204 | "version": "3.10.5" 205 | } 206 | }, 207 | "nbformat": 4, 208 | "nbformat_minor": 5 209 | } 210 | -------------------------------------------------------------------------------- /highcharts-core/column-and-bar-charts/bar-pyramid.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "markdown", 5 | "id": "0c26872a-fc19-4f08-9fd9-ce0b0d961f27", 6 | "metadata": {}, 7 | "source": [ 8 | "# Bar / Pyramid Chart\n", 9 | "Bar chart showing Somalian population distribution by using a mirrored bar chart with stacking and two x-axes." 10 | ] 11 | }, 12 | { 13 | "cell_type": "markdown", 14 | "id": "6b461423-bdfe-46fd-ac5e-89a8191948e5", 15 | "metadata": {}, 16 | "source": [ 17 | "## Import Dependencies" 18 | ] 19 | }, 20 | { 21 | "cell_type": "code", 22 | "execution_count": null, 23 | "id": "6ebbd6b7-cd27-4304-9d60-5e5cb2950063", 24 | "metadata": {}, 25 | "outputs": [], 26 | "source": [ 27 | "from highcharts_core.chart import Chart\n", 28 | "from highcharts_core.options import HighchartsOptions" 29 | ] 30 | }, 31 | { 32 | "cell_type": "markdown", 33 | "id": "a07d8167-8441-4d14-97e6-f40983f37278", 34 | "metadata": {}, 35 | "source": [ 36 | "## Configure Options" 37 | ] 38 | }, 39 | { 40 | "cell_type": "code", 41 | "execution_count": null, 42 | "id": "2d4b0bda-3c20-4af7-bf76-caff71606fed", 43 | "metadata": {}, 44 | "outputs": [], 45 | "source": [ 46 | "options_as_str = \"\"\"{\n", 47 | " chart: {\n", 48 | " type: 'bar'\n", 49 | " },\n", 50 | " title: {\n", 51 | " text: 'Population pyramid for Somalia, 2021',\n", 52 | " align: 'left'\n", 53 | " },\n", 54 | " subtitle: {\n", 55 | " text: 'Source: countryeconomy.com',\n", 56 | " align: 'left'\n", 57 | " },\n", 58 | " accessibility: {\n", 59 | " point: {\n", 60 | " valueDescriptionFormat: '{index}. Age {xDescription}, {value}%.'\n", 61 | " }\n", 62 | " },\n", 63 | " xAxis: [{\n", 64 | " categories: ['0-4', '5-9', '10-14', '15-19', '20-24', '25-29', '30-34', '35-40', '40-45','45-49', '50-54', '55-59', '60-64', '65-69', '70-74', '75-79', '80+'],\n", 65 | " reversed: false,\n", 66 | " labels: {\n", 67 | " step: 1\n", 68 | " },\n", 69 | " accessibility: {\n", 70 | " description: 'Age (male)'\n", 71 | " }\n", 72 | " }, { // mirror axis on right side\n", 73 | " opposite: true,\n", 74 | " reversed: false,\n", 75 | " categories: ['0-4', '5-9', '10-14', '15-19', '20-24', '25-29', '30-34', '35-40', '40-45','45-49', '50-54', '55-59', '60-64', '65-69', '70-74', '75-79', '80+'],\n", 76 | " linkedTo: 0,\n", 77 | " labels: {\n", 78 | " step: 1\n", 79 | " },\n", 80 | " accessibility: {\n", 81 | " description: 'Age (female)'\n", 82 | " }\n", 83 | " }],\n", 84 | " yAxis: {\n", 85 | " title: {\n", 86 | " text: null\n", 87 | " },\n", 88 | " labels: {\n", 89 | " formatter: function () {\n", 90 | " return Math.abs(this.value) + '%';\n", 91 | " }\n", 92 | " },\n", 93 | " accessibility: {\n", 94 | " description: 'Percentage population',\n", 95 | " rangeDescription: 'Range: 0 to 5%'\n", 96 | " }\n", 97 | " },\n", 98 | "\n", 99 | " plotOptions: {\n", 100 | " series: {\n", 101 | " stacking: 'normal'\n", 102 | " }\n", 103 | " },\n", 104 | "\n", 105 | " tooltip: {\n", 106 | " formatter: function () {\n", 107 | " return '' + this.series.name + ', age ' + this.point.category + '
' +\n", 108 | " 'Population: ' + Highcharts.numberFormat(Math.abs(this.point.y), 1) + '%';\n", 109 | " }\n", 110 | " },\n", 111 | "\n", 112 | " series: [{\n", 113 | " name: 'Male',\n", 114 | " data: [\n", 115 | " -8.98, -7.52, -6.65, -5.72, -4.85,\n", 116 | " -3.71, -2.76, -2.07, -1.70, -1.47,\n", 117 | " -1.22, -0.99, -0.81, -0.62, -0.41,\n", 118 | " -0.23, -0.15\n", 119 | " ]\n", 120 | " }, {\n", 121 | " name: 'Female',\n", 122 | " data: [\n", 123 | " 8.84, 7.42, 6.57, 5.68, 4.83,\n", 124 | " 3.74, 2.80, 2.14, 1.79, 1.59,\n", 125 | " 1.34, 1.06, 0.83, 0.63, 0.43,\n", 126 | " 0.25, 0.19\n", 127 | " ]\n", 128 | " }]\n", 129 | "}\"\"\"\n", 130 | "options = HighchartsOptions.from_js_literal(options_as_str)" 131 | ] 132 | }, 133 | { 134 | "cell_type": "code", 135 | "execution_count": null, 136 | "id": "71cd0e89-da09-4fa0-bdef-8ed5ce5db44a", 137 | "metadata": { 138 | "tags": [] 139 | }, 140 | "outputs": [], 141 | "source": [ 142 | "chart = Chart.from_options(options)\n", 143 | "chart.display()" 144 | ] 145 | }, 146 | { 147 | "cell_type": "code", 148 | "execution_count": null, 149 | "id": "c9526b0f-656c-4019-8e74-dd11ea37370e", 150 | "metadata": {}, 151 | "outputs": [], 152 | "source": [] 153 | } 154 | ], 155 | "metadata": { 156 | "kernelspec": { 157 | "display_name": "Python 3 (ipykernel)", 158 | "language": "python", 159 | "name": "python3" 160 | }, 161 | "language_info": { 162 | "codemirror_mode": { 163 | "name": "ipython", 164 | "version": 3 165 | }, 166 | "file_extension": ".py", 167 | "mimetype": "text/x-python", 168 | "name": "python", 169 | "nbconvert_exporter": "python", 170 | "pygments_lexer": "ipython3", 171 | "version": "3.10.5" 172 | } 173 | }, 174 | "nbformat": 4, 175 | "nbformat_minor": 5 176 | } 177 | -------------------------------------------------------------------------------- /highcharts-maps/python-features/from-geopandas.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "markdown", 5 | "id": "6c803845-b643-4a33-9261-2e11081a8bda", 6 | "metadata": { 7 | "tags": [] 8 | }, 9 | "source": [ 10 | "# ``.from_geopandas()`` Demo\n", 11 | "This notebook demonstrates loading GIS data from a GeoPandas GeoDataFrame instance." 12 | ] 13 | }, 14 | { 15 | "cell_type": "markdown", 16 | "id": "efd3c075-c3ca-4906-a513-98f40d652377", 17 | "metadata": {}, 18 | "source": [ 19 | "## Import Dependencies" 20 | ] 21 | }, 22 | { 23 | "cell_type": "code", 24 | "execution_count": null, 25 | "id": "73c9ea28-0df9-4150-aac2-9dba0d6215d0", 26 | "metadata": { 27 | "tags": [] 28 | }, 29 | "outputs": [], 30 | "source": [ 31 | "from highcharts_maps.chart import Chart\n", 32 | "from highcharts_maps.options import HighchartsMapsOptions\n", 33 | "from highcharts_maps.options.series.data.map_data import MapData\n", 34 | "from highcharts_maps.options.series.map import MapSeries\n", 35 | "import geopandas" 36 | ] 37 | }, 38 | { 39 | "cell_type": "markdown", 40 | "id": "4257393d-a649-45ea-bd10-ec75fac2f610", 41 | "metadata": {}, 42 | "source": [ 43 | "## Assemble Data" 44 | ] 45 | }, 46 | { 47 | "cell_type": "code", 48 | "execution_count": null, 49 | "id": "4ffbbb3f-d014-4077-9bec-84694c631cc6", 50 | "metadata": { 51 | "tags": [] 52 | }, 53 | "outputs": [], 54 | "source": [ 55 | "gdf = geopandas.read_file(geopandas.datasets.get_path('naturalearth_lowres'))\n", 56 | "max_population = gdf.max()['pop_est']\n", 57 | "gdf.head()" 58 | ] 59 | }, 60 | { 61 | "cell_type": "markdown", 62 | "id": "3237a080-4802-44b1-902b-2a3f748b7df6", 63 | "metadata": {}, 64 | "source": [ 65 | "## Assemble Options" 66 | ] 67 | }, 68 | { 69 | "cell_type": "code", 70 | "execution_count": null, 71 | "id": "62f978e1-5be7-4876-9c56-30f62d35c0ff", 72 | "metadata": {}, 73 | "outputs": [], 74 | "source": [ 75 | "options_as_dict = {\n", 76 | " 'chart': {\n", 77 | " 'type': 'map',\n", 78 | " 'map': MapData.from_geodataframe(gdf)\n", 79 | " },\n", 80 | " 'title': {\n", 81 | " 'text': 'World Population from a GeoDataFrame'\n", 82 | " },\n", 83 | " 'mapNavigation': {\n", 84 | " 'enabled': True,\n", 85 | " 'buttonOptions': {\n", 86 | " 'verticalAlign': 'bottom'\n", 87 | " }\n", 88 | " },\n", 89 | " 'colorAxis': {\n", 90 | " 'min': 0,\n", 91 | " 'max': max_population,\n", 92 | " 'stops': [[0, '#F1EEF6'], [0.65, '#900037'], [1, '#500007']],\n", 93 | " 'labels': {\n", 94 | " 'format': '{value}%'\n", 95 | " }\n", 96 | " }\n", 97 | "}\n", 98 | "options = HighchartsMapsOptions.from_dict(options_as_dict)" 99 | ] 100 | }, 101 | { 102 | "cell_type": "markdown", 103 | "id": "0347ab22-9f04-4aed-8f85-5c92e05f310f", 104 | "metadata": {}, 105 | "source": [ 106 | "## Assemble Series" 107 | ] 108 | }, 109 | { 110 | "cell_type": "code", 111 | "execution_count": null, 112 | "id": "92f4beb4-7ece-46d4-a37e-afc18bd093a1", 113 | "metadata": {}, 114 | "outputs": [], 115 | "source": [ 116 | "series = MapSeries.from_geopandas(gdf,\n", 117 | " property_map = {\n", 118 | " 'value': 'pop_est',\n", 119 | " 'name': 'name',\n", 120 | " 'iso_a3': 'iso_a3'\n", 121 | " },\n", 122 | " series_kwargs = {\n", 123 | " 'name': 'Population',\n", 124 | " 'join_by': ['iso_a3', 'isoA3'],\n", 125 | " 'tooltip': {\n", 126 | " 'enabled': True\n", 127 | " },\n", 128 | " 'borderWidth': 0.5,\n", 129 | " 'states': {\n", 130 | " 'hover': {\n", 131 | " 'color': '#a4edba'\n", 132 | " }\n", 133 | " },\n", 134 | " 'shadow': False,\n", 135 | " 'accessibility': {\n", 136 | " 'enabled': False\n", 137 | " }\n", 138 | " })\n", 139 | "options.add_series(series)" 140 | ] 141 | }, 142 | { 143 | "cell_type": "markdown", 144 | "id": "c6e49bbf-9a28-4415-98c0-fc7697c7666e", 145 | "metadata": {}, 146 | "source": [ 147 | "## Assemble and Display Chart" 148 | ] 149 | }, 150 | { 151 | "cell_type": "code", 152 | "execution_count": null, 153 | "id": "5aaa52e2-ee1e-415d-90d3-d535a0ab9f8d", 154 | "metadata": { 155 | "tags": [] 156 | }, 157 | "outputs": [], 158 | "source": [ 159 | "chart = Chart.from_options(options)\n", 160 | "chart.display()" 161 | ] 162 | }, 163 | { 164 | "cell_type": "code", 165 | "execution_count": null, 166 | "id": "e4c7556f-87d5-4bb5-b83f-f047da853976", 167 | "metadata": {}, 168 | "outputs": [], 169 | "source": [] 170 | } 171 | ], 172 | "metadata": { 173 | "kernelspec": { 174 | "display_name": "Python 3 (ipykernel)", 175 | "language": "python", 176 | "name": "python3" 177 | }, 178 | "language_info": { 179 | "codemirror_mode": { 180 | "name": "ipython", 181 | "version": 3 182 | }, 183 | "file_extension": ".py", 184 | "mimetype": "text/x-python", 185 | "name": "python", 186 | "nbconvert_exporter": "python", 187 | "pygments_lexer": "ipython3", 188 | "version": "3.10.5" 189 | } 190 | }, 191 | "nbformat": 4, 192 | "nbformat_minor": 5 193 | } 194 | -------------------------------------------------------------------------------- /highcharts-maps/map-data/async-map-data.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "markdown", 5 | "id": "3d033821-eebd-4e56-8d75-1640001f6451", 6 | "metadata": {}, 7 | "source": [ 8 | "# Asynchronous Map Data\n", 9 | "Demonstrating how Asynchronous Map Data works in Highcharts Maps" 10 | ] 11 | }, 12 | { 13 | "cell_type": "markdown", 14 | "id": "19324d42-e2dd-41a3-a12f-ca8fbceda5ec", 15 | "metadata": {}, 16 | "source": [ 17 | "## Import Dependencies" 18 | ] 19 | }, 20 | { 21 | "cell_type": "code", 22 | "execution_count": null, 23 | "id": "9962170c-4f90-41f7-873e-0599ab54c046", 24 | "metadata": { 25 | "tags": [] 26 | }, 27 | "outputs": [], 28 | "source": [ 29 | "from highcharts_maps.constants import EnforcedNull\n", 30 | "from highcharts_maps.chart import Chart\n", 31 | "import requests\n", 32 | "import json" 33 | ] 34 | }, 35 | { 36 | "cell_type": "markdown", 37 | "id": "131fd3c7-bacc-4bfb-ae09-d5800a7be170", 38 | "metadata": {}, 39 | "source": [ 40 | "## Prepare Data" 41 | ] 42 | }, 43 | { 44 | "cell_type": "code", 45 | "execution_count": null, 46 | "id": "3c274c54-ddde-40de-b650-b7a5a001ab77", 47 | "metadata": { 48 | "tags": [] 49 | }, 50 | "outputs": [], 51 | "source": [ 52 | "response = requests.get('https://cdn.jsdelivr.net/gh/highcharts/highcharts@c116b6fa6948448/samples/data/us-counties-unemployment.json')\n", 53 | "data_as_str = response.text\n", 54 | "data_as_obj = json.loads(data_as_str)" 55 | ] 56 | }, 57 | { 58 | "cell_type": "markdown", 59 | "id": "089b8f43-ea01-4753-a52f-bfd1e23d948d", 60 | "metadata": {}, 61 | "source": [ 62 | "## Prepare Options" 63 | ] 64 | }, 65 | { 66 | "cell_type": "code", 67 | "execution_count": null, 68 | "id": "e8f030f9-6f9c-445b-b0f5-9f6b2118c865", 69 | "metadata": { 70 | "tags": [] 71 | }, 72 | "outputs": [], 73 | "source": [ 74 | "options = {\n", 75 | " 'chart': {\n", 76 | " 'map': 'https://code.highcharts.com/mapdata/countries/us/us-all-all.topo.json',\n", 77 | " 'borderWidth': 1,\n", 78 | " 'marginRight': 20\n", 79 | " },\n", 80 | "\n", 81 | " 'title': {\n", 82 | " 'text': 'US Counties unemployment rates, January 2018'\n", 83 | " },\n", 84 | "\n", 85 | " 'accessibility': {\n", 86 | " 'description': 'Demo showing a large dataset.'\n", 87 | " },\n", 88 | "\n", 89 | " 'legend': {\n", 90 | " 'layout': 'vertical',\n", 91 | " 'align': 'right',\n", 92 | " 'floating': True,\n", 93 | " 'backgroundColor': 'rgba(255, 255, 255, 0.85)'\n", 94 | " },\n", 95 | "\n", 96 | " 'mapNavigation': {\n", 97 | " 'enabled': True\n", 98 | " },\n", 99 | "\n", 100 | " 'colorAxis': {\n", 101 | " 'min': 0,\n", 102 | " 'max': 25,\n", 103 | " 'tickInterval': 5,\n", 104 | " 'stops': [[0, '#F1EEF6'], [0.65, '#900037'], [1, '#500007']],\n", 105 | " 'labels': {\n", 106 | " 'format': '{value}%'\n", 107 | " }\n", 108 | " },\n", 109 | "\n", 110 | " 'plotOptions': {\n", 111 | " 'mapline': {\n", 112 | " 'showInLegend': False,\n", 113 | " 'enableMouseTracking': False\n", 114 | " }\n", 115 | " },\n", 116 | "\n", 117 | " 'series': [{\n", 118 | " 'data': data_as_obj,\n", 119 | " 'joinBy': ['hc-key', 'code'],\n", 120 | " 'name': 'Unemployment rate',\n", 121 | " 'tooltip': {\n", 122 | " 'valueSuffix': '%'\n", 123 | " },\n", 124 | " 'borderWidth': 0.5,\n", 125 | " 'states': {\n", 126 | " 'hover': {\n", 127 | " 'color': '#a4edba'\n", 128 | " }\n", 129 | " },\n", 130 | " 'shadow': False,\n", 131 | " 'accessibility': {\n", 132 | " 'enabled': False\n", 133 | " },\n", 134 | " 'type': 'map'\n", 135 | " }, {\n", 136 | " 'type': 'mapline',\n", 137 | " 'name': 'State borders',\n", 138 | " 'color': 'white',\n", 139 | " 'shadow': False,\n", 140 | " 'borderWidth': 2,\n", 141 | " 'accessibility': {\n", 142 | " 'enabled': False\n", 143 | " }\n", 144 | " }]\n", 145 | "}" 146 | ] 147 | }, 148 | { 149 | "cell_type": "markdown", 150 | "id": "b06bf4c1-988c-49de-994e-96d6948a440e", 151 | "metadata": {}, 152 | "source": [ 153 | "## Generate Chart" 154 | ] 155 | }, 156 | { 157 | "cell_type": "code", 158 | "execution_count": null, 159 | "id": "57aa98fa-be9a-462c-8b07-eb2e97de4f13", 160 | "metadata": { 161 | "tags": [] 162 | }, 163 | "outputs": [], 164 | "source": [ 165 | "chart = Chart.from_options(options)\n", 166 | "chart.is_maps_chart = True" 167 | ] 168 | }, 169 | { 170 | "cell_type": "markdown", 171 | "id": "8e558de2-ec54-456f-b223-98c1dde8d19f", 172 | "metadata": {}, 173 | "source": [ 174 | "## Display the Chart" 175 | ] 176 | }, 177 | { 178 | "cell_type": "code", 179 | "execution_count": null, 180 | "id": "17bed092-879b-41c2-a47f-b74ff25ba12e", 181 | "metadata": { 182 | "tags": [] 183 | }, 184 | "outputs": [], 185 | "source": [ 186 | "chart.display()" 187 | ] 188 | }, 189 | { 190 | "cell_type": "code", 191 | "execution_count": null, 192 | "id": "a4325f54-3a52-41e3-af3d-696bc1a1be55", 193 | "metadata": {}, 194 | "outputs": [], 195 | "source": [] 196 | } 197 | ], 198 | "metadata": { 199 | "kernelspec": { 200 | "display_name": "Python 3 (ipykernel)", 201 | "language": "python", 202 | "name": "python3" 203 | }, 204 | "language_info": { 205 | "codemirror_mode": { 206 | "name": "ipython", 207 | "version": 3 208 | }, 209 | "file_extension": ".py", 210 | "mimetype": "text/x-python", 211 | "name": "python", 212 | "nbconvert_exporter": "python", 213 | "pygments_lexer": "ipython3", 214 | "version": "3.10.5" 215 | } 216 | }, 217 | "nbformat": 4, 218 | "nbformat_minor": 5 219 | } 220 | -------------------------------------------------------------------------------- /highcharts-core/other-chart-types/arcdiagram.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "markdown", 5 | "id": "0c26872a-fc19-4f08-9fd9-ce0b0d961f27", 6 | "metadata": {}, 7 | "source": [ 8 | "# Arc Diagram\n", 9 | "Arc diagram chart with circles of different sizes along the X axis, and connections drawn as arcs between them. From the chart we can see that Paris is the city with the most connections to other cities." 10 | ] 11 | }, 12 | { 13 | "cell_type": "markdown", 14 | "id": "6b461423-bdfe-46fd-ac5e-89a8191948e5", 15 | "metadata": {}, 16 | "source": [ 17 | "## Import Dependencies" 18 | ] 19 | }, 20 | { 21 | "cell_type": "code", 22 | "execution_count": null, 23 | "id": "6ebbd6b7-cd27-4304-9d60-5e5cb2950063", 24 | "metadata": {}, 25 | "outputs": [], 26 | "source": [ 27 | "from highcharts_core.chart import Chart\n", 28 | "from highcharts_core.options import HighchartsOptions" 29 | ] 30 | }, 31 | { 32 | "cell_type": "markdown", 33 | "id": "a07d8167-8441-4d14-97e6-f40983f37278", 34 | "metadata": {}, 35 | "source": [ 36 | "## Configure Options" 37 | ] 38 | }, 39 | { 40 | "cell_type": "code", 41 | "execution_count": null, 42 | "id": "2d4b0bda-3c20-4af7-bf76-caff71606fed", 43 | "metadata": {}, 44 | "outputs": [], 45 | "source": [ 46 | "options_as_str = \"\"\"{\n", 47 | "\n", 48 | " colors: ['#293462', '#a64942', '#fe5f55', '#fff1c1', '#5bd1d7', '#ff502f', '#004d61', '#ff8a5c', '#fff591', '#f5587b', '#fad3cf', '#a696c8', '#5BE7C4', '#266A2E', '#593E1A'],\n", 49 | "\n", 50 | " title: {\n", 51 | " text: 'Main train connections in Europe'\n", 52 | " },\n", 53 | "\n", 54 | " accessibility: {\n", 55 | " description: 'Arc diagram chart with circles of different sizes along the X axis, and connections drawn as arcs between them. From the chart we can see that Paris is the city with the most connections to other cities.',\n", 56 | " point: {\n", 57 | " valueDescriptionFormat: 'Connection from {point.from} to {point.to}.'\n", 58 | " }\n", 59 | " },\n", 60 | "\n", 61 | " series: [{\n", 62 | " keys: ['from', 'to', 'weight'],\n", 63 | " type: 'arcdiagram',\n", 64 | " name: 'Train connections',\n", 65 | " linkWeight: 1,\n", 66 | " centeredLinks: true,\n", 67 | " dataLabels: {\n", 68 | " rotation: 90,\n", 69 | " y: 30,\n", 70 | " align: 'left',\n", 71 | " color: 'black'\n", 72 | " },\n", 73 | " offset: '65%',\n", 74 | " data: [\n", 75 | " ['Hamburg', 'Stuttgart', 1],\n", 76 | " ['Hamburg', 'Frankfurt', 1],\n", 77 | " ['Hamburg', 'München', 1],\n", 78 | " ['Hannover', 'Wien', 1],\n", 79 | " ['Hannover', 'München', 1],\n", 80 | " ['Berlin', 'Wien', 1],\n", 81 | " ['Berlin', 'München', 1],\n", 82 | " ['Berlin', 'Stuttgart', 1],\n", 83 | " ['Berlin', 'Frankfurt', 1],\n", 84 | " ['Berlin', 'Köln', 1],\n", 85 | " ['Berlin', 'Düsseldorf', 1],\n", 86 | " ['München', 'Düsseldorf', 1],\n", 87 | " ['München', 'Wien', 1],\n", 88 | " ['München', 'Frankfurt', 1],\n", 89 | " ['München', 'Köln', 1],\n", 90 | " ['München', 'Amsterdam', 1],\n", 91 | " ['Stuttgart', 'Wien', 1],\n", 92 | " ['Frankfurt', 'Wien', 1],\n", 93 | " ['Frankfurt', 'Amsterdam', 1],\n", 94 | " ['Frankfurt', 'Paris', 1],\n", 95 | " ['Frankfurt', 'Budapest', 1],\n", 96 | " ['Düsseldorf', 'Wien', 1],\n", 97 | " ['Düsseldorf', 'Hamburg', 1],\n", 98 | " ['Amsterdam', 'Paris', 1],\n", 99 | " ['Paris', 'Brest', 1],\n", 100 | " ['Paris', 'Nantes', 1],\n", 101 | " ['Paris', 'Bayonne', 1],\n", 102 | " ['Paris', 'Bordeaux', 1],\n", 103 | " ['Paris', 'Toulouse', 1],\n", 104 | " ['Paris', 'Montpellier', 1],\n", 105 | " ['Paris', 'Marseille', 1],\n", 106 | " ['Paris', 'Nice', 1],\n", 107 | " ['Paris', 'Milano', 1],\n", 108 | " ['Nantes', 'Nice', 1],\n", 109 | " ['Bordeaux', 'Lyon', 1],\n", 110 | " ['Nantes', 'Lyon', 1],\n", 111 | " ['Milano', 'München', 1],\n", 112 | " ['Milano', 'Roma', 1],\n", 113 | " ['Milano', 'Bari', 1],\n", 114 | " ['Milano', 'Napoli', 1],\n", 115 | " ['Milano', 'Brindisi', 1],\n", 116 | " ['Milano', 'Lamezia Terme', 1],\n", 117 | " ['Torino', 'Roma', 1],\n", 118 | " ['Venezia', 'Napoli', 1],\n", 119 | " ['Roma', 'Bari', 1],\n", 120 | " ['Roma', 'Catania', 1],\n", 121 | " ['Roma', 'Brindisi', 1],\n", 122 | " ['Catania', 'Milano', 1]\n", 123 | " ]\n", 124 | " }]\n", 125 | "\n", 126 | "}\"\"\"\n", 127 | "options = HighchartsOptions.from_js_literal(options_as_str)" 128 | ] 129 | }, 130 | { 131 | "cell_type": "code", 132 | "execution_count": null, 133 | "id": "71cd0e89-da09-4fa0-bdef-8ed5ce5db44a", 134 | "metadata": { 135 | "tags": [] 136 | }, 137 | "outputs": [], 138 | "source": [ 139 | "chart = Chart.from_options(options)\n", 140 | "chart.display()" 141 | ] 142 | }, 143 | { 144 | "cell_type": "code", 145 | "execution_count": null, 146 | "id": "ab68da56-8e96-4451-9d98-6a93041e33ac", 147 | "metadata": {}, 148 | "outputs": [], 149 | "source": [] 150 | } 151 | ], 152 | "metadata": { 153 | "kernelspec": { 154 | "display_name": "Python 3 (ipykernel)", 155 | "language": "python", 156 | "name": "python3" 157 | }, 158 | "language_info": { 159 | "codemirror_mode": { 160 | "name": "ipython", 161 | "version": 3 162 | }, 163 | "file_extension": ".py", 164 | "mimetype": "text/x-python", 165 | "name": "python", 166 | "nbconvert_exporter": "python", 167 | "pygments_lexer": "ipython3", 168 | "version": "3.10.5" 169 | } 170 | }, 171 | "nbformat": 4, 172 | "nbformat_minor": 5 173 | } 174 | -------------------------------------------------------------------------------- /highcharts-maps/heatmaps/mapbubble-chart.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "markdown", 5 | "id": "47294813-79d0-43a9-9337-cb573859ed10", 6 | "metadata": {}, 7 | "source": [ 8 | "# Map Bubble Chart\n", 9 | "This demo shows how to assemble a **Map Bubble** chart using Highcharts Maps for Python." 10 | ] 11 | }, 12 | { 13 | "cell_type": "markdown", 14 | "id": "c0669da6-fc33-44c7-b411-1d345d8ebb43", 15 | "metadata": {}, 16 | "source": [ 17 | "## Import Dependencies" 18 | ] 19 | }, 20 | { 21 | "cell_type": "code", 22 | "execution_count": null, 23 | "id": "6857426f-0640-4d0b-be61-37983ed57c6c", 24 | "metadata": {}, 25 | "outputs": [], 26 | "source": [ 27 | "from highcharts_maps.chart import Chart\n", 28 | "from highcharts_maps.options import HighchartsMapsOptions\n", 29 | "from highcharts_maps.options.series.map import MapSeries\n", 30 | "from highcharts_maps.options.series.mapbubble import MapBubbleSeries\n", 31 | "import requests" 32 | ] 33 | }, 34 | { 35 | "cell_type": "markdown", 36 | "id": "f35f89a4-c1e0-442a-8690-b580b28b46d3", 37 | "metadata": {}, 38 | "source": [ 39 | "## Download Map Data and Data" 40 | ] 41 | }, 42 | { 43 | "cell_type": "code", 44 | "execution_count": null, 45 | "id": "f2b2db41-587e-409d-92e5-47622e63504f", 46 | "metadata": {}, 47 | "outputs": [], 48 | "source": [ 49 | "topology_response = requests.get('https://code.highcharts.com/mapdata/custom/world.topo.json')\n", 50 | "topology = topology_response.text\n", 51 | "\n", 52 | "data_response = requests.get('https://cdn.jsdelivr.net/gh/highcharts/highcharts@v7.0.0/samples/data/world-population.json')\n", 53 | "data = data_response.text" 54 | ] 55 | }, 56 | { 57 | "cell_type": "markdown", 58 | "id": "cf28a6f6-344a-4d73-aafa-47eef1813a41", 59 | "metadata": {}, 60 | "source": [ 61 | "## Assemble Chart Options" 62 | ] 63 | }, 64 | { 65 | "cell_type": "code", 66 | "execution_count": null, 67 | "id": "540d4b99-62a0-4f31-b34c-2d8effa133b4", 68 | "metadata": {}, 69 | "outputs": [], 70 | "source": [ 71 | "options_as_dict = {\n", 72 | " 'chart': {\n", 73 | " 'borderWidth': 1,\n", 74 | " 'map': topology\n", 75 | " },\n", 76 | "\n", 77 | " 'title': {\n", 78 | " 'text': 'World population 2013 by country'\n", 79 | " },\n", 80 | "\n", 81 | " 'subtitle': {\n", 82 | " 'text': 'Demo of Highcharts map with bubbles'\n", 83 | " },\n", 84 | "\n", 85 | " 'accessibility': {\n", 86 | " 'description': 'We see how China and India by far are the countries with the largest population.'\n", 87 | " },\n", 88 | "\n", 89 | " 'legend': {\n", 90 | " 'enabled': False\n", 91 | " },\n", 92 | "\n", 93 | " 'mapNavigation': {\n", 94 | " 'enabled': True,\n", 95 | " 'buttonOptions': {\n", 96 | " 'verticalAlign': 'bottom'\n", 97 | " }\n", 98 | " },\n", 99 | "\n", 100 | " 'mapView': {\n", 101 | " 'fitToGeometry': {\n", 102 | " 'type': 'MultiPoint',\n", 103 | " 'coordinates': [\n", 104 | " # Alaska west\n", 105 | " [-164, 54],\n", 106 | " # Greenland north\n", 107 | " [-35, 84],\n", 108 | " # New Zealand east\n", 109 | " [179, -38],\n", 110 | " # Chile south\n", 111 | " [-68, -55]\n", 112 | " ]\n", 113 | " }\n", 114 | " }\n", 115 | "}\n", 116 | "options = HighchartsMapsOptions.from_dict(options_as_dict)" 117 | ] 118 | }, 119 | { 120 | "cell_type": "markdown", 121 | "id": "d901ae11-1f5b-494d-b4b7-3a67016241ee", 122 | "metadata": {}, 123 | "source": [ 124 | "## Assemble the Series" 125 | ] 126 | }, 127 | { 128 | "cell_type": "code", 129 | "execution_count": null, 130 | "id": "f4d913ff-02bd-4eaf-897d-9840c8ef34f9", 131 | "metadata": {}, 132 | "outputs": [], 133 | "source": [ 134 | "map_series = MapSeries(name = 'Countries', color = '#E0E0E0', enable_mouse_tracking = False)\n", 135 | "bubble_series = MapBubbleSeries(name = 'Population 2016',\n", 136 | " join_by = ['iso-a3', 'code3'],\n", 137 | " data = data,\n", 138 | " min_size = 4,\n", 139 | " max_size = '12%',\n", 140 | " tooltip = {\n", 141 | " 'pointFormat': '{point.properties.hc-a2}: {point.z} thousands'\n", 142 | " })\n", 143 | "options.add_series(map_series, bubble_series)" 144 | ] 145 | }, 146 | { 147 | "cell_type": "markdown", 148 | "id": "a0719190-1022-4ed7-90b1-5bbac2413948", 149 | "metadata": {}, 150 | "source": [ 151 | "## Assemble and Display the Chart" 152 | ] 153 | }, 154 | { 155 | "cell_type": "code", 156 | "execution_count": null, 157 | "id": "9550b861-1697-483b-849a-094fbca32602", 158 | "metadata": {}, 159 | "outputs": [], 160 | "source": [ 161 | "chart = Chart.from_options(options)\n", 162 | "chart.display()" 163 | ] 164 | }, 165 | { 166 | "cell_type": "code", 167 | "execution_count": null, 168 | "id": "16306c31-2e3f-4255-8fc5-62c65a82f83e", 169 | "metadata": { 170 | "tags": [] 171 | }, 172 | "outputs": [], 173 | "source": [] 174 | }, 175 | { 176 | "cell_type": "code", 177 | "execution_count": null, 178 | "id": "210e5b98-4bdf-41f6-b5ef-0bce41c1f896", 179 | "metadata": {}, 180 | "outputs": [], 181 | "source": [] 182 | } 183 | ], 184 | "metadata": { 185 | "kernelspec": { 186 | "display_name": "Python 3 (ipykernel)", 187 | "language": "python", 188 | "name": "python3" 189 | }, 190 | "language_info": { 191 | "codemirror_mode": { 192 | "name": "ipython", 193 | "version": 3 194 | }, 195 | "file_extension": ".py", 196 | "mimetype": "text/x-python", 197 | "name": "python", 198 | "nbconvert_exporter": "python", 199 | "pygments_lexer": "ipython3", 200 | "version": "3.10.5" 201 | } 202 | }, 203 | "nbformat": 4, 204 | "nbformat_minor": 5 205 | } 206 | -------------------------------------------------------------------------------- /highcharts-maps/input-formats/topojson.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "markdown", 5 | "id": "f86b86ac-6eb9-4ca4-ad4d-382e2febd3bb", 6 | "metadata": {}, 7 | "source": [ 8 | "# Basic Latitude / Longitude Demo\n", 9 | "This demo shows a basic map whose map data is encoded using TopoJSON with latitude and longitude points." 10 | ] 11 | }, 12 | { 13 | "cell_type": "markdown", 14 | "id": "bf3ac5e1-7ad4-4eab-afb5-94b8630b698f", 15 | "metadata": {}, 16 | "source": [ 17 | "## Import Dependencies" 18 | ] 19 | }, 20 | { 21 | "cell_type": "code", 22 | "execution_count": null, 23 | "id": "2c8c44d1-55f8-406a-b0fa-d8e878a83b11", 24 | "metadata": { 25 | "tags": [] 26 | }, 27 | "outputs": [], 28 | "source": [ 29 | "from highcharts_maps.chart import Chart\n", 30 | "from highcharts_maps.options import HighchartsMapsOptions\n", 31 | "import requests" 32 | ] 33 | }, 34 | { 35 | "cell_type": "markdown", 36 | "id": "89a27739-f417-4c5d-acc2-0e598f0d3dc5", 37 | "metadata": {}, 38 | "source": [ 39 | "## Load Map Data" 40 | ] 41 | }, 42 | { 43 | "cell_type": "code", 44 | "execution_count": null, 45 | "id": "73a26127-af12-4755-bb0c-3e6156ef3e45", 46 | "metadata": { 47 | "tags": [] 48 | }, 49 | "outputs": [], 50 | "source": [ 51 | "topology_response = requests.get('https://code.highcharts.com/mapdata/countries/gb/gb-all.topo.json')\n", 52 | "topology = topology_response.text" 53 | ] 54 | }, 55 | { 56 | "cell_type": "markdown", 57 | "id": "67acd36f-c30a-46de-a810-5ef53e5e24b9", 58 | "metadata": {}, 59 | "source": [ 60 | "## Configure Options" 61 | ] 62 | }, 63 | { 64 | "cell_type": "code", 65 | "execution_count": null, 66 | "id": "a232e303-a22d-4c1c-8e08-3289e1d7ea4c", 67 | "metadata": { 68 | "tags": [] 69 | }, 70 | "outputs": [], 71 | "source": [ 72 | "as_dict = {\n", 73 | " 'chart': {\n", 74 | " 'map': topology\n", 75 | " },\n", 76 | "\n", 77 | " 'title': {\n", 78 | " 'text': 'Highcharts Maps Basic Lat/Lon Demo'\n", 79 | " },\n", 80 | "\n", 81 | " 'accessibility': {\n", 82 | " 'description': 'Map where city locations have been defined using latitude/longitude.'\n", 83 | " },\n", 84 | "\n", 85 | " 'mapNavigation': {\n", 86 | " 'enabled': True\n", 87 | " },\n", 88 | "\n", 89 | " 'tooltip': {\n", 90 | " 'headerFormat': '',\n", 91 | " 'pointFormat': '{point.name}
Lat: {point.lat}, Lon: {point.lon}'\n", 92 | " },\n", 93 | "\n", 94 | " 'series': [{\n", 95 | " 'type': 'map',\n", 96 | " 'name': 'Great Britain',\n", 97 | " 'borderColor': '#A0A0A0',\n", 98 | " 'nullColor': 'rgba(200, 200, 200, 0.3)',\n", 99 | " 'showInLegend': False\n", 100 | " }, {\n", 101 | " 'name': 'Separators',\n", 102 | " 'type': 'mapline',\n", 103 | " 'nullColor': '#707070',\n", 104 | " 'showInLegend': False,\n", 105 | " 'enableMouseTracking': False,\n", 106 | " 'accessibility': {\n", 107 | " 'enabled': False\n", 108 | " }\n", 109 | " }, {\n", 110 | " 'type': 'mappoint',\n", 111 | " 'name': 'Cities',\n", 112 | " 'accessibility': {\n", 113 | " 'point': {\n", 114 | " 'valueDescriptionFormat': '{xDescription}. Lat: {point.lat:.2f}, lon: {point.lon:.2f}.'\n", 115 | " }\n", 116 | " },\n", 117 | " 'color': '#000',\n", 118 | " 'data': [{\n", 119 | " 'name': 'London',\n", 120 | " 'lat': 51.507222,\n", 121 | " 'lon': -0.1275\n", 122 | " }, {\n", 123 | " 'name': 'Birmingham',\n", 124 | " 'lat': 52.483056,\n", 125 | " 'lon': -1.893611\n", 126 | " }, {\n", 127 | " 'name': 'Leeds',\n", 128 | " 'lat': 53.799722,\n", 129 | " 'lon': -1.549167\n", 130 | " }, {\n", 131 | " 'name': 'Glasgow',\n", 132 | " 'lat': 55.858,\n", 133 | " 'lon': -4.259\n", 134 | " }, {\n", 135 | " 'name': 'Sheffield',\n", 136 | " 'lat': 53.383611,\n", 137 | " 'lon': -1.466944\n", 138 | " }, {\n", 139 | " 'name': 'Liverpool',\n", 140 | " 'lat': 53.4,\n", 141 | " 'lon': -3\n", 142 | " }, {\n", 143 | " 'name': 'Bristol',\n", 144 | " 'lat': 51.45,\n", 145 | " 'lon': -2.583333\n", 146 | " }, {\n", 147 | " 'name': 'Belfast',\n", 148 | " 'lat': 54.597,\n", 149 | " 'lon': -5.93\n", 150 | " }, {\n", 151 | " 'name': 'Lerwick',\n", 152 | " 'lat': 60.155,\n", 153 | " 'lon': -1.145,\n", 154 | " 'dataLabels': {\n", 155 | " 'align': 'left',\n", 156 | " 'x': 5,\n", 157 | " 'verticalAlign': 'middle'\n", 158 | " }\n", 159 | " }]\n", 160 | " }]\n", 161 | "}" 162 | ] 163 | }, 164 | { 165 | "cell_type": "markdown", 166 | "id": "85a0ce12-8341-4fa3-acce-8d2cc4bba238", 167 | "metadata": {}, 168 | "source": [ 169 | "## Assemble and Display Chart" 170 | ] 171 | }, 172 | { 173 | "cell_type": "code", 174 | "execution_count": null, 175 | "id": "76efd090-f826-4579-8e81-249702a2ab4c", 176 | "metadata": { 177 | "tags": [] 178 | }, 179 | "outputs": [], 180 | "source": [ 181 | "chart = Chart.from_options(as_dict)\n", 182 | "chart.display()" 183 | ] 184 | }, 185 | { 186 | "cell_type": "code", 187 | "execution_count": null, 188 | "id": "d8f714a3-ed9d-4831-ad64-25a42df83f3a", 189 | "metadata": {}, 190 | "outputs": [], 191 | "source": [] 192 | } 193 | ], 194 | "metadata": { 195 | "kernelspec": { 196 | "display_name": "Python 3 (ipykernel)", 197 | "language": "python", 198 | "name": "python3" 199 | }, 200 | "language_info": { 201 | "codemirror_mode": { 202 | "name": "ipython", 203 | "version": 3 204 | }, 205 | "file_extension": ".py", 206 | "mimetype": "text/x-python", 207 | "name": "python", 208 | "nbconvert_exporter": "python", 209 | "pygments_lexer": "ipython3", 210 | "version": "3.10.5" 211 | } 212 | }, 213 | "nbformat": 4, 214 | "nbformat_minor": 5 215 | } 216 | -------------------------------------------------------------------------------- /highcharts-stock/stock-features/macd-and-pivot-points.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "markdown", 5 | "id": "3d033821-eebd-4e56-8d75-1640001f6451", 6 | "metadata": {}, 7 | "source": [ 8 | "# MACD and Pivot Points Demo\n", 9 | "Demonstrating a Highcharts Stock chart that adds the MACD and Pivot Point technical indicators." 10 | ] 11 | }, 12 | { 13 | "cell_type": "markdown", 14 | "id": "19324d42-e2dd-41a3-a12f-ca8fbceda5ec", 15 | "metadata": {}, 16 | "source": [ 17 | "## Import Dependencies" 18 | ] 19 | }, 20 | { 21 | "cell_type": "code", 22 | "execution_count": null, 23 | "id": "9962170c-4f90-41f7-873e-0599ab54c046", 24 | "metadata": { 25 | "tags": [] 26 | }, 27 | "outputs": [], 28 | "source": [ 29 | "from highcharts_stock.constants import EnforcedNull\n", 30 | "from highcharts_stock.chart import Chart\n", 31 | "import requests" 32 | ] 33 | }, 34 | { 35 | "cell_type": "markdown", 36 | "id": "131fd3c7-bacc-4bfb-ae09-d5800a7be170", 37 | "metadata": {}, 38 | "source": [ 39 | "# Prepare Data" 40 | ] 41 | }, 42 | { 43 | "cell_type": "code", 44 | "execution_count": null, 45 | "id": "3c274c54-ddde-40de-b650-b7a5a001ab77", 46 | "metadata": { 47 | "tags": [] 48 | }, 49 | "outputs": [], 50 | "source": [ 51 | "response = requests.get('https://demo-live-data.highcharts.com/aapl-ohlc.json')\n", 52 | "data = response.text" 53 | ] 54 | }, 55 | { 56 | "cell_type": "markdown", 57 | "id": "089b8f43-ea01-4753-a52f-bfd1e23d948d", 58 | "metadata": {}, 59 | "source": [ 60 | "## Prepare Options" 61 | ] 62 | }, 63 | { 64 | "cell_type": "code", 65 | "execution_count": null, 66 | "id": "e8f030f9-6f9c-445b-b0f5-9f6b2118c865", 67 | "metadata": { 68 | "jupyter": { 69 | "source_hidden": true 70 | }, 71 | "tags": [] 72 | }, 73 | "outputs": [], 74 | "source": [ 75 | "options = {\n", 76 | " 'rangeSelector': {\n", 77 | " 'selected': 2\n", 78 | " },\n", 79 | "\n", 80 | " 'yAxis': [{\n", 81 | " 'height': '75%',\n", 82 | " 'resize': {\n", 83 | " 'enabled': True\n", 84 | " },\n", 85 | " 'labels': {\n", 86 | " 'align': 'right',\n", 87 | " 'x': -3\n", 88 | " },\n", 89 | " 'title': {\n", 90 | " 'text': 'AAPL'\n", 91 | " }\n", 92 | " }, {\n", 93 | " 'top': '75%',\n", 94 | " 'height': '25%',\n", 95 | " 'labels': {\n", 96 | " 'align': 'right',\n", 97 | " 'x': -3\n", 98 | " },\n", 99 | " 'offset': 0,\n", 100 | " 'title': {\n", 101 | " 'text': 'MACD'\n", 102 | " }\n", 103 | " }],\n", 104 | "\n", 105 | " 'title': {\n", 106 | " 'text': 'AAPL Stock Price'\n", 107 | " },\n", 108 | "\n", 109 | " 'subtitle': {\n", 110 | " 'text': 'With MACD and Pivot Points technical indicators'\n", 111 | " },\n", 112 | "\n", 113 | " 'series': [{\n", 114 | " 'type': 'ohlc',\n", 115 | " 'id': 'aapl',\n", 116 | " 'name': 'AAPL Stock Price',\n", 117 | " 'data': data,\n", 118 | " 'zIndex': 1\n", 119 | " }]\n", 120 | "}" 121 | ] 122 | }, 123 | { 124 | "cell_type": "markdown", 125 | "id": "b06bf4c1-988c-49de-994e-96d6948a440e", 126 | "metadata": {}, 127 | "source": [ 128 | "## Generate Chart" 129 | ] 130 | }, 131 | { 132 | "cell_type": "code", 133 | "execution_count": null, 134 | "id": "57aa98fa-be9a-462c-8b07-eb2e97de4f13", 135 | "metadata": { 136 | "tags": [] 137 | }, 138 | "outputs": [], 139 | "source": [ 140 | "chart = Chart.from_options(options)\n", 141 | "chart.is_stock_chart = True" 142 | ] 143 | }, 144 | { 145 | "cell_type": "markdown", 146 | "id": "bac702f0-34c5-4532-90a3-638a8d36ffb9", 147 | "metadata": {}, 148 | "source": [ 149 | "## Add Technical Indicators" 150 | ] 151 | }, 152 | { 153 | "cell_type": "code", 154 | "execution_count": null, 155 | "id": "d7b3b207-476b-4015-84e6-6bba06e6129d", 156 | "metadata": { 157 | "tags": [] 158 | }, 159 | "outputs": [], 160 | "source": [ 161 | "chart = chart.options.series[0].add_indicator(chart, \n", 162 | " 'macd', \n", 163 | " indicator_kwargs = {\n", 164 | " 'y_axis': 1\n", 165 | " })\n", 166 | "chart = chart.options.series[0].add_indicator(chart, \n", 167 | " 'pivotpoints', \n", 168 | " indicator_kwargs = {\n", 169 | " 'z_index': 0,\n", 170 | " 'line_width': 1,\n", 171 | " 'data_labels': {\n", 172 | " 'overflow': 'none',\n", 173 | " 'crop': False,\n", 174 | " 'y': 4,\n", 175 | " 'style': {\n", 176 | " 'font_size': 9\n", 177 | " }\n", 178 | " }\n", 179 | " })" 180 | ] 181 | }, 182 | { 183 | "cell_type": "markdown", 184 | "id": "8e558de2-ec54-456f-b223-98c1dde8d19f", 185 | "metadata": {}, 186 | "source": [ 187 | "## Display the Chart" 188 | ] 189 | }, 190 | { 191 | "cell_type": "code", 192 | "execution_count": null, 193 | "id": "17bed092-879b-41c2-a47f-b74ff25ba12e", 194 | "metadata": { 195 | "tags": [] 196 | }, 197 | "outputs": [], 198 | "source": [ 199 | "chart.display()" 200 | ] 201 | }, 202 | { 203 | "cell_type": "code", 204 | "execution_count": null, 205 | "id": "80d5248d-bd84-4d11-9b96-1e990d46d0db", 206 | "metadata": {}, 207 | "outputs": [], 208 | "source": [] 209 | } 210 | ], 211 | "metadata": { 212 | "kernelspec": { 213 | "display_name": "Python 3 (ipykernel)", 214 | "language": "python", 215 | "name": "python3" 216 | }, 217 | "language_info": { 218 | "codemirror_mode": { 219 | "name": "ipython", 220 | "version": 3 221 | }, 222 | "file_extension": ".py", 223 | "mimetype": "text/x-python", 224 | "name": "python", 225 | "nbconvert_exporter": "python", 226 | "pygments_lexer": "ipython3", 227 | "version": "3.10.5" 228 | } 229 | }, 230 | "nbformat": 4, 231 | "nbformat_minor": 5 232 | } 233 | -------------------------------------------------------------------------------- /highcharts-core/line-charts/basic-line.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "markdown", 5 | "id": "b61ab4e2-55d4-4159-96c0-b5ab12954d59", 6 | "metadata": {}, 7 | "source": [ 8 | "# Basic Line Demo\n", 9 | "Basic line chart showing trends in a dataset. This chart includes the series-label module, which adds a label to each line for enhanced readability." 10 | ] 11 | }, 12 | { 13 | "cell_type": "markdown", 14 | "id": "36247b6d-8b86-4c54-9142-b47d3f994eca", 15 | "metadata": { 16 | "tags": [] 17 | }, 18 | "source": [ 19 | "## Import the Library Components" 20 | ] 21 | }, 22 | { 23 | "cell_type": "code", 24 | "execution_count": null, 25 | "id": "03fde0d1-880a-467a-9aac-777ebf7c59f3", 26 | "metadata": { 27 | "tags": [] 28 | }, 29 | "outputs": [], 30 | "source": [ 31 | "from highcharts_core.chart import Chart\n", 32 | "from highcharts_core.options import HighchartsOptions\n", 33 | "from highcharts_core.options.plot_options import PlotOptions\n", 34 | "from highcharts_core.options.axes.x_axis import XAxis\n", 35 | "from highcharts_core.options.axes.y_axis import YAxis\n", 36 | "from highcharts_core.options.axes.accessibility import AxisAccessibility\n", 37 | "from highcharts_core.options.axes.title import AxisTitle\n", 38 | "from highcharts_core.options.title import Title\n", 39 | "from highcharts_core.options.subtitle import Subtitle\n", 40 | "from highcharts_core.options.legend import Legend\n", 41 | "from highcharts_core.options.plot_options.series import SeriesOptions\n", 42 | "from highcharts_core.options.series.area import LineSeries\n", 43 | "from highcharts_core.options.series.labels import SeriesLabel\n", 44 | "from highcharts_core.options.responsive import Responsive, ResponsiveRules, Condition\n", 45 | "from highcharts_core.constants import EnforcedNull" 46 | ] 47 | }, 48 | { 49 | "cell_type": "markdown", 50 | "id": "e0000636-b68e-488e-b15f-988ebc1d8b6a", 51 | "metadata": {}, 52 | "source": [ 53 | "## Instantiate the Preliminary Chart Options" 54 | ] 55 | }, 56 | { 57 | "cell_type": "code", 58 | "execution_count": null, 59 | "id": "0a5ab4ab-0e15-4cbc-a2fb-83bf97e48d3f", 60 | "metadata": { 61 | "tags": [] 62 | }, 63 | "outputs": [], 64 | "source": [ 65 | "chart_options = HighchartsOptions(\n", 66 | " title = Title(text = 'U.S Solar Employment Growth by Job Category, 2010-2020',\n", 67 | " align = 'left'),\n", 68 | " subtitle = Subtitle(text = 'Source: IREC',\n", 69 | " align = 'left'),\n", 70 | " y_axis = YAxis(title = AxisTitle(text = 'Number of Employees')),\n", 71 | " x_axis = XAxis(\n", 72 | " accessibility = AxisAccessibility(range_description = 'Range: 2010 to 2020')\n", 73 | " ),\n", 74 | " legend = Legend(layout = 'vertical',\n", 75 | " align = 'right',\n", 76 | " vertical_align = 'middle'),\n", 77 | " plot_options = PlotOptions(series = SeriesOptions(point_start = 2010,\n", 78 | " label = SeriesLabel(connector_allowed = False)))\n", 79 | ")" 80 | ] 81 | }, 82 | { 83 | "cell_type": "markdown", 84 | "id": "c6c67da8-10ce-4237-91ed-bcdbedd6e210", 85 | "metadata": {}, 86 | "source": [ 87 | "## Instantiate the Responsive Configuration" 88 | ] 89 | }, 90 | { 91 | "cell_type": "code", 92 | "execution_count": null, 93 | "id": "6ca8409e-2276-46cd-9773-f2e13264587e", 94 | "metadata": { 95 | "tags": [] 96 | }, 97 | "outputs": [], 98 | "source": [ 99 | "override_options = HighchartsOptions(legend = Legend(layout = 'horizontal',\n", 100 | " align = 'center',\n", 101 | " vertical_align = 'bottom'))\n", 102 | "responsive_config = Responsive(\n", 103 | " rules = [\n", 104 | " ResponsiveRules(chart_options = override_options,\n", 105 | " condition = Condition(max_width = 500))\n", 106 | " ]\n", 107 | ")\n", 108 | "chart_options.responsive = responsive_config" 109 | ] 110 | }, 111 | { 112 | "cell_type": "markdown", 113 | "id": "83ea7d23-2026-4a15-9144-e30001406eb8", 114 | "metadata": {}, 115 | "source": [ 116 | "## Instantiate the Charts' Series (plural)" 117 | ] 118 | }, 119 | { 120 | "cell_type": "code", 121 | "execution_count": null, 122 | "id": "a51b0171-0852-4f72-94a5-af08626144a6", 123 | "metadata": { 124 | "tags": [] 125 | }, 126 | "outputs": [], 127 | "source": [ 128 | "series1 = LineSeries(name = 'Installation & Developers',\n", 129 | " data = [43934, 48656, 65165, 81827, 112143, 142383, 171533, 165174, 155157, 161454, 154610])\n", 130 | "series2 = LineSeries(name = 'Manufacturing',\n", 131 | " data = [24916, 37941, 29742, 29851, 32490, 30282, 38121, 36885, 33726, 34243, 31050])\n", 132 | "series3 = LineSeries(name = 'Sales & Distribution',\n", 133 | " data = [11744, 30000, 16005, 19771, 20185, 24377, 32147, 30912, 29243, 29213, 25663])\n", 134 | "series4 = LineSeries(name = 'Operations & Maintenance',\n", 135 | " data = [EnforcedNull, EnforcedNull, EnforcedNull, EnforcedNull, EnforcedNull, EnforcedNull, EnforcedNull, EnforcedNull, 11164, 11218, 10077])\n", 136 | "series5 = LineSeries(name = 'Other',\n", 137 | " data = [21908, 5548, 8105, 11248, 8989, 11816, 18274, 17300, 13053, 11906, 10073])\n", 138 | "\n", 139 | "chart_options.add_series(series1, series2, series3, series4, series5)" 140 | ] 141 | }, 142 | { 143 | "cell_type": "markdown", 144 | "id": "2294327c-46ec-425d-8f4e-0e618607c037", 145 | "metadata": {}, 146 | "source": [ 147 | "## Instantiate and Display the Chart" 148 | ] 149 | }, 150 | { 151 | "cell_type": "code", 152 | "execution_count": null, 153 | "id": "8fb6490d-cb69-4ed3-995b-8df7389caee3", 154 | "metadata": { 155 | "tags": [] 156 | }, 157 | "outputs": [], 158 | "source": [ 159 | "chart = Chart.from_options(chart_options)\n", 160 | "chart.display()" 161 | ] 162 | }, 163 | { 164 | "cell_type": "code", 165 | "execution_count": null, 166 | "id": "69ef4b1d-59e3-4482-9ad7-efe94b81aa38", 167 | "metadata": {}, 168 | "outputs": [], 169 | "source": [] 170 | } 171 | ], 172 | "metadata": { 173 | "kernelspec": { 174 | "display_name": "Python 3 (ipykernel)", 175 | "language": "python", 176 | "name": "python3" 177 | }, 178 | "language_info": { 179 | "codemirror_mode": { 180 | "name": "ipython", 181 | "version": 3 182 | }, 183 | "file_extension": ".py", 184 | "mimetype": "text/x-python", 185 | "name": "python", 186 | "nbconvert_exporter": "python", 187 | "pygments_lexer": "ipython3", 188 | "version": "3.10.5" 189 | } 190 | }, 191 | "nbformat": 4, 192 | "nbformat_minor": 5 193 | } 194 | -------------------------------------------------------------------------------- /highcharts-maps/heatmaps/heatmap-chart.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "markdown", 5 | "id": "b61ab4e2-55d4-4159-96c0-b5ab12954d59", 6 | "metadata": {}, 7 | "source": [ 8 | "# Heatmap Demo\n", 9 | "This demo depicts a (literal) heatmap, showing the temperature variation by day and hour throughout the month of May 2017." 10 | ] 11 | }, 12 | { 13 | "cell_type": "markdown", 14 | "id": "36247b6d-8b86-4c54-9142-b47d3f994eca", 15 | "metadata": { 16 | "tags": [] 17 | }, 18 | "source": [ 19 | "## Import Dependencies" 20 | ] 21 | }, 22 | { 23 | "cell_type": "code", 24 | "execution_count": null, 25 | "id": "03fde0d1-880a-467a-9aac-777ebf7c59f3", 26 | "metadata": { 27 | "tags": [] 28 | }, 29 | "outputs": [], 30 | "source": [ 31 | "from highcharts_maps import constants\n", 32 | "from highcharts_maps.chart import Chart\n", 33 | "from highcharts_maps.options.series.heatmap import HeatmapSeries\n", 34 | "import pandas\n", 35 | "import datetime" 36 | ] 37 | }, 38 | { 39 | "cell_type": "markdown", 40 | "id": "e0000636-b68e-488e-b15f-988ebc1d8b6a", 41 | "metadata": {}, 42 | "source": [ 43 | "## Prepare the Configuration" 44 | ] 45 | }, 46 | { 47 | "cell_type": "code", 48 | "execution_count": null, 49 | "id": "0a5ab4ab-0e15-4cbc-a2fb-83bf97e48d3f", 50 | "metadata": { 51 | "tags": [] 52 | }, 53 | "outputs": [], 54 | "source": [ 55 | "options_kwargs = {\n", 56 | " 'chart': {\n", 57 | " 'type': 'heatmap',\n", 58 | " 'inverted': True\n", 59 | " },\n", 60 | "\n", 61 | " 'accessibility': {\n", 62 | " 'description': 'We see how temperatures are warmer during the day, especially from around 9am to 9pm. May 8th through 11th are also overall colder days compared to the rest. Overall the temperatures range from around -1 degrees C to around 23 degrees C.'\n", 63 | " },\n", 64 | "\n", 65 | " 'title': {\n", 66 | " 'text': 'Highcharts Heat Map',\n", 67 | " 'align': 'left'\n", 68 | " },\n", 69 | "\n", 70 | " 'subtitle': {\n", 71 | " 'text': 'Temperature variation by day and hour through May 2017',\n", 72 | " 'align': 'left'\n", 73 | " },\n", 74 | "\n", 75 | " 'xAxis': {\n", 76 | " 'tickPixelInterval': 50,\n", 77 | " 'min': datetime.date(2017, 5, 1),\n", 78 | " 'max': datetime.date(2017, 5, 31),\n", 79 | " 'labels': {\n", 80 | " 'enabled': True,\n", 81 | " 'format': '{value:%Y-%m-%d}'\n", 82 | " }\n", 83 | " },\n", 84 | "\n", 85 | " 'yAxis': {\n", 86 | " 'accessibility': {\n", 87 | " 'description': 'Hours in the day'\n", 88 | " },\n", 89 | " 'title': {\n", 90 | " 'text': constants.EnforcedNull\n", 91 | " },\n", 92 | " 'labels': {\n", 93 | " 'format': '{value}:00'\n", 94 | " },\n", 95 | " 'minPadding': 0,\n", 96 | " 'maxPadding': 0,\n", 97 | " 'startOnTick': False,\n", 98 | " 'endOnTick': False,\n", 99 | " 'tickPositions': [0, 6, 12, 18, 24],\n", 100 | " 'tickWidth': 1,\n", 101 | " 'min': 0,\n", 102 | " 'max': 23\n", 103 | " },\n", 104 | "\n", 105 | " 'colorAxis': {\n", 106 | " 'stops': [\n", 107 | " [0, '#3060cf'],\n", 108 | " [0.5, '#fffbbc'],\n", 109 | " [0.9, '#c4463a']\n", 110 | " ],\n", 111 | " 'min': -5\n", 112 | " }\n", 113 | "}" 114 | ] 115 | }, 116 | { 117 | "cell_type": "markdown", 118 | "id": "83ea7d23-2026-4a15-9144-e30001406eb8", 119 | "metadata": {}, 120 | "source": [ 121 | "## Populate the Dataframe" 122 | ] 123 | }, 124 | { 125 | "cell_type": "code", 126 | "execution_count": null, 127 | "id": "a51b0171-0852-4f72-94a5-af08626144a6", 128 | "metadata": { 129 | "tags": [] 130 | }, 131 | "outputs": [], 132 | "source": [ 133 | "df = pandas.read_csv('temperatures.csv')\n", 134 | "df" 135 | ] 136 | }, 137 | { 138 | "cell_type": "markdown", 139 | "id": "2294327c-46ec-425d-8f4e-0e618607c037", 140 | "metadata": {}, 141 | "source": [ 142 | "## Create the Series" 143 | ] 144 | }, 145 | { 146 | "cell_type": "code", 147 | "execution_count": null, 148 | "id": "8fb6490d-cb69-4ed3-995b-8df7389caee3", 149 | "metadata": { 150 | "tags": [] 151 | }, 152 | "outputs": [], 153 | "source": [ 154 | "series = HeatmapSeries.from_pandas(df, \n", 155 | " property_map = {'x': 'Date','y': 'Time', 'value': 'Temperature'}, \n", 156 | " series_kwargs = {\n", 157 | " 'name': 'Temperature',\n", 158 | " 'borderWidth': 0,\n", 159 | " 'colsize': 24 * 36e5,\n", 160 | " 'tooltip': {\n", 161 | " 'headerFormat': 'Temperature
',\n", 162 | " 'pointFormat': '{point.x:%e %b, %Y} {point.y}:00: {point.value} ℃'\n", 163 | " },\n", 164 | " 'accessibility': {\n", 165 | " 'enabled': False\n", 166 | " }\n", 167 | " })" 168 | ] 169 | }, 170 | { 171 | "cell_type": "markdown", 172 | "id": "22f593cd-1641-46db-aca3-4aaeec8d59bb", 173 | "metadata": {}, 174 | "source": [ 175 | "## Assemble the Chart" 176 | ] 177 | }, 178 | { 179 | "cell_type": "code", 180 | "execution_count": null, 181 | "id": "d54eeb90-3535-4973-b44e-8109bf480c4e", 182 | "metadata": {}, 183 | "outputs": [], 184 | "source": [ 185 | "chart = Chart(options = options_kwargs)\n", 186 | "chart.is_maps_chart = True\n", 187 | "chart.add_series(series)" 188 | ] 189 | }, 190 | { 191 | "cell_type": "markdown", 192 | "id": "da99cefc-d953-4764-8392-a704e34702a8", 193 | "metadata": {}, 194 | "source": [ 195 | "## Display the Chart" 196 | ] 197 | }, 198 | { 199 | "cell_type": "code", 200 | "execution_count": null, 201 | "id": "97eb8175-132f-48ac-bfeb-58d10dae40a6", 202 | "metadata": {}, 203 | "outputs": [], 204 | "source": [ 205 | "chart.display()" 206 | ] 207 | }, 208 | { 209 | "cell_type": "code", 210 | "execution_count": null, 211 | "id": "4f9e0f1e-4fef-4538-bf71-366ab6484d3e", 212 | "metadata": {}, 213 | "outputs": [], 214 | "source": [] 215 | } 216 | ], 217 | "metadata": { 218 | "kernelspec": { 219 | "display_name": "Python 3 (ipykernel)", 220 | "language": "python", 221 | "name": "python3" 222 | }, 223 | "language_info": { 224 | "codemirror_mode": { 225 | "name": "ipython", 226 | "version": 3 227 | }, 228 | "file_extension": ".py", 229 | "mimetype": "text/x-python", 230 | "name": "python", 231 | "nbconvert_exporter": "python", 232 | "pygments_lexer": "ipython3", 233 | "version": "3.10.5" 234 | } 235 | }, 236 | "nbformat": 4, 237 | "nbformat_minor": 5 238 | } 239 | -------------------------------------------------------------------------------- /highcharts-stock/stock-features/stock-tools-gui.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "markdown", 5 | "id": "3d033821-eebd-4e56-8d75-1640001f6451", 6 | "metadata": {}, 7 | "source": [ 8 | "# Stock Tools GUI\n", 9 | "Demonistrating a Highcharts Stock chart with the **Stock Tools** GUI included." 10 | ] 11 | }, 12 | { 13 | "cell_type": "markdown", 14 | "id": "19324d42-e2dd-41a3-a12f-ca8fbceda5ec", 15 | "metadata": {}, 16 | "source": [ 17 | "## Import Dependencies" 18 | ] 19 | }, 20 | { 21 | "cell_type": "code", 22 | "execution_count": null, 23 | "id": "9962170c-4f90-41f7-873e-0599ab54c046", 24 | "metadata": { 25 | "tags": [] 26 | }, 27 | "outputs": [], 28 | "source": [ 29 | "from highcharts_stock.constants import EnforcedNull\n", 30 | "from highcharts_stock.chart import Chart\n", 31 | "import requests\n", 32 | "import json" 33 | ] 34 | }, 35 | { 36 | "cell_type": "markdown", 37 | "id": "131fd3c7-bacc-4bfb-ae09-d5800a7be170", 38 | "metadata": {}, 39 | "source": [ 40 | "# Prepare Data" 41 | ] 42 | }, 43 | { 44 | "cell_type": "code", 45 | "execution_count": null, 46 | "id": "3c274c54-ddde-40de-b650-b7a5a001ab77", 47 | "metadata": { 48 | "tags": [] 49 | }, 50 | "outputs": [], 51 | "source": [ 52 | "response = requests.get('https://demo-live-data.highcharts.com/aapl-ohlcv.json')\n", 53 | "data = response.text\n", 54 | "ohlc = []\n", 55 | "volume = []\n", 56 | "as_list = json.loads(data)\n", 57 | "for record in as_list:\n", 58 | " ohlc.append((record[0],\n", 59 | " record[1],\n", 60 | " record[2],\n", 61 | " record[3],\n", 62 | " record[4]))\n", 63 | " volume.append((record[0],\n", 64 | " record[5]))" 65 | ] 66 | }, 67 | { 68 | "cell_type": "markdown", 69 | "id": "089b8f43-ea01-4753-a52f-bfd1e23d948d", 70 | "metadata": {}, 71 | "source": [ 72 | "## Prepare Options" 73 | ] 74 | }, 75 | { 76 | "cell_type": "code", 77 | "execution_count": null, 78 | "id": "e8f030f9-6f9c-445b-b0f5-9f6b2118c865", 79 | "metadata": { 80 | "tags": [] 81 | }, 82 | "outputs": [], 83 | "source": [ 84 | "options = {\n", 85 | " 'yAxis': [{\n", 86 | " 'labels': {\n", 87 | " 'align': 'left'\n", 88 | " },\n", 89 | " 'height': '80%',\n", 90 | " 'resize': {\n", 91 | " 'enabled': True\n", 92 | " }\n", 93 | " }, {\n", 94 | " 'labels': {\n", 95 | " 'align': 'left'\n", 96 | " },\n", 97 | " 'top': '80%',\n", 98 | " 'height': '20%',\n", 99 | " 'offset': 0\n", 100 | " }],\n", 101 | " 'tooltip': {\n", 102 | " 'shape': 'rect',\n", 103 | " 'headerShape': 'callout',\n", 104 | " 'borderWidth': 0,\n", 105 | " 'shadow': False,\n", 106 | " 'positioner': \"\"\"function (width, height, point) {\n", 107 | " var chart = this.chart,\n", 108 | " position;\n", 109 | "\n", 110 | " if (point.isHeader) {\n", 111 | " position = {\n", 112 | " x: Math.max(\n", 113 | " // Left side limit\n", 114 | " chart.plotLeft,\n", 115 | " Math.min(\n", 116 | " point.plotX + chart.plotLeft - width / 2,\n", 117 | " // Right side limit\n", 118 | " chart.chartWidth - width - chart.marginRight\n", 119 | " )\n", 120 | " ),\n", 121 | " y: point.plotY\n", 122 | " };\n", 123 | " } else {\n", 124 | " position = {\n", 125 | " x: point.series.chart.plotLeft,\n", 126 | " y: point.series.yAxis.top - chart.plotTop\n", 127 | " };\n", 128 | " }\n", 129 | "\n", 130 | " return position;\n", 131 | " }\"\"\"\n", 132 | " },\n", 133 | "\n", 134 | " 'responsive': {\n", 135 | " 'rules': [{\n", 136 | " 'condition': {\n", 137 | " 'maxWidth': 800\n", 138 | " },\n", 139 | " 'chartOptions': {\n", 140 | " 'rangeSelector': {\n", 141 | " 'inputEnabled': False\n", 142 | " }\n", 143 | " }\n", 144 | " }]\n", 145 | " },\n", 146 | " \n", 147 | " 'stockTools': {\n", 148 | " 'gui': {\n", 149 | " 'enabled': True\n", 150 | " }\n", 151 | " }\n", 152 | "}" 153 | ] 154 | }, 155 | { 156 | "cell_type": "markdown", 157 | "id": "b06bf4c1-988c-49de-994e-96d6948a440e", 158 | "metadata": {}, 159 | "source": [ 160 | "## Generate Chart" 161 | ] 162 | }, 163 | { 164 | "cell_type": "code", 165 | "execution_count": null, 166 | "id": "57aa98fa-be9a-462c-8b07-eb2e97de4f13", 167 | "metadata": { 168 | "tags": [] 169 | }, 170 | "outputs": [], 171 | "source": [ 172 | "chart = Chart.from_options(options)\n", 173 | "chart.is_stock_chart = True" 174 | ] 175 | }, 176 | { 177 | "cell_type": "markdown", 178 | "id": "f72580e7-8785-4874-97ff-672104019005", 179 | "metadata": {}, 180 | "source": [ 181 | "## Add Series" 182 | ] 183 | }, 184 | { 185 | "cell_type": "code", 186 | "execution_count": null, 187 | "id": "41fb626c-3da4-4b32-b53a-1b93b0909751", 188 | "metadata": { 189 | "tags": [] 190 | }, 191 | "outputs": [], 192 | "source": [ 193 | "chart.add_series({\n", 194 | " 'type': 'ohlc',\n", 195 | " 'id': 'aapl-ohlc',\n", 196 | " 'name': 'AAPL Stock Price',\n", 197 | " 'data': ohlc\n", 198 | "})\n", 199 | "chart.add_series({\n", 200 | " 'type': 'column',\n", 201 | " 'id': 'aapl-volume',\n", 202 | " 'name': 'AAPL Volume',\n", 203 | " 'data': volume,\n", 204 | " 'yAxis': 1\n", 205 | "})" 206 | ] 207 | }, 208 | { 209 | "cell_type": "markdown", 210 | "id": "8e558de2-ec54-456f-b223-98c1dde8d19f", 211 | "metadata": {}, 212 | "source": [ 213 | "## Display the Chart" 214 | ] 215 | }, 216 | { 217 | "cell_type": "code", 218 | "execution_count": null, 219 | "id": "17bed092-879b-41c2-a47f-b74ff25ba12e", 220 | "metadata": { 221 | "tags": [] 222 | }, 223 | "outputs": [], 224 | "source": [ 225 | "chart.display()" 226 | ] 227 | }, 228 | { 229 | "cell_type": "code", 230 | "execution_count": null, 231 | "id": "80d5248d-bd84-4d11-9b96-1e990d46d0db", 232 | "metadata": {}, 233 | "outputs": [], 234 | "source": [] 235 | } 236 | ], 237 | "metadata": { 238 | "kernelspec": { 239 | "display_name": "Python 3 (ipykernel)", 240 | "language": "python", 241 | "name": "python3" 242 | }, 243 | "language_info": { 244 | "codemirror_mode": { 245 | "name": "ipython", 246 | "version": 3 247 | }, 248 | "file_extension": ".py", 249 | "mimetype": "text/x-python", 250 | "name": "python", 251 | "nbconvert_exporter": "python", 252 | "pygments_lexer": "ipython3", 253 | "version": "3.10.5" 254 | } 255 | }, 256 | "nbformat": 4, 257 | "nbformat_minor": 5 258 | } 259 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Highcharts for Python Demos 2 | This is a collection of demonstrations of the Highcharts for Python toolkit. Fundamentally, they are a Python port of the fantastic demos that Highsoft has already published for their [Highcharts JavaScript library](https://www.highcharts.com/demo). 3 | 4 | > **WARNING:** The [MyBinder](https://mybinder.org) service which we use to provide a convenient demo environment is having some major capacity and infrastructure issues as of April 27th, 2023, mentioned [here](https://discourse.jupyter.org/t/mybinder-org-reducing-capacity-unstable/19163) and described in greater detail [here](https://blog.jupyter.org/mybinder-org-reducing-capacity-c93ccfc6413f). These issues may cause unstable behavior if trying to launch MyBinder with the demo repo. Hopefully, they will address their infrastructure issues soon. In the meantime, if you are having difficulty launching a binder, you can always use checkout the demo repo and run the demos locally in your environment as described below. 5 | 6 | ## Overview 7 | 8 | The demos showcase a variety of ways of working with Highcharts for Python to create and visualize data. Because Highcharts for Python provides multiple paths to create your visualizations, we have tried to showcase various methods. Some demos use: 9 | 10 | * **Direct instantiation**. They create Python instances of objects using Python constructors like ``LineSeries(...)`` directly. 11 | * ``.from_js_literal()``. They create ``HighchartsOptions`` instances by taking a string of a JS literal option configuration using the ``.from_js_literal()`` method. 12 | * ``.from_dict()``. They create Python instances using the Highcharts for Python ``.from_dict()`` convenience method. 13 | * other demo-specific techniques, which may vary from demo to demo 14 | 15 | Each demo ultimately demonstrates one or more visualizations using one of the techniques mentioned above. The basic pattern we use is to: 16 | 17 | 1. Import the needed dependencies. 18 | 2. Assemble the options. 19 | 3. Assemble the chart. 20 | 4. Visualize the chart. 21 | 22 | **NOTE!! The demos in this repository are a work in progress, and various demos will be added over time. Please check back periodically to see if new demos have been added.** 23 | 24 | ## How to Use the Demos 25 | 26 | ### Organization 27 | The demos are organized in Jupyter Notebooks, which make it easy to follow how they work, see their results in action, and experiment with them as needed. 28 | 29 | The repository is organized into folders for each of the Highcharts for Python libraries: 30 | 31 | * ``highcharts-core`` contains demos of the [Highcharts Core for Python](https://core-docs.highchartspython.com) library 32 | * ``highcharts-stock`` contains demos of the [Highcharts Stock for Python](https://stock-docs.highchartspython.com) library 33 | * ``highcharts-maps`` contains demos of the [Highcharts Maps for Python](https://maps-docs.highchartspython.com) library 34 | * ``highcharts-gantt`` contains demos of the [Highcharts Gantt for Python](https://gantt-docs.highchartspython.com) library 35 | 36 | Within each of these folders, you will find sub-folders grouping demos into a particular category. For example: 37 | 38 | * the ``highcharts-core/line-charts`` folder contains Jupyter Notebooks which demonstrate different line chart functionality. 39 | * the ``highcharts-core/python-features`` folder contains Notebooks which demonstrate some Python-specific features 40 | 41 | ### Using the Demos via MyBinder.org 42 | 43 | > **SEE WARNING ABOVE related to the current MyBinder infrastructure/capacity/stability issues.** 44 | 45 | The easy way to use or review the demos is to launch a MyBinder session using the following buttton: [![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/highcharts-for-python/highcharts-for-python-demos/HEAD) 46 | 47 | Once the MyBinder launches, you will find yourself in a Jupyter Lab environment within a Docker image. You'll have this full repository available to you, and you can navigate the folders to find the demo you want to run. 48 | 49 | For example, to see how **Highcharts Core for Python** generates a basic line chart, you can open the Notebook at ``highcharts-core/line-charts/basic-line.ipynb``. 50 | 51 | Then just run the Notebook, and you should see the results. 52 | 53 | ### Using the Demos Locally 54 | To use the demos locally, you need to take several additional steps: 55 | 56 | 1. First, clone this Github repo: 57 | 58 | ``` 59 | $ git clone git@github.com:highcharts-for-python/highcharts-for-python-demos.git 60 | ``` 61 | 62 | 2. Next, navigate to its directory: 63 | 64 | ``` 65 | $ cd highcharts-for-python-demos 66 | 67 | highcharts-for-python-demos/ (master) 68 | $ 69 | ```` 70 | 71 | 3. Create a virtual environment: 72 | 73 | ``` 74 | highcharts-for-python-demos/ (master) 75 | $ python -m venv .venv 76 | ``` 77 | 78 | 4. Then activate your virtual environment: 79 | 80 | ``` 81 | highcharts-for-python-demos/ (master) 82 | $ source .venv/Scripts/activate 83 | 84 | (.venv) 85 | highcharts-for-python-demos/ (master) 86 | $ 87 | ``` 88 | 89 | 5. And install the requirements: 90 | 91 | ``` 92 | (.venv) 93 | highcharts-for-python-demos/ (master) 94 | $ pip install -r requirements.txt 95 | ``` 96 | 97 | 6. And finally, open up Jupyter Lab: 98 | 99 | ``` 100 | (.venv) 101 | highcharts-for-python-demos/ (master) 102 | $ jupyter-lab 103 | ``` 104 | 105 | You should now see the set of notebooks included in the repo, along with relevant data files and other details. 106 | 107 | For example, to see how **Highcharts Core for Python** generates a basic line chart, you can open the Notebook at ``highcharts-core/line-charts/basic-line.ipynb``. 108 | 109 | Then just run the Notebook, and you should see the results. 110 | 111 | ## Contributing to the Demos 112 | 113 | If you wish to contribute demos to this library: 114 | 115 | 1. First, clone this Github repo: 116 | 117 | ``` 118 | $ git clone git@github.com:highcharts-for-python/highcharts-for-python-demos.git 119 | ``` 120 | 121 | 2. Next, navigate to its directory: 122 | 123 | ``` 124 | $ cd highcharts-for-python-demos 125 | 126 | highcharts-for-python-demos/ (master) 127 | $ 128 | ```` 129 | 130 | 3. Create a virtual environment: 131 | 132 | ``` 133 | highcharts-for-python-demos/ (master) 134 | $ python -m venv .venv 135 | ``` 136 | 137 | 4. Activate your virtual environment: 138 | 139 | ``` 140 | highcharts-for-python-demos/ (master) 141 | $ source .venv/Scripts/activate 142 | 143 | (.venv) 144 | highcharts-for-python-demos/ (master) 145 | $ 146 | ``` 147 | 148 | 5. Install the requirements: 149 | 150 | ``` 151 | (.venv) 152 | highcharts-for-python-demos/ (master) 153 | $ pip install -r requirements.txt 154 | ``` 155 | 156 | 6. Install the pre-commit hook (which strips output from the Jupyter Notebooks on commit): 157 | 158 | ``` 159 | (.venv) 160 | highcharts-for-python-demos/ (master) 161 | $ pre-commit install 162 | ``` 163 | 164 | 7. Create a new branch in your repo that you will use for your changes. 165 | 166 | 8. Either edit the existing Jupyter Notebooks or add new ones using the basic conventions and pattern that you'll find in our other demos. 167 | 168 | 9. Commit your changes and push them to this Github repo. 169 | 170 | 10. File a Pull Request to merge changes from your branch to the ``develop`` branch. 171 | 172 | And that's it! Thank you for your contributions, they are much appreciated. -------------------------------------------------------------------------------- /highcharts-core/scatter-and-bubble-charts/bubble-chart.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "markdown", 5 | "id": "0c26872a-fc19-4f08-9fd9-ce0b0d961f27", 6 | "metadata": {}, 7 | "source": [ 8 | "# Bubble Chart\n", 9 | "Chart showing basic use of bubble series with a custom tooltip formatter.\n", 10 | "The chart uses plot lines to show safe intake levels for sugar and fat.\n", 11 | "Bubble charts are great for comparing three dimensions of data without\n", 12 | "relying on color or 3D charts." 13 | ] 14 | }, 15 | { 16 | "cell_type": "markdown", 17 | "id": "6b461423-bdfe-46fd-ac5e-89a8191948e5", 18 | "metadata": {}, 19 | "source": [ 20 | "## Import Dependencies" 21 | ] 22 | }, 23 | { 24 | "cell_type": "code", 25 | "execution_count": null, 26 | "id": "6ebbd6b7-cd27-4304-9d60-5e5cb2950063", 27 | "metadata": {}, 28 | "outputs": [], 29 | "source": [ 30 | "from highcharts_core.chart import Chart\n", 31 | "from highcharts_core.options import HighchartsOptions" 32 | ] 33 | }, 34 | { 35 | "cell_type": "markdown", 36 | "id": "a07d8167-8441-4d14-97e6-f40983f37278", 37 | "metadata": {}, 38 | "source": [ 39 | "## Configure Options" 40 | ] 41 | }, 42 | { 43 | "cell_type": "code", 44 | "execution_count": null, 45 | "id": "2d4b0bda-3c20-4af7-bf76-caff71606fed", 46 | "metadata": {}, 47 | "outputs": [], 48 | "source": [ 49 | "options_as_str = \"\"\"{\n", 50 | "\n", 51 | " chart: {\n", 52 | " type: 'bubble',\n", 53 | " plotBorderWidth: 1,\n", 54 | " zoomType: 'xy'\n", 55 | " },\n", 56 | "\n", 57 | " legend: {\n", 58 | " enabled: false\n", 59 | " },\n", 60 | "\n", 61 | " title: {\n", 62 | " text: 'Sugar and fat intake per country'\n", 63 | " },\n", 64 | "\n", 65 | " subtitle: {\n", 66 | " text: 'Source: Euromonitor and OECD'\n", 67 | " },\n", 68 | "\n", 69 | " accessibility: {\n", 70 | " point: {\n", 71 | " valueDescriptionFormat: '{index}. {point.name}, fat: {point.x}g, sugar: {point.y}g, obesity: {point.z}%.'\n", 72 | " }\n", 73 | " },\n", 74 | "\n", 75 | " xAxis: {\n", 76 | " gridLineWidth: 1,\n", 77 | " title: {\n", 78 | " text: 'Daily fat intake'\n", 79 | " },\n", 80 | " labels: {\n", 81 | " format: '{value} gr'\n", 82 | " },\n", 83 | " plotLines: [{\n", 84 | " color: 'black',\n", 85 | " dashStyle: 'Dot',\n", 86 | " width: 2,\n", 87 | " value: 65,\n", 88 | " label: {\n", 89 | " rotation: 0,\n", 90 | " y: 15,\n", 91 | " style: {\n", 92 | " fontStyle: 'italic'\n", 93 | " },\n", 94 | " text: 'Safe fat intake 65g/day'\n", 95 | " },\n", 96 | " zIndex: 3\n", 97 | " }],\n", 98 | " accessibility: {\n", 99 | " rangeDescription: 'Range: 60 to 100 grams.'\n", 100 | " }\n", 101 | " },\n", 102 | "\n", 103 | " yAxis: {\n", 104 | " startOnTick: false,\n", 105 | " endOnTick: false,\n", 106 | " title: {\n", 107 | " text: 'Daily sugar intake'\n", 108 | " },\n", 109 | " labels: {\n", 110 | " format: '{value} gr'\n", 111 | " },\n", 112 | " maxPadding: 0.2,\n", 113 | " plotLines: [{\n", 114 | " color: 'black',\n", 115 | " dashStyle: 'Dot',\n", 116 | " width: 2,\n", 117 | " value: 50,\n", 118 | " label: {\n", 119 | " align: 'right',\n", 120 | " style: {\n", 121 | " fontStyle: 'italic'\n", 122 | " },\n", 123 | " text: 'Safe sugar intake 50g/day',\n", 124 | " x: -10\n", 125 | " },\n", 126 | " zIndex: 3\n", 127 | " }],\n", 128 | " accessibility: {\n", 129 | " rangeDescription: 'Range: 0 to 160 grams.'\n", 130 | " }\n", 131 | " },\n", 132 | "\n", 133 | " tooltip: {\n", 134 | " useHTML: true,\n", 135 | " headerFormat: '',\n", 136 | " pointFormat: '',\n", 137 | " footerFormat: '

{point.country}

Fat intake:{point.x}g
Sugar intake:{point.y}g
Obesity (adults):{point.z}%
',\n", 138 | " followPointer: true\n", 139 | " },\n", 140 | "\n", 141 | " plotOptions: {\n", 142 | " series: {\n", 143 | " dataLabels: {\n", 144 | " enabled: true,\n", 145 | " format: '{point.name}'\n", 146 | " }\n", 147 | " }\n", 148 | " },\n", 149 | "\n", 150 | " series: [{\n", 151 | " data: [\n", 152 | " { x: 95, y: 95, z: 13.8, name: 'BE', country: 'Belgium' },\n", 153 | " { x: 86.5, y: 102.9, z: 14.7, name: 'DE', country: 'Germany' },\n", 154 | " { x: 80.8, y: 91.5, z: 15.8, name: 'FI', country: 'Finland' },\n", 155 | " { x: 80.4, y: 102.5, z: 12, name: 'NL', country: 'Netherlands' },\n", 156 | " { x: 80.3, y: 86.1, z: 11.8, name: 'SE', country: 'Sweden' },\n", 157 | " { x: 78.4, y: 70.1, z: 16.6, name: 'ES', country: 'Spain' },\n", 158 | " { x: 74.2, y: 68.5, z: 14.5, name: 'FR', country: 'France' },\n", 159 | " { x: 73.5, y: 83.1, z: 10, name: 'NO', country: 'Norway' },\n", 160 | " { x: 71, y: 93.2, z: 24.7, name: 'UK', country: 'United Kingdom' },\n", 161 | " { x: 69.2, y: 57.6, z: 10.4, name: 'IT', country: 'Italy' },\n", 162 | " { x: 68.6, y: 20, z: 16, name: 'RU', country: 'Russia' },\n", 163 | " { x: 65.5, y: 126.4, z: 35.3, name: 'US', country: 'United States' },\n", 164 | " { x: 65.4, y: 50.8, z: 28.5, name: 'HU', country: 'Hungary' },\n", 165 | " { x: 63.4, y: 51.8, z: 15.4, name: 'PT', country: 'Portugal' },\n", 166 | " { x: 64, y: 82.9, z: 31.3, name: 'NZ', country: 'New Zealand' }\n", 167 | " ],\n", 168 | " colorByPoint: true\n", 169 | " }]\n", 170 | "\n", 171 | "}\"\"\"\n", 172 | "options = HighchartsOptions.from_js_literal(options_as_str)" 173 | ] 174 | }, 175 | { 176 | "cell_type": "code", 177 | "execution_count": null, 178 | "id": "71cd0e89-da09-4fa0-bdef-8ed5ce5db44a", 179 | "metadata": { 180 | "tags": [] 181 | }, 182 | "outputs": [], 183 | "source": [ 184 | "chart = Chart.from_options(options)\n", 185 | "chart.display()" 186 | ] 187 | }, 188 | { 189 | "cell_type": "code", 190 | "execution_count": null, 191 | "id": "ab68da56-8e96-4451-9d98-6a93041e33ac", 192 | "metadata": {}, 193 | "outputs": [], 194 | "source": [] 195 | } 196 | ], 197 | "metadata": { 198 | "kernelspec": { 199 | "display_name": "Python 3 (ipykernel)", 200 | "language": "python", 201 | "name": "python3" 202 | }, 203 | "language_info": { 204 | "codemirror_mode": { 205 | "name": "ipython", 206 | "version": 3 207 | }, 208 | "file_extension": ".py", 209 | "mimetype": "text/x-python", 210 | "name": "python", 211 | "nbconvert_exporter": "python", 212 | "pygments_lexer": "ipython3", 213 | "version": "3.10.5" 214 | } 215 | }, 216 | "nbformat": 4, 217 | "nbformat_minor": 5 218 | } 219 | -------------------------------------------------------------------------------- /highcharts-core/other-chart-types/network-graph.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "markdown", 5 | "id": "1b3d8288-f634-4ce2-ac26-02d59a04cb33", 6 | "metadata": {}, 7 | "source": [ 8 | "# Network Graph\n", 9 | "This force directed graph shows an example of a network graph, where\n", 10 | "the nodes represent languages and the language families they belong to.\n", 11 | "The nodes can be dragged around and will be repositioned dynamically.\n", 12 | "Network graphs are typically used to show relations in data. In this\n", 13 | "case, we are showing a hierarchical structure." 14 | ] 15 | }, 16 | { 17 | "cell_type": "markdown", 18 | "id": "f01023fb-d676-494b-8894-13273b20cc9f", 19 | "metadata": {}, 20 | "source": [ 21 | "## Import Dependencies" 22 | ] 23 | }, 24 | { 25 | "cell_type": "code", 26 | "execution_count": null, 27 | "id": "9d27b793-1475-41a4-b418-518737da244b", 28 | "metadata": {}, 29 | "outputs": [], 30 | "source": [ 31 | "from highcharts_core.chart import Chart\n", 32 | "from highcharts_core.options import HighchartsOptions" 33 | ] 34 | }, 35 | { 36 | "cell_type": "markdown", 37 | "id": "9b1fef6a-db5f-48c6-9b95-55e75909e897", 38 | "metadata": {}, 39 | "source": [ 40 | "## Setup Options" 41 | ] 42 | }, 43 | { 44 | "cell_type": "code", 45 | "execution_count": null, 46 | "id": "ce5415c8-bec2-4ce4-a234-7d9609ed5909", 47 | "metadata": {}, 48 | "outputs": [], 49 | "source": [ 50 | "options_as_str = \"\"\"{\n", 51 | " chart: {\n", 52 | " type: 'networkgraph'\n", 53 | " },\n", 54 | " title: {\n", 55 | " text: 'The Indo-European Language Tree',\n", 56 | " align: 'left'\n", 57 | " },\n", 58 | " subtitle: {\n", 59 | " text: 'A Force-Directed Network Graph in Highcharts',\n", 60 | " align: 'left'\n", 61 | " },\n", 62 | " plotOptions: {\n", 63 | " networkgraph: {\n", 64 | " keys: ['from', 'to'],\n", 65 | " layoutAlgorithm: {\n", 66 | " enableSimulation: true,\n", 67 | " friction: -0.9\n", 68 | " }\n", 69 | " }\n", 70 | " },\n", 71 | " series: [{\n", 72 | " accessibility: {\n", 73 | " enabled: false\n", 74 | " },\n", 75 | " dataLabels: {\n", 76 | " enabled: true,\n", 77 | " linkFormat: ''\n", 78 | " },\n", 79 | " id: 'lang-tree',\n", 80 | " data: [\n", 81 | " ['Proto Indo-European', 'Balto-Slavic'],\n", 82 | " ['Proto Indo-European', 'Germanic'],\n", 83 | " ['Proto Indo-European', 'Celtic'],\n", 84 | " ['Proto Indo-European', 'Italic'],\n", 85 | " ['Proto Indo-European', 'Hellenic'],\n", 86 | " ['Proto Indo-European', 'Anatolian'],\n", 87 | " ['Proto Indo-European', 'Indo-Iranian'],\n", 88 | " ['Proto Indo-European', 'Tocharian'],\n", 89 | " ['Indo-Iranian', 'Dardic'],\n", 90 | " ['Indo-Iranian', 'Indic'],\n", 91 | " ['Indo-Iranian', 'Iranian'],\n", 92 | " ['Iranian', 'Old Persian'],\n", 93 | " ['Old Persian', 'Middle Persian'],\n", 94 | " ['Indic', 'Sanskrit'],\n", 95 | " ['Italic', 'Osco-Umbrian'],\n", 96 | " ['Italic', 'Latino-Faliscan'],\n", 97 | " ['Latino-Faliscan', 'Latin'],\n", 98 | " ['Celtic', 'Brythonic'],\n", 99 | " ['Celtic', 'Goidelic'],\n", 100 | " ['Germanic', 'North Germanic'],\n", 101 | " ['Germanic', 'West Germanic'],\n", 102 | " ['Germanic', 'East Germanic'],\n", 103 | " ['North Germanic', 'Old Norse'],\n", 104 | " ['North Germanic', 'Old Swedish'],\n", 105 | " ['North Germanic', 'Old Danish'],\n", 106 | " ['West Germanic', 'Old English'],\n", 107 | " ['West Germanic', 'Old Frisian'],\n", 108 | " ['West Germanic', 'Old Dutch'],\n", 109 | " ['West Germanic', 'Old Low German'],\n", 110 | " ['West Germanic', 'Old High German'],\n", 111 | " ['Old Norse', 'Old Icelandic'],\n", 112 | " ['Old Norse', 'Old Norwegian'],\n", 113 | " ['Old Norwegian', 'Middle Norwegian'],\n", 114 | " ['Old Swedish', 'Middle Swedish'],\n", 115 | " ['Old Danish', 'Middle Danish'],\n", 116 | " ['Old English', 'Middle English'],\n", 117 | " ['Old Dutch', 'Middle Dutch'],\n", 118 | " ['Old Low German', 'Middle Low German'],\n", 119 | " ['Old High German', 'Middle High German'],\n", 120 | " ['Balto-Slavic', 'Baltic'],\n", 121 | " ['Balto-Slavic', 'Slavic'],\n", 122 | " ['Slavic', 'East Slavic'],\n", 123 | " ['Slavic', 'West Slavic'],\n", 124 | " ['Slavic', 'South Slavic'],\n", 125 | " // Leaves:\n", 126 | " ['Proto Indo-European', 'Phrygian'],\n", 127 | " ['Proto Indo-European', 'Armenian'],\n", 128 | " ['Proto Indo-European', 'Albanian'],\n", 129 | " ['Proto Indo-European', 'Thracian'],\n", 130 | " ['Tocharian', 'Tocharian A'],\n", 131 | " ['Tocharian', 'Tocharian B'],\n", 132 | " ['Anatolian', 'Hittite'],\n", 133 | " ['Anatolian', 'Palaic'],\n", 134 | " ['Anatolian', 'Luwic'],\n", 135 | " ['Anatolian', 'Lydian'],\n", 136 | " ['Iranian', 'Balochi'],\n", 137 | " ['Iranian', 'Kurdish'],\n", 138 | " ['Iranian', 'Pashto'],\n", 139 | " ['Iranian', 'Sogdian'],\n", 140 | " ['Old Persian', 'Pahlavi'],\n", 141 | " ['Middle Persian', 'Persian'],\n", 142 | " ['Hellenic', 'Greek'],\n", 143 | " ['Dardic', 'Dard'],\n", 144 | " ['Sanskrit', 'Sindhi'],\n", 145 | " ['Sanskrit', 'Romani'],\n", 146 | " ['Sanskrit', 'Urdu'],\n", 147 | " ['Sanskrit', 'Hindi'],\n", 148 | " ['Sanskrit', 'Bihari'],\n", 149 | " ['Sanskrit', 'Assamese'],\n", 150 | " ['Sanskrit', 'Bengali'],\n", 151 | " ['Sanskrit', 'Marathi'],\n", 152 | " ['Sanskrit', 'Gujarati'],\n", 153 | " ['Sanskrit', 'Punjabi'],\n", 154 | " ['Sanskrit', 'Sinhalese'],\n", 155 | " ['Osco-Umbrian', 'Umbrian'],\n", 156 | " ['Osco-Umbrian', 'Oscan'],\n", 157 | " ['Latino-Faliscan', 'Faliscan'],\n", 158 | " ['Latin', 'Portugese'],\n", 159 | " ['Latin', 'Spanish'],\n", 160 | " ['Latin', 'French'],\n", 161 | " ['Latin', 'Romanian'],\n", 162 | " ['Latin', 'Italian'],\n", 163 | " ['Latin', 'Catalan'],\n", 164 | " ['Latin', 'Franco-Provençal'],\n", 165 | " ['Latin', 'Rhaeto-Romance'],\n", 166 | " ['Brythonic', 'Welsh'],\n", 167 | " ['Brythonic', 'Breton'],\n", 168 | " ['Brythonic', 'Cornish'],\n", 169 | " ['Brythonic', 'Cuymbric'],\n", 170 | " ['Goidelic', 'Modern Irish'],\n", 171 | " ['Goidelic', 'Scottish Gaelic'],\n", 172 | " ['Goidelic', 'Manx'],\n", 173 | " ['East Germanic', 'Gothic'],\n", 174 | " ['Middle Low German', 'Low German'],\n", 175 | " ['Middle High German', '(High) German'],\n", 176 | " ['Middle High German', 'Yiddish'],\n", 177 | " ['Middle English', 'English'],\n", 178 | " ['Middle Dutch', 'Hollandic'],\n", 179 | " ['Middle Dutch', 'Flemish'],\n", 180 | " ['Middle Dutch', 'Dutch'],\n", 181 | " ['Middle Dutch', 'Limburgish'],\n", 182 | " ['Middle Dutch', 'Brabantian'],\n", 183 | " ['Middle Dutch', 'Rhinelandic'],\n", 184 | " ['Old Frisian', 'Frisian'],\n", 185 | " ['Middle Danish', 'Danish'],\n", 186 | " ['Middle Swedish', 'Swedish'],\n", 187 | " ['Middle Norwegian', 'Norwegian'],\n", 188 | " ['Old Norse', 'Faroese'],\n", 189 | " ['Old Icelandic', 'Icelandic'],\n", 190 | " ['Baltic', 'Old Prussian'],\n", 191 | " ['Baltic', 'Lithuanian'],\n", 192 | " ['Baltic', 'Latvian'],\n", 193 | " ['West Slavic', 'Polish'],\n", 194 | " ['West Slavic', 'Slovak'],\n", 195 | " ['West Slavic', 'Czech'],\n", 196 | " ['West Slavic', 'Wendish'],\n", 197 | " ['East Slavic', 'Bulgarian'],\n", 198 | " ['East Slavic', 'Old Church Slavonic'],\n", 199 | " ['East Slavic', 'Macedonian'],\n", 200 | " ['East Slavic', 'Serbo-Croatian'],\n", 201 | " ['East Slavic', 'Slovene'],\n", 202 | " ['South Slavic', 'Russian'],\n", 203 | " ['South Slavic', 'Ukrainian'],\n", 204 | " ['South Slavic', 'Belarusian'],\n", 205 | " ['South Slavic', 'Rusyn']\n", 206 | " ]\n", 207 | " }]\n", 208 | "}\"\"\"\n", 209 | "options = HighchartsOptions.from_js_literal(options_as_str)" 210 | ] 211 | }, 212 | { 213 | "cell_type": "markdown", 214 | "id": "1316e2fc-0488-48a1-b0f4-52f7ba8bcf15", 215 | "metadata": {}, 216 | "source": [ 217 | "## Assemble and Display Chart" 218 | ] 219 | }, 220 | { 221 | "cell_type": "code", 222 | "execution_count": null, 223 | "id": "256b312f-5acf-4143-bd09-4f944d23c8cd", 224 | "metadata": { 225 | "tags": [] 226 | }, 227 | "outputs": [], 228 | "source": [ 229 | "chart = Chart.from_options(options)\n", 230 | "chart.display()" 231 | ] 232 | }, 233 | { 234 | "cell_type": "code", 235 | "execution_count": null, 236 | "id": "3beceb3d-95eb-4a7d-948c-e9a6a9f22d42", 237 | "metadata": {}, 238 | "outputs": [], 239 | "source": [] 240 | } 241 | ], 242 | "metadata": { 243 | "kernelspec": { 244 | "display_name": "Python 3 (ipykernel)", 245 | "language": "python", 246 | "name": "python3" 247 | }, 248 | "language_info": { 249 | "codemirror_mode": { 250 | "name": "ipython", 251 | "version": 3 252 | }, 253 | "file_extension": ".py", 254 | "mimetype": "text/x-python", 255 | "name": "python", 256 | "nbconvert_exporter": "python", 257 | "pygments_lexer": "ipython3", 258 | "version": "3.10.5" 259 | } 260 | }, 261 | "nbformat": 4, 262 | "nbformat_minor": 5 263 | } 264 | -------------------------------------------------------------------------------- /highcharts-core/pie-charts/pie-with-drilldown.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "markdown", 5 | "id": "0c26872a-fc19-4f08-9fd9-ce0b0d961f27", 6 | "metadata": {}, 7 | "source": [ 8 | "# Pie with Drilldown\n", 9 | "Pie chart where the individual slices can be clicked to expose more detailed data." 10 | ] 11 | }, 12 | { 13 | "cell_type": "markdown", 14 | "id": "6b461423-bdfe-46fd-ac5e-89a8191948e5", 15 | "metadata": {}, 16 | "source": [ 17 | "## Import Dependencies" 18 | ] 19 | }, 20 | { 21 | "cell_type": "code", 22 | "execution_count": null, 23 | "id": "6ebbd6b7-cd27-4304-9d60-5e5cb2950063", 24 | "metadata": {}, 25 | "outputs": [], 26 | "source": [ 27 | "from highcharts_core.chart import Chart\n", 28 | "from highcharts_core.options import HighchartsOptions" 29 | ] 30 | }, 31 | { 32 | "cell_type": "markdown", 33 | "id": "a07d8167-8441-4d14-97e6-f40983f37278", 34 | "metadata": {}, 35 | "source": [ 36 | "## Configure Options" 37 | ] 38 | }, 39 | { 40 | "cell_type": "code", 41 | "execution_count": null, 42 | "id": "2d4b0bda-3c20-4af7-bf76-caff71606fed", 43 | "metadata": {}, 44 | "outputs": [], 45 | "source": [ 46 | "options_as_str = \"\"\"{\n", 47 | " chart: {\n", 48 | " type: 'pie'\n", 49 | " },\n", 50 | " title: {\n", 51 | " text: 'Browser market shares. January, 2022',\n", 52 | " align: 'left'\n", 53 | " },\n", 54 | " subtitle: {\n", 55 | " text: 'Click the slices to view versions. Source: statcounter.com',\n", 56 | " align: 'left'\n", 57 | " },\n", 58 | "\n", 59 | " accessibility: {\n", 60 | " announceNewData: {\n", 61 | " enabled: true\n", 62 | " },\n", 63 | " point: {\n", 64 | " valueSuffix: '%'\n", 65 | " }\n", 66 | " },\n", 67 | "\n", 68 | " plotOptions: {\n", 69 | " series: {\n", 70 | " dataLabels: {\n", 71 | " enabled: true,\n", 72 | " format: '{point.name}: {point.y:.1f}%'\n", 73 | " }\n", 74 | " }\n", 75 | " },\n", 76 | "\n", 77 | " tooltip: {\n", 78 | " headerFormat: '{series.name}
',\n", 79 | " pointFormat: '{point.name}: {point.y:.2f}% of total
'\n", 80 | " },\n", 81 | "\n", 82 | " series: [\n", 83 | " {\n", 84 | " name: 'Browsers',\n", 85 | " colorByPoint: true,\n", 86 | " data: [\n", 87 | " {\n", 88 | " name: 'Chrome',\n", 89 | " y: 61.04,\n", 90 | " drilldown: 'Chrome'\n", 91 | " },\n", 92 | " {\n", 93 | " name: 'Safari',\n", 94 | " y: 9.47,\n", 95 | " drilldown: 'Safari'\n", 96 | " },\n", 97 | " {\n", 98 | " name: 'Edge',\n", 99 | " y: 9.32,\n", 100 | " drilldown: 'Edge'\n", 101 | " },\n", 102 | " {\n", 103 | " name: 'Firefox',\n", 104 | " y: 8.15,\n", 105 | " drilldown: 'Firefox'\n", 106 | " },\n", 107 | " {\n", 108 | " name: 'Other',\n", 109 | " y: 11.02,\n", 110 | " drilldown: null\n", 111 | " }\n", 112 | " ]\n", 113 | " }\n", 114 | " ],\n", 115 | " drilldown: {\n", 116 | " series: [\n", 117 | " {\n", 118 | " type: 'pie',\n", 119 | " name: 'Chrome',\n", 120 | " id: 'Chrome',\n", 121 | " data: [\n", 122 | " [\n", 123 | " 'v97.0',\n", 124 | " 36.89\n", 125 | " ],\n", 126 | " [\n", 127 | " 'v96.0',\n", 128 | " 18.16\n", 129 | " ],\n", 130 | " [\n", 131 | " 'v95.0',\n", 132 | " 0.54\n", 133 | " ],\n", 134 | " [\n", 135 | " 'v94.0',\n", 136 | " 0.7\n", 137 | " ],\n", 138 | " [\n", 139 | " 'v93.0',\n", 140 | " 0.8\n", 141 | " ],\n", 142 | " [\n", 143 | " 'v92.0',\n", 144 | " 0.41\n", 145 | " ],\n", 146 | " [\n", 147 | " 'v91.0',\n", 148 | " 0.31\n", 149 | " ],\n", 150 | " [\n", 151 | " 'v90.0',\n", 152 | " 0.13\n", 153 | " ],\n", 154 | " [\n", 155 | " 'v89.0',\n", 156 | " 0.14\n", 157 | " ],\n", 158 | " [\n", 159 | " 'v88.0',\n", 160 | " 0.1\n", 161 | " ],\n", 162 | " [\n", 163 | " 'v87.0',\n", 164 | " 0.35\n", 165 | " ],\n", 166 | " [\n", 167 | " 'v86.0',\n", 168 | " 0.17\n", 169 | " ],\n", 170 | " [\n", 171 | " 'v85.0',\n", 172 | " 0.18\n", 173 | " ],\n", 174 | " [\n", 175 | " 'v84.0',\n", 176 | " 0.17\n", 177 | " ],\n", 178 | " [\n", 179 | " 'v83.0',\n", 180 | " 0.21\n", 181 | " ],\n", 182 | " [\n", 183 | " 'v81.0',\n", 184 | " 0.1\n", 185 | " ],\n", 186 | " [\n", 187 | " 'v80.0',\n", 188 | " 0.16\n", 189 | " ],\n", 190 | " [\n", 191 | " 'v79.0',\n", 192 | " 0.43\n", 193 | " ],\n", 194 | " [\n", 195 | " 'v78.0',\n", 196 | " 0.11\n", 197 | " ],\n", 198 | " [\n", 199 | " 'v76.0',\n", 200 | " 0.16\n", 201 | " ],\n", 202 | " [\n", 203 | " 'v75.0',\n", 204 | " 0.15\n", 205 | " ],\n", 206 | " [\n", 207 | " 'v72.0',\n", 208 | " 0.14\n", 209 | " ],\n", 210 | " [\n", 211 | " 'v70.0',\n", 212 | " 0.11\n", 213 | " ],\n", 214 | " [\n", 215 | " 'v69.0',\n", 216 | " 0.13\n", 217 | " ],\n", 218 | " [\n", 219 | " 'v56.0',\n", 220 | " 0.12\n", 221 | " ],\n", 222 | " [\n", 223 | " 'v49.0',\n", 224 | " 0.17\n", 225 | " ]\n", 226 | " ]\n", 227 | " },\n", 228 | " {\n", 229 | " type: 'pie',\n", 230 | " name: 'Safari',\n", 231 | " id: 'Safari',\n", 232 | " data: [\n", 233 | " [\n", 234 | " 'v15.3',\n", 235 | " 0.1\n", 236 | " ],\n", 237 | " [\n", 238 | " 'v15.2',\n", 239 | " 2.01\n", 240 | " ],\n", 241 | " [\n", 242 | " 'v15.1',\n", 243 | " 2.29\n", 244 | " ],\n", 245 | " [\n", 246 | " 'v15.0',\n", 247 | " 0.49\n", 248 | " ],\n", 249 | " [\n", 250 | " 'v14.1',\n", 251 | " 2.48\n", 252 | " ],\n", 253 | " [\n", 254 | " 'v14.0',\n", 255 | " 0.64\n", 256 | " ],\n", 257 | " [\n", 258 | " 'v13.1',\n", 259 | " 1.17\n", 260 | " ],\n", 261 | " [\n", 262 | " 'v13.0',\n", 263 | " 0.13\n", 264 | " ],\n", 265 | " [\n", 266 | " 'v12.1',\n", 267 | " 0.16\n", 268 | " ]\n", 269 | " ]\n", 270 | " },\n", 271 | " {\n", 272 | " type: 'pie',\n", 273 | " name: 'Edge',\n", 274 | " id: 'Edge',\n", 275 | " data: [\n", 276 | " [\n", 277 | " 'v97',\n", 278 | " 6.62\n", 279 | " ],\n", 280 | " [\n", 281 | " 'v96',\n", 282 | " 2.55\n", 283 | " ],\n", 284 | " [\n", 285 | " 'v95',\n", 286 | " 0.15\n", 287 | " ]\n", 288 | " ]\n", 289 | " },\n", 290 | " {\n", 291 | " type: 'pie',\n", 292 | " name: 'Firefox',\n", 293 | " id: 'Firefox',\n", 294 | " data: [\n", 295 | " [\n", 296 | " 'v96.0',\n", 297 | " 4.17\n", 298 | " ],\n", 299 | " [\n", 300 | " 'v95.0',\n", 301 | " 3.33\n", 302 | " ],\n", 303 | " [\n", 304 | " 'v94.0',\n", 305 | " 0.11\n", 306 | " ],\n", 307 | " [\n", 308 | " 'v91.0',\n", 309 | " 0.23\n", 310 | " ],\n", 311 | " [\n", 312 | " 'v78.0',\n", 313 | " 0.16\n", 314 | " ],\n", 315 | " [\n", 316 | " 'v52.0',\n", 317 | " 0.15\n", 318 | " ]\n", 319 | " ]\n", 320 | " }\n", 321 | " ]\n", 322 | " }\n", 323 | "}\"\"\"\n", 324 | "options = HighchartsOptions.from_js_literal(options_as_str)" 325 | ] 326 | }, 327 | { 328 | "cell_type": "code", 329 | "execution_count": null, 330 | "id": "71cd0e89-da09-4fa0-bdef-8ed5ce5db44a", 331 | "metadata": { 332 | "tags": [] 333 | }, 334 | "outputs": [], 335 | "source": [ 336 | "chart = Chart.from_options(options)\n", 337 | "chart.display()" 338 | ] 339 | }, 340 | { 341 | "cell_type": "code", 342 | "execution_count": null, 343 | "id": "c9526b0f-656c-4019-8e74-dd11ea37370e", 344 | "metadata": {}, 345 | "outputs": [], 346 | "source": [] 347 | } 348 | ], 349 | "metadata": { 350 | "kernelspec": { 351 | "display_name": "Python 3 (ipykernel)", 352 | "language": "python", 353 | "name": "python3" 354 | }, 355 | "language_info": { 356 | "codemirror_mode": { 357 | "name": "ipython", 358 | "version": 3 359 | }, 360 | "file_extension": ".py", 361 | "mimetype": "text/x-python", 362 | "name": "python", 363 | "nbconvert_exporter": "python", 364 | "pygments_lexer": "ipython3", 365 | "version": "3.10.5" 366 | } 367 | }, 368 | "nbformat": 4, 369 | "nbformat_minor": 5 370 | } 371 | -------------------------------------------------------------------------------- /highcharts-maps/heatmaps/temperatures.csv: -------------------------------------------------------------------------------- 1 | Date,Time,Temperature 2 | 2017-05-01,0,1.4 3 | 2017-05-01,1,0.9 4 | 2017-05-01,2,0.3 5 | 2017-05-01,3,-0.5 6 | 2017-05-01,4,-0.5 7 | 2017-05-01,5,-0.5 8 | 2017-05-01,6,-0.6 9 | 2017-05-01,7,-0.2 10 | 2017-05-01,8,0.3 11 | 2017-05-01,9,4.8 12 | 2017-05-01,10,7.1 13 | 2017-05-01,11,8.6 14 | 2017-05-01,12,9.9 15 | 2017-05-01,13,11.2 16 | 2017-05-01,14,12.5 17 | 2017-05-01,15,13.1 18 | 2017-05-01,16,13.4 19 | 2017-05-01,17,14.1 20 | 2017-05-01,18,14.3 21 | 2017-05-01,19,14.2 22 | 2017-05-01,20,11.7 23 | 2017-05-01,21,7.6 24 | 2017-05-01,22,5.8 25 | 2017-05-01,23,4.0 26 | 2017-05-02,0,3.6 27 | 2017-05-02,1,2.6 28 | 2017-05-02,2,1.8 29 | 2017-05-02,3,1.4 30 | 2017-05-02,4,1.1 31 | 2017-05-02,5,1.2 32 | 2017-05-02,6,1.2 33 | 2017-05-02,7,1.8 34 | 2017-05-02,8,3.2 35 | 2017-05-02,9,6.7 36 | 2017-05-02,10,8.6 37 | 2017-05-02,11,10.1 38 | 2017-05-02,12,11.5 39 | 2017-05-02,13,12.8 40 | 2017-05-02,14,13.6 41 | 2017-05-02,15,14.4 42 | 2017-05-02,16,15.4 43 | 2017-05-02,17,16.1 44 | 2017-05-02,18,16.0 45 | 2017-05-02,19,15.1 46 | 2017-05-02,20,12.0 47 | 2017-05-02,21,8.0 48 | 2017-05-02,22,5.6 49 | 2017-05-02,23,4.4 50 | 2017-05-03,0,3.8 51 | 2017-05-03,1,3.4 52 | 2017-05-03,2,2.2 53 | 2017-05-03,3,1.7 54 | 2017-05-03,4,2.1 55 | 2017-05-03,5,2.0 56 | 2017-05-03,6,2.6 57 | 2017-05-03,7,3.4 58 | 2017-05-03,8,3.6 59 | 2017-05-03,9,7.2 60 | 2017-05-03,10,9.2 61 | 2017-05-03,11,10.4 62 | 2017-05-03,12,11.8 63 | 2017-05-03,13,12.2 64 | 2017-05-03,14,13.7 65 | 2017-05-03,15,15.1 66 | 2017-05-03,16,15.7 67 | 2017-05-03,17,16.4 68 | 2017-05-03,18,17.0 69 | 2017-05-03,19,17.1 70 | 2017-05-03,20,14.8 71 | 2017-05-03,21,10.6 72 | 2017-05-03,22,7.9 73 | 2017-05-03,23,6.6 74 | 2017-05-04,0,5.9 75 | 2017-05-04,1,4.7 76 | 2017-05-04,2,5.0 77 | 2017-05-04,3,4.7 78 | 2017-05-04,4,3.6 79 | 2017-05-04,5,3.1 80 | 2017-05-04,6,3.1 81 | 2017-05-04,7,4.3 82 | 2017-05-04,8,3.7 83 | 2017-05-04,9,8.0 84 | 2017-05-04,10,10.6 85 | 2017-05-04,11,11.6 86 | 2017-05-04,12,13.1 87 | 2017-05-04,13,14.7 88 | 2017-05-04,14,15.3 89 | 2017-05-04,15,16.2 90 | 2017-05-04,16,16.8 91 | 2017-05-04,17,17.6 92 | 2017-05-04,18,17.2 93 | 2017-05-04,19,16.6 94 | 2017-05-04,20,14.4 95 | 2017-05-04,21,10.4 96 | 2017-05-04,22,8.0 97 | 2017-05-04,23,6.5 98 | 2017-05-05,0,6.3 99 | 2017-05-05,1,5.8 100 | 2017-05-05,2,5.3 101 | 2017-05-05,3,6.9 102 | 2017-05-05,4,6.4 103 | 2017-05-05,5,5.6 104 | 2017-05-05,6,5.7 105 | 2017-05-05,7,6.8 106 | 2017-05-05,8,9.1 107 | 2017-05-05,9,10.9 108 | 2017-05-05,10,11.4 109 | 2017-05-05,11,12.8 110 | 2017-05-05,12,12.9 111 | 2017-05-05,13,14.3 112 | 2017-05-05,14,17.1 113 | 2017-05-05,15,18.0 114 | 2017-05-05,16,18.3 115 | 2017-05-05,17,19.2 116 | 2017-05-05,18,19.0 117 | 2017-05-05,19,18.7 118 | 2017-05-05,20,16.7 119 | 2017-05-05,21,12.8 120 | 2017-05-05,22,10.7 121 | 2017-05-05,23,9.1 122 | 2017-05-06,0,8.0 123 | 2017-05-06,1,7.7 124 | 2017-05-06,2,7.0 125 | 2017-05-06,3,6.1 126 | 2017-05-06,4,6.1 127 | 2017-05-06,5,5.6 128 | 2017-05-06,6,5.9 129 | 2017-05-06,7,6.2 130 | 2017-05-06,8,7.0 131 | 2017-05-06,9,10.4 132 | 2017-05-06,10,12.3 133 | 2017-05-06,11,13.5 134 | 2017-05-06,12,15.5 135 | 2017-05-06,13,16.0 136 | 2017-05-06,14,18.5 137 | 2017-05-06,15,18.2 138 | 2017-05-06,16,19.3 139 | 2017-05-06,17,20.3 140 | 2017-05-06,18,19.8 141 | 2017-05-06,19,19.9 142 | 2017-05-06,20,16.1 143 | 2017-05-06,21,13.1 144 | 2017-05-06,22,11.1 145 | 2017-05-06,23,9.3 146 | 2017-05-07,0,8.8 147 | 2017-05-07,1,7.4 148 | 2017-05-07,2,7.5 149 | 2017-05-07,3,7.2 150 | 2017-05-07,4,5.9 151 | 2017-05-07,5,5.4 152 | 2017-05-07,6,5.6 153 | 2017-05-07,7,5.8 154 | 2017-05-07,8,7.3 155 | 2017-05-07,9,12.4 156 | 2017-05-07,10,14.5 157 | 2017-05-07,11,14.9 158 | 2017-05-07,12,16.7 159 | 2017-05-07,13,17.8 160 | 2017-05-07,14,18.0 161 | 2017-05-07,15,17.9 162 | 2017-05-07,16,18.0 163 | 2017-05-07,17,17.7 164 | 2017-05-07,18,17.1 165 | 2017-05-07,19,15.5 166 | 2017-05-07,20,12.7 167 | 2017-05-07,21,11.1 168 | 2017-05-07,22,9.7 169 | 2017-05-07,23,8.8 170 | 2017-05-08,0,8.5 171 | 2017-05-08,1,7.8 172 | 2017-05-08,2,6.6 173 | 2017-05-08,3,5.7 174 | 2017-05-08,4,5.6 175 | 2017-05-08,5,5.0 176 | 2017-05-08,6,3.2 177 | 2017-05-08,7,2.9 178 | 2017-05-08,8,5.1 179 | 2017-05-08,9,7.9 180 | 2017-05-08,10,8.9 181 | 2017-05-08,11,9.4 182 | 2017-05-08,12,10.0 183 | 2017-05-08,13,10.6 184 | 2017-05-08,14,11.3 185 | 2017-05-08,15,11.6 186 | 2017-05-08,16,11.8 187 | 2017-05-08,17,12.1 188 | 2017-05-08,18,11.9 189 | 2017-05-08,19,11.1 190 | 2017-05-08,20,10.2 191 | 2017-05-08,21,8.3 192 | 2017-05-08,22,7.0 193 | 2017-05-08,23,6.2 194 | 2017-05-09,0,5.2 195 | 2017-05-09,1,3.0 196 | 2017-05-09,2,1.7 197 | 2017-05-09,3,0.9 198 | 2017-05-09,4,2.6 199 | 2017-05-09,5,4.3 200 | 2017-05-09,6,3.3 201 | 2017-05-09,7,4.7 202 | 2017-05-09,8,5.9 203 | 2017-05-09,9,6.1 204 | 2017-05-09,10,6.5 205 | 2017-05-09,11,8.2 206 | 2017-05-09,12,8.0 207 | 2017-05-09,13,8.2 208 | 2017-05-09,14,8.6 209 | 2017-05-09,15,8.0 210 | 2017-05-09,16,7.8 211 | 2017-05-09,17,6.8 212 | 2017-05-09,18,6.3 213 | 2017-05-09,19,6.4 214 | 2017-05-09,20,5.8 215 | 2017-05-09,21,5.3 216 | 2017-05-09,22,4.7 217 | 2017-05-09,23,4.5 218 | 2017-05-10,0,3.5 219 | 2017-05-10,1,2.5 220 | 2017-05-10,2,2.2 221 | 2017-05-10,3,1.2 222 | 2017-05-10,4,2.1 223 | 2017-05-10,5,2.7 224 | 2017-05-10,6,2.9 225 | 2017-05-10,7,3.4 226 | 2017-05-10,8,4.3 227 | 2017-05-10,9,5.5 228 | 2017-05-10,10,5.9 229 | 2017-05-10,11,6.3 230 | 2017-05-10,12,6.8 231 | 2017-05-10,13,7.5 232 | 2017-05-10,14,7.4 233 | 2017-05-10,15,7.4 234 | 2017-05-10,16,7.6 235 | 2017-05-10,17,7.7 236 | 2017-05-10,18,7.4 237 | 2017-05-10,19,7.1 238 | 2017-05-10,20,6.8 239 | 2017-05-10,21,6.3 240 | 2017-05-10,22,5.4 241 | 2017-05-10,23,4.7 242 | 2017-05-11,0,4.4 243 | 2017-05-11,1,4.4 244 | 2017-05-11,2,4.1 245 | 2017-05-11,3,3.9 246 | 2017-05-11,4,3.3 247 | 2017-05-11,5,3.5 248 | 2017-05-11,6,3.5 249 | 2017-05-11,7,3.8 250 | 2017-05-11,8,4.9 251 | 2017-05-11,9,6.0 252 | 2017-05-11,10,6.7 253 | 2017-05-11,11,7.4 254 | 2017-05-11,12,8.4 255 | 2017-05-11,13,9.6 256 | 2017-05-11,14,10.0 257 | 2017-05-11,15,10.0 258 | 2017-05-11,16,9.9 259 | 2017-05-11,17,10.1 260 | 2017-05-11,18,10.0 261 | 2017-05-11,19,9.7 262 | 2017-05-11,20,9.8 263 | 2017-05-11,21,8.8 264 | 2017-05-11,22,6.2 265 | 2017-05-11,23,5.4 266 | 2017-05-12,0,4.3 267 | 2017-05-12,1,2.7 268 | 2017-05-12,2,3.9 269 | 2017-05-12,3,3.5 270 | 2017-05-12,4,4.8 271 | 2017-05-12,5,4.8 272 | 2017-05-12,6,5.2 273 | 2017-05-12,7,5.6 274 | 2017-05-12,8,6.4 275 | 2017-05-12,9,7.3 276 | 2017-05-12,10,8.1 277 | 2017-05-12,11,9.1 278 | 2017-05-12,12,9.9 279 | 2017-05-12,13,10.4 280 | 2017-05-12,14,10.9 281 | 2017-05-12,15,11.7 282 | 2017-05-12,16,13.1 283 | 2017-05-12,17,13.7 284 | 2017-05-12,18,13.9 285 | 2017-05-12,19,14.1 286 | 2017-05-12,20,12.9 287 | 2017-05-12,21,10.4 288 | 2017-05-12,22,8.2 289 | 2017-05-12,23,5.6 290 | 2017-05-13,0,4.2 291 | 2017-05-13,1,3.5 292 | 2017-05-13,2,3.5 293 | 2017-05-13,3,3.9 294 | 2017-05-13,4,2.9 295 | 2017-05-13,5,2.5 296 | 2017-05-13,6,2.8 297 | 2017-05-13,7,3.8 298 | 2017-05-13,8,5.7 299 | 2017-05-13,9,9.7 300 | 2017-05-13,10,12.2 301 | 2017-05-13,11,13.3 302 | 2017-05-13,12,12.7 303 | 2017-05-13,13,14.0 304 | 2017-05-13,14,14.9 305 | 2017-05-13,15,16.6 306 | 2017-05-13,16,15.8 307 | 2017-05-13,17,16.1 308 | 2017-05-13,18,15.5 309 | 2017-05-13,19,15.2 310 | 2017-05-13,20,15.1 311 | 2017-05-13,21,13.9 312 | 2017-05-13,22,12.5 313 | 2017-05-13,23,11.7 314 | 2017-05-14,0,10.7 315 | 2017-05-14,1,10.4 316 | 2017-05-14,2,10.0 317 | 2017-05-14,3,9.8 318 | 2017-05-14,4,9.3 319 | 2017-05-14,5,9.0 320 | 2017-05-14,6,9.2 321 | 2017-05-14,7,9.8 322 | 2017-05-14,8,10.7 323 | 2017-05-14,9,12.0 324 | 2017-05-14,10,12.7 325 | 2017-05-14,11,12.6 326 | 2017-05-14,12,12.2 327 | 2017-05-14,13,11.9 328 | 2017-05-14,14,12.1 329 | 2017-05-14,15,12.3 330 | 2017-05-14,16,12.0 331 | 2017-05-14,17,11.8 332 | 2017-05-14,18,11.5 333 | 2017-05-14,19,11.1 334 | 2017-05-14,20,10.9 335 | 2017-05-14,21,10.7 336 | 2017-05-14,22,10.2 337 | 2017-05-14,23,9.9 338 | 2017-05-15,0,9.4 339 | 2017-05-15,1,8.9 340 | 2017-05-15,2,9.2 341 | 2017-05-15,3,8.8 342 | 2017-05-15,4,8.2 343 | 2017-05-15,5,8.5 344 | 2017-05-15,6,8.5 345 | 2017-05-15,7,8.9 346 | 2017-05-15,8,9.7 347 | 2017-05-15,9,10.3 348 | 2017-05-15,10,10.5 349 | 2017-05-15,11,11.7 350 | 2017-05-15,12,12.1 351 | 2017-05-15,13,12.2 352 | 2017-05-15,14,13.5 353 | 2017-05-15,15,15.3 354 | 2017-05-15,16,16.3 355 | 2017-05-15,17,16.5 356 | 2017-05-15,18,17.0 357 | 2017-05-15,19,16.8 358 | 2017-05-15,20,15.3 359 | 2017-05-15,21,13.5 360 | 2017-05-15,22,11.3 361 | 2017-05-15,23,9.6 362 | 2017-05-16,0,9.0 363 | 2017-05-16,1,9.2 364 | 2017-05-16,2,9.5 365 | 2017-05-16,3,10.0 366 | 2017-05-16,4,10.1 367 | 2017-05-16,5,10.0 368 | 2017-05-16,6,9.3 369 | 2017-05-16,7,9.2 370 | 2017-05-16,8,9.6 371 | 2017-05-16,9,10.1 372 | 2017-05-16,10,10.7 373 | 2017-05-16,11,11.3 374 | 2017-05-16,12,11.8 375 | 2017-05-16,13,11.7 376 | 2017-05-16,14,11.0 377 | 2017-05-16,15,10.3 378 | 2017-05-16,16,10.9 379 | 2017-05-16,17,10.8 380 | 2017-05-16,18,10.3 381 | 2017-05-16,19,10.2 382 | 2017-05-16,20,10.1 383 | 2017-05-16,21,10.0 384 | 2017-05-16,22,9.9 385 | 2017-05-16,23,9.8 386 | 2017-05-17,0,9.7 387 | 2017-05-17,1,9.6 388 | 2017-05-17,2,9.6 389 | 2017-05-17,3,9.5 390 | 2017-05-17,4,9.4 391 | 2017-05-17,5,9.3 392 | 2017-05-17,6,9.3 393 | 2017-05-17,7,9.5 394 | 2017-05-17,8,9.7 395 | 2017-05-17,9,9.9 396 | 2017-05-17,10,10.9 397 | 2017-05-17,11,13.0 398 | 2017-05-17,12,13.4 399 | 2017-05-17,13,14.4 400 | 2017-05-17,14,15.0 401 | 2017-05-17,15,16.4 402 | 2017-05-17,16,15.1 403 | 2017-05-17,17,15.7 404 | 2017-05-17,18,16.9 405 | 2017-05-17,19,16.6 406 | 2017-05-17,20,15.5 407 | 2017-05-17,21,14.3 408 | 2017-05-17,22,13.0 409 | 2017-05-17,23,12.2 410 | 2017-05-18,0,11.8 411 | 2017-05-18,1,11.2 412 | 2017-05-18,2,10.6 413 | 2017-05-18,3,10.4 414 | 2017-05-18,4,10.3 415 | 2017-05-18,5,10.3 416 | 2017-05-18,6,10.3 417 | 2017-05-18,7,10.3 418 | 2017-05-18,8,10.3 419 | 2017-05-18,9,10.2 420 | 2017-05-18,10,10.4 421 | 2017-05-18,11,10.6 422 | 2017-05-18,12,10.6 423 | 2017-05-18,13,11.0 424 | 2017-05-18,14,11.3 425 | 2017-05-18,15,12.0 426 | 2017-05-18,16,12.1 427 | 2017-05-18,17,11.6 428 | 2017-05-18,18,11.2 429 | 2017-05-18,19,11.4 430 | 2017-05-18,20,11.4 431 | 2017-05-18,21,11.6 432 | 2017-05-18,22,11.4 433 | 2017-05-18,23,11.2 434 | 2017-05-19,0,11.0 435 | 2017-05-19,1,10.7 436 | 2017-05-19,2,10.4 437 | 2017-05-19,3,10.2 438 | 2017-05-19,4,10.0 439 | 2017-05-19,5,9.9 440 | 2017-05-19,6,10.0 441 | 2017-05-19,7,10.1 442 | 2017-05-19,8,10.3 443 | 2017-05-19,9,10.7 444 | 2017-05-19,10,11.3 445 | 2017-05-19,11,12.9 446 | 2017-05-19,12,14.4 447 | 2017-05-19,13,15.4 448 | 2017-05-19,14,16.5 449 | 2017-05-19,15,17.8 450 | 2017-05-19,16,18.8 451 | 2017-05-19,17,19.6 452 | 2017-05-19,18,20.0 453 | 2017-05-19,19,20.3 454 | 2017-05-19,20,18.8 455 | 2017-05-19,21,14.5 456 | 2017-05-19,22,12.1 457 | 2017-05-19,23,11.4 458 | 2017-05-20,0,10.1 459 | 2017-05-20,1,9.6 460 | 2017-05-20,2,10.1 461 | 2017-05-20,3,9.8 462 | 2017-05-20,4,9.4 463 | 2017-05-20,5,9.2 464 | 2017-05-20,6,9.0 465 | 2017-05-20,7,9.5 466 | 2017-05-20,8,11.7 467 | 2017-05-20,9,15.3 468 | 2017-05-20,10,16.6 469 | 2017-05-20,11,18.5 470 | 2017-05-20,12,20.0 471 | 2017-05-20,13,21.3 472 | 2017-05-20,14,20.3 473 | 2017-05-20,15,22.9 474 | 2017-05-20,16,22.0 475 | 2017-05-20,17,22.0 476 | 2017-05-20,18,23.1 477 | 2017-05-20,19,20.4 478 | 2017-05-20,20,18.9 479 | 2017-05-20,21,16.8 480 | 2017-05-20,22,15.3 481 | 2017-05-20,23,13.8 482 | 2017-05-21,0,13.1 483 | 2017-05-21,1,11.7 484 | 2017-05-21,2,11.2 485 | 2017-05-21,3,11.0 486 | 2017-05-21,4,10.6 487 | 2017-05-21,5,10.1 488 | 2017-05-21,6,9.9 489 | 2017-05-21,7,10.1 490 | 2017-05-21,8,10.6 491 | 2017-05-21,9,11.7 492 | 2017-05-21,10,12.3 493 | 2017-05-21,11,14.0 494 | 2017-05-21,12,14.3 495 | 2017-05-21,13,15.5 496 | 2017-05-21,14,16.9 497 | 2017-05-21,15,16.0 498 | 2017-05-21,16,15.7 499 | 2017-05-21,17,14.6 500 | 2017-05-21,18,12.5 501 | 2017-05-21,19,11.6 502 | 2017-05-21,20,11.2 503 | 2017-05-21,21,11.0 504 | 2017-05-21,22,10.7 505 | 2017-05-21,23,10.6 506 | 2017-05-22,0,10.4 507 | 2017-05-22,1,9.5 508 | 2017-05-22,2,9.5 509 | 2017-05-22,3,9.4 510 | 2017-05-22,4,9.6 511 | 2017-05-22,5,9.3 512 | 2017-05-22,6,9.3 513 | 2017-05-22,7,9.2 514 | 2017-05-22,8,9.7 515 | 2017-05-22,9,10.3 516 | 2017-05-22,10,10.7 517 | 2017-05-22,11,11.2 518 | 2017-05-22,12,11.2 519 | 2017-05-22,13,11.3 520 | 2017-05-22,14,11.7 521 | 2017-05-22,15,11.9 522 | 2017-05-22,16,12.3 523 | 2017-05-22,17,12.5 524 | 2017-05-22,18,12.5 525 | 2017-05-22,19,12.5 526 | 2017-05-22,20,12.3 527 | 2017-05-22,21,12.3 528 | 2017-05-22,22,10.3 529 | 2017-05-22,23,7.2 530 | 2017-05-23,0,5.8 531 | 2017-05-23,1,5.5 532 | 2017-05-23,2,4.2 533 | 2017-05-23,3,4.4 534 | 2017-05-23,4,3.9 535 | 2017-05-23,5,3.8 536 | 2017-05-23,6,3.3 537 | 2017-05-23,7,4.1 538 | 2017-05-23,8,6.7 539 | 2017-05-23,9,9.4 540 | 2017-05-23,10,11.3 541 | 2017-05-23,11,12.2 542 | 2017-05-23,12,13.5 543 | 2017-05-23,13,14.9 544 | 2017-05-23,14,16.6 545 | 2017-05-23,15,17.5 546 | 2017-05-23,16,18.1 547 | 2017-05-23,17,17.2 548 | 2017-05-23,18,16.8 549 | 2017-05-23,19,16.4 550 | 2017-05-23,20,15.8 551 | 2017-05-23,21,14.6 552 | 2017-05-23,22,12.5 553 | 2017-05-23,23,9.7 554 | 2017-05-24,0,8.3 555 | 2017-05-24,1,9.1 556 | 2017-05-24,2,10.5 557 | 2017-05-24,3,9.7 558 | 2017-05-24,4,10.8 559 | 2017-05-24,5,11.2 560 | 2017-05-24,6,10.9 561 | 2017-05-24,7,10.7 562 | 2017-05-24,8,11.1 563 | 2017-05-24,9,11.7 564 | 2017-05-24,10,11.6 565 | 2017-05-24,11,10.8 566 | 2017-05-24,12,11.0 567 | 2017-05-24,13,11.4 568 | 2017-05-24,14,12.8 569 | 2017-05-24,15,12.9 570 | 2017-05-24,16,12.2 571 | 2017-05-24,17,12.1 572 | 2017-05-24,18,11.7 573 | 2017-05-24,19,11.9 574 | 2017-05-24,20,11.7 575 | 2017-05-24,21,11.6 576 | 2017-05-24,22,11.3 577 | 2017-05-24,23,11.0 578 | 2017-05-25,0,10.4 579 | 2017-05-25,1,10.2 580 | 2017-05-25,2,9.2 581 | 2017-05-25,3,8.8 582 | 2017-05-25,4,8.6 583 | 2017-05-25,5,8.5 584 | 2017-05-25,6,8.7 585 | 2017-05-25,7,8.7 586 | 2017-05-25,8,8.6 587 | 2017-05-25,9,8.6 588 | 2017-05-25,10,8.8 589 | 2017-05-25,11,9.6 590 | 2017-05-25,12,10.1 591 | 2017-05-25,13,10.7 592 | 2017-05-25,14,11.6 593 | 2017-05-25,15,12.2 594 | 2017-05-25,16,12.6 595 | 2017-05-25,17,13.1 596 | 2017-05-25,18,13.0 597 | 2017-05-25,19,12.6 598 | 2017-05-25,20,12.2 599 | 2017-05-25,21,12.0 600 | 2017-05-25,22,11.5 601 | 2017-05-25,23,11.2 602 | 2017-05-26,0,10.9 603 | 2017-05-26,1,10.8 604 | 2017-05-26,2,10.7 605 | 2017-05-26,3,10.6 606 | 2017-05-26,4,10.6 607 | 2017-05-26,5,10.5 608 | 2017-05-26,6,10.5 609 | 2017-05-26,7,10.6 610 | 2017-05-26,8,10.9 611 | 2017-05-26,9,11.1 612 | 2017-05-26,10,11.3 613 | 2017-05-26,11,11.6 614 | 2017-05-26,12,11.7 615 | 2017-05-26,13,13.0 616 | 2017-05-26,14,13.8 617 | 2017-05-26,15,14.5 618 | 2017-05-26,16,16.1 619 | 2017-05-26,17,14.9 620 | 2017-05-26,18,14.8 621 | 2017-05-26,19,14.5 622 | 2017-05-26,20,14.1 623 | 2017-05-26,21,13.6 624 | 2017-05-26,22,12.9 625 | 2017-05-26,23,12.5 626 | 2017-05-27,0,12.0 627 | 2017-05-27,1,12.0 628 | 2017-05-27,2,11.9 629 | 2017-05-27,3,11.9 630 | 2017-05-27,4,11.7 631 | 2017-05-27,5,11.4 632 | 2017-05-27,6,10.7 633 | 2017-05-27,7,10.3 634 | 2017-05-27,8,12.4 635 | 2017-05-27,9,13.4 636 | 2017-05-27,10,13.9 637 | 2017-05-27,11,15.5 638 | 2017-05-27,12,15.9 639 | 2017-05-27,13,17.8 640 | 2017-05-27,14,19.7 641 | 2017-05-27,15,20.6 642 | 2017-05-27,16,22.0 643 | 2017-05-27,17,22.3 644 | 2017-05-27,18,22.3 645 | 2017-05-27,19,21.8 646 | 2017-05-27,20,20.7 647 | 2017-05-27,21,17.2 648 | 2017-05-27,22,15.3 649 | 2017-05-27,23,13.7 650 | 2017-05-28,0,12.4 651 | 2017-05-28,1,11.9 652 | 2017-05-28,2,10.8 653 | 2017-05-28,3,10.4 654 | 2017-05-28,4,9.4 655 | 2017-05-28,5,9.3 656 | 2017-05-28,6,9.0 657 | 2017-05-28,7,11.3 658 | 2017-05-28,8,13.1 659 | 2017-05-28,9,14.0 660 | 2017-05-28,10,15.1 661 | 2017-05-28,11,16.1 662 | 2017-05-28,12,16.8 663 | 2017-05-28,13,15.7 664 | 2017-05-28,14,16.4 665 | 2017-05-28,15,15.1 666 | 2017-05-28,16,17.0 667 | 2017-05-28,17,17.8 668 | 2017-05-28,18,17.6 669 | 2017-05-28,19,18.2 670 | 2017-05-28,20,17.4 671 | 2017-05-28,21,15.8 672 | 2017-05-28,22,15.7 673 | 2017-05-28,23,15.4 674 | 2017-05-29,0,14.5 675 | 2017-05-29,1,12.6 676 | 2017-05-29,2,12.3 677 | 2017-05-29,3,12.9 678 | 2017-05-29,4,12.5 679 | 2017-05-29,5,12.5 680 | 2017-05-29,6,12.5 681 | 2017-05-29,7,12.9 682 | 2017-05-29,8,13.0 683 | 2017-05-29,9,13.1 684 | 2017-05-29,10,13.0 685 | 2017-05-29,11,13.0 686 | 2017-05-29,12,13.1 687 | 2017-05-29,13,13.0 688 | 2017-05-29,14,13.4 689 | 2017-05-29,15,14.8 690 | 2017-05-29,16,14.5 691 | 2017-05-29,17,14.6 692 | 2017-05-29,18,15.6 693 | 2017-05-29,19,15.2 694 | 2017-05-29,20,14.7 695 | 2017-05-29,21,14.1 696 | 2017-05-29,22,12.6 697 | 2017-05-29,23,12.3 698 | 2017-05-30,0,12.7 699 | 2017-05-30,1,12.8 700 | 2017-05-30,2,12.7 701 | 2017-05-30,3,12.7 702 | 2017-05-30,4,12.5 703 | 2017-05-30,5,12.6 704 | 2017-05-30,6,12.5 705 | 2017-05-30,7,12.7 706 | 2017-05-30,8,12.8 707 | 2017-05-30,9,13.0 708 | 2017-05-30,10,13.0 709 | 2017-05-30,11,12.9 710 | 2017-05-30,12,12.8 711 | 2017-05-30,13,12.7 712 | 2017-05-30,14,13.0 713 | 2017-05-30,15,13.4 714 | 2017-05-30,16,13.0 715 | 2017-05-30,17,13.9 716 | 2017-05-30,18,14.5 717 | 2017-05-30,19,16.0 718 | 2017-05-30,20,16.3 719 | 2017-05-30,21,13.6 720 | 2017-05-30,22,13.1 721 | 2017-05-30,23,12.5 722 | 2017-05-31,0,11.8 723 | 2017-05-31,1,10.5 724 | 2017-05-31,2,9.9 725 | 2017-05-31,3,10.8 726 | 2017-05-31,4,11.1 727 | 2017-05-31,5,11.0 728 | 2017-05-31,6,10.7 729 | 2017-05-31,7,11.0 730 | 2017-05-31,8,11.1 731 | 2017-05-31,9,11.1 732 | 2017-05-31,10,10.7 733 | 2017-05-31,11,10.8 734 | 2017-05-31,12,11.7 735 | 2017-05-31,13,11.6 736 | 2017-05-31,14,11.9 737 | 2017-05-31,15,12.5 738 | 2017-05-31,16,13.6 739 | 2017-05-31,17,12.6 740 | 2017-05-31,18,11.5 741 | 2017-05-31,19,12.2 742 | 2017-05-31,20,12.5 743 | 2017-05-31,21,11.1 744 | 2017-05-31,22,10.7 745 | 2017-05-31,23,10.3 --------------------------------------------------------------------------------