{ "info": { "author": "Hongsonggao", "author_email": "gmaclinuxer@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Environment :: Web Environment", "Framework :: Django", "Framework :: Django :: 1.8", "Framework :: Django :: 1.9", "Intended Audience :: Developers", "License :: OSI Approved :: BSD License", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Topic :: Software Development" ], "description": "##################\nDjango-Highchartit\n##################\n\n.. image:: https://readthedocs.org/projects/django-chartit2/badge/?version=latest\n :target: http://django-chartit2.readthedocs.org/en/latest/?badge=latest\n :alt: Documentation Status\n\n.. image:: https://travis-ci.org/grantmcconnaughey/django-chartit2.svg?branch=master\n :target: https://travis-ci.org/grantmcconnaughey/django-chartit2\n\n.. image:: https://coveralls.io/repos/grantmcconnaughey/django-chartit2/badge.svg?branch=master&service=github\n :target: https://coveralls.io/github/grantmcconnaughey/django-chartit2?branch=master\n\n\nThe fork of Django Charit2 and merge Django Chartit new feature that adds support for Python 3 and Django 1.8+!\n\nDjango Chartit is a Django app that can be used to easily create charts from the data\nin your database. The charts are rendered using ``Highcharts`` and ``jQuery``\nJavaScript libraries. Data in your database can be plotted as simple line\ncharts, column charts, area charts, scatter plots, and many more chart types.\nData can also be plotted as Pivot Charts where the data is grouped and/or\npivoted by specific column(s).\n\n========\nFeatures\n========\n\n- Plot charts from models.\n- Plot data from multiple models on the same axis on a chart.\n- Plot pivot charts from models. Data can be pivoted by across multiple\n columns.\n- Legend pivot charts by multiple columns.\n- Combine data from multiple models to plot on same pivot charts.\n- Plot a pareto chart, paretoed by a specific column.\n- Plot only a top few items per category in a pivot chart.\n\n=============================================\nImprovements from the original Django-Chartit2\n=============================================\n\n- Added Python 3 compatibility\n- Added Django 1.8 and 1.9 compatibility\n- Added documentation to ReadTheDocs\n- Added automated testing via Travis CI\n- Added test coverage tracking via Coveralls\n- Added annotate support from Django-Chartit\n\n============\nInstallation\n============\n\nYou can install Django-Highcharts from PyPI. Just do ::\n\n $ pip install django-highchartit\n\nYou also need supporting JavaScript libraries. See the\n`Required JavaScript Libraries`_ section for more details.\n\n==========\nHow to Use\n==========\n\nPlotting a chart or pivot chart on a webpage involves the following steps.\n\n1. Create a ``DataPool`` or ``PivotDataPool`` object that specifies what data\n you need to retrieve and from where.\n2. Create a ``Chart`` or ``PivotChart`` object to plot the data in the\n ``DataPool`` or ``PivotDataPool`` respectively.\n3. Return the ``Chart``/``PivotChart`` object from a django ``view`` function\n to the django template.\n4. Use the ``load_charts`` template tag to load the charts to HTML tags with\n specific `ids`.\n\nIt is easier to explain the steps above with examples. So read on.\n\n====================\nHow to Create Charts\n====================\nHere is a short example of how to create a line chart. Let's say we have a\nsimple model with 3 fields - one for month and two for temperatures of Boston\nand Houston. ::\n\n class MonthlyWeatherByCity(models.Model):\n month = models.IntegerField()\n boston_temp = models.DecimalField(max_digits=5, decimal_places=1)\n houston_temp = models.DecimalField(max_digits=5, decimal_places=1)\n\nAnd let's say we want to create a simple line chart of month on the x-axis\nand the temperatures of the two cities on the y-axis. ::\n\n from chartit import DataPool, Chart\n\n def weather_chart_view(request):\n #Step 1: Create a DataPool with the data we want to retrieve.\n weatherdata = \\\n DataPool(\n series=\n [{'options': {\n 'source': MonthlyWeatherByCity.objects.all()},\n 'terms': [\n 'month',\n 'houston_temp',\n 'boston_temp']}\n ])\n\n #Step 2: Create the Chart object\n cht = Chart(\n datasource = weatherdata,\n series_options =\n [{'options':{\n 'type': 'line',\n 'stacking': False},\n 'terms':{\n 'month': [\n 'boston_temp',\n 'houston_temp']\n }}],\n chart_options =\n {'title': {\n 'text': 'Weather Data of Boston and Houston'},\n 'xAxis': {\n 'title': {\n 'text': 'Month number'}}})\n\n #Step 3: Send the chart object to the template.\n return render_to_response({'weatherchart': cht})\n\nAnd you can use the ``load_charts`` filter in the django template to render\nthe chart. ::\n\n \n \n \n \n {% load chartit %}\n {{ weatherchart|load_charts:\"container\" }}\n \n \n
Chart will be rendered here
\n \n\n===========================\nHow to Create Pivot Charts\n===========================\n\nHere is an example of how to create a pivot chart. Let's say we have the\nfollowing model. ::\n\n class DailyWeather(models.Model):\n month = models.IntegerField()\n day = models.IntegerField()\n temperature = models.DecimalField(max_digits=5, decimal_places=1)\n rainfall = models.DecimalField(max_digits=5, decimal_places=1)\n city = models.CharField(max_length=50)\n state = models.CharField(max_length=2)\n\nWe want to plot a pivot chart of month (along the x-axis) versus the average\nrainfall (along the y-axis) of the top 3 cities with highest average\nrainfall in each month. ::\n\n from chartit import PivotDataPool, PivotChart\n\n def rainfall_pivot_chart_view(request):\n #Step 1: Create a PivotDataPool with the data we want to retrieve.\n rainpivotdata = \\\n PivotDataPool(\n series =\n [{'options': {\n 'source': DailyWeather.objects.all(),\n 'categories': ['month']},\n 'terms': {\n 'avg_rain': Avg('rainfall'),\n 'legend_by': ['city'],\n 'top_n_per_cat': 3}}\n ])\n\n #Step 2: Create the PivotChart object\n rainpivcht = \\\n PivotChart(\n datasource = rainpivotdata,\n series_options =\n [{'options':{\n 'type': 'column',\n 'stacking': True},\n 'terms':[\n 'avg_rain']}],\n chart_options =\n {'title': {\n 'text': 'Rain by Month in top 3 cities'},\n 'xAxis': {\n 'title': {\n 'text': 'Month'}}})\n\n #Step 3: Send the PivotChart object to the template.\n return render_to_response({'rainpivchart': rainpivcht})\n\nAnd you can use the ``load_charts`` filter in the django template to render\nthe chart. ::\n\n \n \n \n \n {% load chartit %}\n {{ rainpivchart|load_charts:\"container\" }}\n \n \n
Chart will be rendered here
\n \n\n====\nRendering multiple charts\n====\n\nIt is possible to render multiple charts in the same template. The first\nargument to ``load_charts`` is the Chart object or a list of Chart objects,\nand the second is a comma separated list of HTML IDs where the charts will\nbe rendered.\n\nWhen calling Django's ``render`` you have to pass all you charts as a list::\n\n return render(request, 'index.html',\n {\n 'chart_list' : [chart_1, chart_2],\n }\n )\n\nThen in your template you have to use the proper syntax::\n\n \n {% load chartit %}\n {{ chart_list|load_charts:\"chart_1,chart_2\" }}\n \n \n
First chart will be rendered here
\n
Second chart will be rendered here
\n \n\n====\nDemo\n====\n\nThe above examples are just a brief taste of what you can do with\nDjango-Chartit. For more examples and to look at the charts in actions, check\nout the `demo website `_.\n\n===============\nDocumentation\n===============\n\nFull documentation is available\n`here `_ .\n\n=============================\nRequired JavaScript Libraries\n=============================\n\nThe following JavaScript Libraries are required for using Django-Highcharts.\n\n- `jQuery `_\n- `Highcharts `_\n\n.. note:: While ``Django-Chartit`` and ``Django-Chartit 2`` itself is licensed under the BSD license,\n ``Highcharts`` is licensed under the `Highcharts license\n `_ and ``jQuery`` is licensed under both\n MIT License and GNU General Public License (GPL) Version 2. It is your own\n responsibility to abide by respective licenses when downloading and using\n the supporting JavaScript libraries.", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/gmaclinuxer/django-highcharts.git", "keywords": "django charts", "license": "BSD", "maintainer": "Hongsonggao", "maintainer_email": "gmaclinuxer@gmail.com", "name": "django-highchartit", "package_url": "https://pypi.org/project/django-highchartit/", "platform": "any", "project_url": "https://pypi.org/project/django-highchartit/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/gmaclinuxer/django-highcharts.git" }, "release_url": "https://pypi.org/project/django-highchartit/0.2.3/", "requires_dist": null, "requires_python": null, "summary": "A Django app to plot charts and pivot charts directly from the models. Uses HighCharts and jQuery JavaScript libraries to render the charts on the webpage.", "version": "0.2.3" }, "last_serial": 2337403, "releases": { "0.2.3": [ { "comment_text": "", "digests": { "md5": "64ee681e1dc88013261b7cebd2da924d", "sha256": "8e0ed9f6f4145de77c9c8d5ded95e1a7ec436512b498a8f3ff95b66e44ffdda7" }, "downloads": -1, "filename": "django_highchartit-0.2.3-py2.7.egg", "has_sig": false, "md5_digest": "64ee681e1dc88013261b7cebd2da924d", "packagetype": "bdist_egg", "python_version": "2.7", "requires_python": null, "size": 47015, "upload_time": "2016-09-12T08:04:56", "url": "https://files.pythonhosted.org/packages/3d/2b/a9b388ad173bce40fc4bdb1a1e90d463e3031c6349e3366b41a12eff1662/django_highchartit-0.2.3-py2.7.egg" }, { "comment_text": "", "digests": { "md5": "8434366c771b7b99c46760e8510df0f3", "sha256": "e4615e92c55729783c7dec3d809543eb2a43966c0f2c7a5c8b69ea001668cbc5" }, "downloads": -1, "filename": "django-highchartit-0.2.3.win32.zip", "has_sig": false, "md5_digest": "8434366c771b7b99c46760e8510df0f3", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 48855, "upload_time": "2016-09-12T08:05:00", "url": "https://files.pythonhosted.org/packages/f8/0c/18d1cd826668ccd80799e714ba2e63e38fc8f3fab691da2e874919aa8612/django-highchartit-0.2.3.win32.zip" }, { "comment_text": "", "digests": { "md5": "97398f8cd4de376257e512498acf73b2", "sha256": "6e7ea209b11d60bf6f7d461732377b353e2109b325367eab329ccb167fa9d382" }, "downloads": -1, "filename": "django-highchartit-0.2.3.zip", "has_sig": false, "md5_digest": "97398f8cd4de376257e512498acf73b2", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 33381, "upload_time": "2016-09-12T02:37:14", "url": "https://files.pythonhosted.org/packages/31/15/12de436183b9b0e508ea7be0d1d2baf5b1230d2030f24c8dc26df67be7a1/django-highchartit-0.2.3.zip" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "64ee681e1dc88013261b7cebd2da924d", "sha256": "8e0ed9f6f4145de77c9c8d5ded95e1a7ec436512b498a8f3ff95b66e44ffdda7" }, "downloads": -1, "filename": "django_highchartit-0.2.3-py2.7.egg", "has_sig": false, "md5_digest": "64ee681e1dc88013261b7cebd2da924d", "packagetype": "bdist_egg", "python_version": "2.7", "requires_python": null, "size": 47015, "upload_time": "2016-09-12T08:04:56", "url": "https://files.pythonhosted.org/packages/3d/2b/a9b388ad173bce40fc4bdb1a1e90d463e3031c6349e3366b41a12eff1662/django_highchartit-0.2.3-py2.7.egg" }, { "comment_text": "", "digests": { "md5": "8434366c771b7b99c46760e8510df0f3", "sha256": "e4615e92c55729783c7dec3d809543eb2a43966c0f2c7a5c8b69ea001668cbc5" }, "downloads": -1, "filename": "django-highchartit-0.2.3.win32.zip", "has_sig": false, "md5_digest": "8434366c771b7b99c46760e8510df0f3", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 48855, "upload_time": "2016-09-12T08:05:00", "url": "https://files.pythonhosted.org/packages/f8/0c/18d1cd826668ccd80799e714ba2e63e38fc8f3fab691da2e874919aa8612/django-highchartit-0.2.3.win32.zip" }, { "comment_text": "", "digests": { "md5": "97398f8cd4de376257e512498acf73b2", "sha256": "6e7ea209b11d60bf6f7d461732377b353e2109b325367eab329ccb167fa9d382" }, "downloads": -1, "filename": "django-highchartit-0.2.3.zip", "has_sig": false, "md5_digest": "97398f8cd4de376257e512498acf73b2", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 33381, "upload_time": "2016-09-12T02:37:14", "url": "https://files.pythonhosted.org/packages/31/15/12de436183b9b0e508ea7be0d1d2baf5b1230d2030f24c8dc26df67be7a1/django-highchartit-0.2.3.zip" } ] }