Skip to content

使用GPT生成ECharts图表/Using GPT to generate Echarts Figures

Notifications You must be signed in to change notification settings

Dafeigy/ChartsGPT

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ChartGPT logo

ChartGPT

使用自然语言生成Echarts图表

What it does

demo

How to use

根目录中新建config.json文件:

{
    "url": "https://openai.api2d.net/v1/chat/completions",
    "model":"gpt-3.5-turbo",
    "headers": {
        "Content-Type": "application/json",
        "Authorization": "Bearer YOUR-KEY"
    }
}

填写keyurl即可,支持api2d,其余参数与openai的api一致。该方法还比较丑陋,后续会在前端页面进行调整优化。

运行app.py即可,默认运行在https://127.0.0.1:5000,以下是一些可供参考的案例:

1.创建一个折线图,横坐标['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'],纵坐标 [150, 230, 224, 218, 135, 147, 260]

2.创建一个雷达图,数据 为[4200, 3000, 20000, 35000, 50000, 18000],分别对应[Sales,Administration,Information Technology,Customer Support,Development,Marketing] 这几项内容

3.创建一个K线图,横坐标 ['2017-10-24', '2017-10-25', '2017-10-26', '2017-10-27'],纵坐标[[20, 34, 10, 38],[40, 35, 30, 50],[31, 38, 33, 44],[38, 15, 5, 42]]

参考

感谢

感谢今天读的论文很难才导致有闲心和时间把这个东西写出来^_^

About

使用GPT生成ECharts图表/Using GPT to generate Echarts Figures

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published