Skip to main content

Frontend Charts for django

Project description

dchartjs

dchartjs is python package. it is used to draw charts in frontend Using Django

Installation

Use the package manager pip to install dchartjs.

pip install dchartjs

Basic Usage In Django

in Django views.py

from dchartjs.basic_chart import Bchart

def DjangoChart(request):
    Chart = Bchart()
    Chart.chart_data(xdata=[0,2,5,10],ydata=[1,5,5,25])
    data = Chart.project_djangoview()
    return render(request, 'chart.html', data)

in chart.html

<body>
{{ chart_as }}
</body>

Basic Usage In No Framework

if your not using any Framework then you can also plot directly into web

from dchartjs.basic_chart import Bchart

Chart = Bchart()
Chart.chart_data(xdata=[0,2,5,10],ydata=[1,5,5,25])
Chart.project_web() #it creat temp.html file then open chart in browser 

Basic Style dchartjs

from dchartjs.basic_chart import Bchart

def DjangoChart(request):
    Chart = Bchart()
    Chart.chart_style_conf(width=100,height=100) 
    Chart.chart_data(xdata=[0,2,5,10],ydata=[1,5,5,25])
    data = Chart.project_djangoview()
    return render(request, 'chart.html', data)

Project details


Release history Release notifications | RSS feed

This version

0.2

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

dchartjs-0.2.tar.gz (2.8 kB view hashes)

Uploaded Source

Built Distribution

dchartjs-0.2-py3-none-any.whl (3.7 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page