From ffb3f6ccf20f5675ed992cb56843ad81fdcb8361 Mon Sep 17 00:00:00 2001 From: HuangHai <10402852@qq.com> Date: Wed, 10 Sep 2025 15:12:15 +0800 Subject: [PATCH] 'commit' --- Test/TestEcharts.py | 39 ----- Test/bar_chart_config.json | 268 ------------------------------- Test/bar_markline_custom.html | 286 ---------------------------------- 3 files changed, 593 deletions(-) delete mode 100644 Test/TestEcharts.py delete mode 100644 Test/bar_chart_config.json delete mode 100644 Test/bar_markline_custom.html diff --git a/Test/TestEcharts.py b/Test/TestEcharts.py deleted file mode 100644 index 0d7a8ee..0000000 --- a/Test/TestEcharts.py +++ /dev/null @@ -1,39 +0,0 @@ -# pip install pyecharts -import pyecharts -import json - -#print(pyecharts.__version__) -from pyecharts import options as opts -from pyecharts.charts import Bar -from pyecharts.faker import Faker -from pyecharts.globals import CurrentConfig - -# 配置使用自定义的 ECharts 路径 -CurrentConfig.ONLINE_HOST = "https://gcore.jsdelivr.net/npm/echarts@6.0.0/dist/" - -c = ( - Bar() - .add_xaxis(Faker.choose()) - .add_yaxis("商家A", Faker.values()) - .add_yaxis("商家B", Faker.values()) - .set_global_opts(title_opts=opts.TitleOpts(title="Bar-MarkLine(自定义)")) - .set_series_opts( - label_opts=opts.LabelOpts(is_show=False), - markline_opts=opts.MarkLineOpts( - data=[opts.MarkLineItem(y=50, name="yAxis=50")] - ), - ) -) - -# 获取图表的选项配置,使用 dump_options_with_quotes 方法获取可以直接序列化的选项 -options_str = c.dump_options_with_quotes() - -# 输出选项字符串 -print(options_str) - -# 可选:将选项保存到文件 -with open("bar_chart_config.json", "w", encoding="utf-8") as f: - f.write(options_str) - -# 如果需要同时生成 HTML 文件,取消下面这行的注释 -# c.render("bar_markline_custom.html") diff --git a/Test/bar_chart_config.json b/Test/bar_chart_config.json deleted file mode 100644 index 061fac8..0000000 --- a/Test/bar_chart_config.json +++ /dev/null @@ -1,268 +0,0 @@ -{ - "animation": true, - "animationThreshold": 2000, - "animationDuration": 1000, - "animationEasing": "cubicOut", - "animationDelay": 0, - "animationDurationUpdate": 300, - "animationEasingUpdate": "cubicOut", - "animationDelayUpdate": 0, - "aria": { - "enabled": false - }, - "color": [ - "#5470c6", - "#91cc75", - "#fac858", - "#ee6666", - "#73c0de", - "#3ba272", - "#fc8452", - "#9a60b4", - "#ea7ccc" - ], - "series": [ - { - "type": "bar", - "name": "\u5546\u5bb6A", - "legendHoverLink": true, - "data": [ - 122, - 146, - 81, - 104, - 141, - 56, - 117 - ], - "realtimeSort": false, - "showBackground": false, - "stackStrategy": "samesign", - "cursor": "pointer", - "barMinHeight": 0, - "barCategoryGap": "20%", - "barGap": "30%", - "large": false, - "largeThreshold": 400, - "seriesLayoutBy": "column", - "datasetIndex": 0, - "clip": true, - "zlevel": 0, - "z": 2, - "label": { - "show": false, - "margin": 8, - "valueAnimation": false - }, - "markLine": { - "silent": false, - "precision": 2, - "label": { - "show": true, - "margin": 8, - "valueAnimation": false - }, - "data": [ - { - "name": "yAxis=50", - "yAxis": 50 - } - ] - }, - "rippleEffect": { - "show": true, - "brushType": "stroke", - "scale": 2.5, - "period": 4 - } - }, - { - "type": "bar", - "name": "\u5546\u5bb6B", - "legendHoverLink": true, - "data": [ - 147, - 118, - 149, - 81, - 138, - 115, - 94 - ], - "realtimeSort": false, - "showBackground": false, - "stackStrategy": "samesign", - "cursor": "pointer", - "barMinHeight": 0, - "barCategoryGap": "20%", - "barGap": "30%", - "large": false, - "largeThreshold": 400, - "seriesLayoutBy": "column", - "datasetIndex": 0, - "clip": true, - "zlevel": 0, - "z": 2, - "label": { - "show": false, - "margin": 8, - "valueAnimation": false - }, - "markLine": { - "silent": false, - "precision": 2, - "label": { - "show": true, - "margin": 8, - "valueAnimation": false - }, - "data": [ - { - "name": "yAxis=50", - "yAxis": 50 - } - ] - }, - "rippleEffect": { - "show": true, - "brushType": "stroke", - "scale": 2.5, - "period": 4 - } - } - ], - "legend": [ - { - "data": [ - "\u5546\u5bb6A", - "\u5546\u5bb6B" - ], - "selected": {}, - "show": true, - "padding": 5, - "itemGap": 10, - "itemWidth": 25, - "itemHeight": 14, - "backgroundColor": "transparent", - "borderColor": "#ccc", - "borderRadius": 0, - "pageButtonItemGap": 5, - "pageButtonPosition": "end", - "pageFormatter": "{current}/{total}", - "pageIconColor": "#2f4554", - "pageIconInactiveColor": "#aaa", - "pageIconSize": 15, - "animationDurationUpdate": 800, - "selector": false, - "selectorPosition": "auto", - "selectorItemGap": 7, - "selectorButtonGap": 10 - } - ], - "tooltip": { - "show": true, - "trigger": "item", - "triggerOn": "mousemove|click", - "axisPointer": { - "type": "line" - }, - "showContent": true, - "alwaysShowContent": false, - "showDelay": 0, - "hideDelay": 100, - "enterable": false, - "confine": false, - "appendToBody": false, - "transitionDuration": 0.4, - "textStyle": { - "fontSize": 14 - }, - "borderWidth": 0, - "padding": 5, - "order": "seriesAsc" - }, - "xAxis": [ - { - "show": true, - "scale": false, - "nameLocation": "end", - "nameGap": 15, - "gridIndex": 0, - "inverse": false, - "offset": 0, - "splitNumber": 5, - "minInterval": 0, - "splitLine": { - "show": true, - "lineStyle": { - "show": true, - "width": 1, - "opacity": 1, - "curveness": 0, - "type": "solid" - } - }, - "animation": true, - "animationThreshold": 2000, - "animationDuration": 1000, - "animationEasing": "cubicOut", - "animationDelay": 0, - "animationDurationUpdate": 300, - "animationEasingUpdate": "cubicOut", - "animationDelayUpdate": 0, - "data": [ - "\u53ef\u4e50", - "\u96ea\u78a7", - "\u6a59\u6c41", - "\u7eff\u8336", - "\u5976\u8336", - "\u767e\u5a01", - "\u9752\u5c9b" - ] - } - ], - "yAxis": [ - { - "show": true, - "scale": false, - "nameLocation": "end", - "nameGap": 15, - "gridIndex": 0, - "inverse": false, - "offset": 0, - "splitNumber": 5, - "minInterval": 0, - "splitLine": { - "show": true, - "lineStyle": { - "show": true, - "width": 1, - "opacity": 1, - "curveness": 0, - "type": "solid" - } - }, - "animation": true, - "animationThreshold": 2000, - "animationDuration": 1000, - "animationEasing": "cubicOut", - "animationDelay": 0, - "animationDurationUpdate": 300, - "animationEasingUpdate": "cubicOut", - "animationDelayUpdate": 0 - } - ], - "title": [ - { - "show": true, - "text": "Bar-MarkLine\uff08\u81ea\u5b9a\u4e49\uff09", - "target": "blank", - "subtarget": "blank", - "padding": 5, - "itemGap": 10, - "textAlign": "auto", - "textVerticalAlign": "auto", - "triggerEvent": false - } - ] -} \ No newline at end of file diff --git a/Test/bar_markline_custom.html b/Test/bar_markline_custom.html deleted file mode 100644 index 8e2dfeb..0000000 --- a/Test/bar_markline_custom.html +++ /dev/null @@ -1,286 +0,0 @@ - - - - - Awesome-pyecharts - - - - - -
- - -