Skip to main content

Python3 binding for `@AntV/G2Plot` Plotting Library, make charting easier.

Project description

PyG2Plot

🎨 Python3 binding for @AntV/G2Plot Plotting Library. Inspired by pyecharts.

Latest Stable Version build Status

Installation

$ pip install pyg2plot

Usage

from pyg2plot import __version__, Plot

line = Plot("Line")

line.set_options({
  "data": [
    { "year": "1991", "value": 3 },
    { "year": "1992", "value": 4 },
    { "year": "1993", "value": 3.5 },
    { "year": "1994", "value": 5 },
    { "year": "1995", "value": 4.9 },
    { "year": "1996", "value": 6 },
    { "year": "1997", "value": 7 },
    { "year": "1998", "value": 9 },
    { "year": "1999", "value": 13 },
  ],
  "xField": "year",
  "yField": "value",
})

line.render()

image

API

Now, only has one API of pyg2plot.

  • Plot
  1. Plot(plot_type: str): get an instance of Plot class.

  2. plot.set_options(options: object): set the options of G2Plot into instance.

  3. plot.render(path, env, **kwargs): render out html file by setting the path, jinja2 env and kwargs.

  4. plot.render_html(env, **kwargs): render out html string by setting jinja2 env and kwargs.

  5. plot.dump_js_options(env, **kwargs): dump js options by setting jinja2 env and kwargs, use it for HTTP request.

More apis is on the way.

License

MIT@hustcc.

Project details


Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

pyg2plot-0.1.3-py3-none-any.whl (6.6 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