diff --git a/evaluations/datastes/chart/dual-axes/eval.json b/evaluations/datastes/chart/dual-axes/eval.json new file mode 100644 index 0000000..01340a7 --- /dev/null +++ b/evaluations/datastes/chart/dual-axes/eval.json @@ -0,0 +1,150 @@ +[ + { + "type": "text2chart", + "question": "用双轴图展示某公司的年收入与员工满意度,2017年至2021年的收入分别为85.4亿、93.2亿、100.1亿、108.6亿、115.5亿,员工满意度(满分10分)分别为7.2、7.5、7.8、8.0、8.2。", + "response": "{\"type\":\"dual-axes\",\"categories\":[\"2017\",\"2018\",\"2019\",\"2020\",\"2021\"],\"title\":\"2017-2021年收入与员工满意度\",\"axisXTitle\":\"年份\",\"series\":[{\"type\":\"column\",\"data\":[85.4,93.2,100.1,108.6,115.5],\"axisYTitle\":\"收入(亿)\"},{\"type\":\"line\",\"data\":[7.2,7.5,7.8,8,8.2],\"axisYTitle\":\"员工满意度\"}]}", + "answer": "{\"type\":\"dual-axes\",\"categories\":[\"2017\",\"2018\",\"2019\",\"2020\",\"2021\"],\"title\":\"2017-2021年收入与员工满意度\",\"axisXTitle\":\"年份\",\"series\":[{\"type\":\"column\",\"data\":[85.4,93.2,100.1,108.6,115.5],\"axisYTitle\":\"年收入 (亿)\"},{\"type\":\"line\",\"data\":[7.2,7.5,7.8,8,8.2],\"axisYTitle\":\"员工满意度\"}]}", + "reference": [ + "[WIP]双轴图 - DualAxes Chart 使用示例", + "柱形图 - Column Chart 使用示例", + "条形图 - Bar Chart 使用示例" + ] + }, + { + "type": "text2chart", + "question": "用双轴图来表示一个城市的年度平均气温和降水量。从2016到2020年,平均气温分别是15°C、16°C、17°C、18°C、19°C;同期的年降水量为800mm、850mm、900mm、950mm、1000mm。", + "response": "{\"type\":\"dual-axes\",\"categories\":[\"2016\",\"2017\",\"2018\",\"2019\",\"2020\"],\"title\":\"2016-2020年平均气温与降水量\",\"axisXTitle\":\"年份\",\"series\":[{\"type\":\"line\",\"data\":[15,16,17,18,19],\"axisYTitle\":\"平均气温(°C)\"},{\"type\":\"column\",\"data\":[800,850,900,950,1000],\"axisYTitle\":\"年降水量(mm)\"}]}", + "answer": "{\"type\":\"dual-axes\",\"categories\":[\"2016\",\"2017\",\"2018\",\"2019\",\"2020\"],\"title\":\"2016-2020年城市气候数据\",\"axisXTitle\":\"年份\",\"series\":[{\"type\":\"line\",\"data\":[15,16,17,18,19],\"axisYTitle\":\"平均气温 (°C)\"},{\"type\":\"column\",\"data\":[800,850,900,950,1000],\"axisYTitle\":\"降水量 (mm)\"}]}", + "reference": [ + "[WIP]双轴图 - DualAxes Chart 基础概念", + "热力地图 - HeatMap 使用示例" + ] + }, + { + "type": "text2chart", + "question": "利用双轴图展示一家电商平台的商品销量和退货率。在2019至2023年间,商品销量依次是120万件、130万件、140万件、150万件、160万件;相应的退货率则为2%、2.5%、3%、3.5%、4%。", + "response": "{\"type\":\"dual-axes\",\"categories\":[\"2019\",\"2020\",\"2021\",\"2022\",\"2023\"],\"title\":\"2019-2023年商品销量与退货率\",\"axisXTitle\":\"年份\",\"series\":[{\"type\":\"column\",\"data\":[120,130,140,150,160],\"axisYTitle\":\"商品销量(万件)\"},{\"type\":\"line\",\"data\":[0.02,0.025,0.03,0.035,0.04],\"axisYTitle\":\"退货率\"}]}", + "answer": "{\"type\":\"dual-axes\",\"categories\":[\"2019\",\"2020\",\"2021\",\"2022\",\"2023\"],\"title\":\"2019-2023电商平台销量及退货情况\",\"axisXTitle\":\"年份\",\"series\":[{\"type\":\"column\",\"data\":[120,130,140,150,160],\"axisYTitle\":\"销量 (万件)\"},{\"type\":\"line\",\"data\":[0.02,0.025,0.03,0.035,0.04],\"axisYTitle\":\"退货率 (%)\"}]}", + "reference": [ + "[WIP]双轴图 - DualAxes Chart 基础概念", + "折线图 - Line Chart 使用示例", + "条形图 - Bar Chart 使用示例" + ] + }, + { + "type": "text2chart", + "question": "通过双轴图呈现某地区每年的人口增长数量以及经济增长率。2015年至2019年间,人口增量分别是12万、14万、16万、18万、20万;同期GDP增长率分别为3.5%、4.0%、4.5%、5.0%、5.5%。", + "response": "{\"type\":\"dual-axes\",\"categories\":[\"2015\",\"2016\",\"2017\",\"2018\",\"2019\"],\"title\":\"人口增长与经济增长率\",\"axisXTitle\":\"年份\",\"series\":[{\"type\":\"column\",\"data\":[12,14,16,18,20],\"axisYTitle\":\"人口增量(万)\"},{\"type\":\"line\",\"data\":[3.5,4.0,4.5,5.0,5.5],\"axisYTitle\":\"GDP增长率\"}]}", + "answer": "{\"type\":\"dual-axes\",\"categories\":[\"2015\",\"2016\",\"2017\",\"2018\",\"2019\"],\"title\":\"2015-2019人口增长与经济增长\",\"axisXTitle\":\"年份\",\"series\":[{\"type\":\"column\",\"data\":[12,14,16,18,20],\"axisYTitle\":\"人口增长 (万人)\"},{\"type\":\"line\",\"data\":[0.035,0.04,0.045,0.05,0.055],\"axisYTitle\":\"GDP增长率 (%)\"}]}", + "reference": [ + "[WIP]双轴图 - DualAxes Chart 基础概念", + "饼图 - Pie Chart 使用示例", + "折线图 - Line Chart 使用示例" + ] + }, + { + "type": "text2chart", + "question": "采用双轴图形式描绘一国能源消费总量及其可再生能源占比的变化趋势。从2013到2017年,该国总能源消费量分别为50亿吨标准煤、52亿吨标准煤、54亿吨标准煤、56亿吨标准煤、58亿吨标准煤;可再生能源比例依次为10%、12%、14%、16%、18%。", + "response": "{\"type\":\"dual-axes\",\"categories\":[\"2013\",\"2014\",\"2015\",\"2016\",\"2017\"],\"title\":\"2013-2017年能源消费总量与可再生能源占比\",\"axisXTitle\":\"年份\",\"series\":[{\"type\":\"column\",\"data\":[50,52,54,56,58],\"axisYTitle\":\"能源消费总量(亿吨标准煤)\"},{\"type\":\"line\",\"data\":[10,12,14,16,18],\"axisYTitle\":\"可再生能源占比(%)\"}]}", + "answer": "{\"type\":\"dual-axes\",\"categories\":[\"2013\",\"2014\",\"2015\",\"2016\",\"2017\"],\"title\":\"2013-2017能源消费与可再生能源占比\",\"axisXTitle\":\"年份\",\"series\":[{\"type\":\"column\",\"data\":[50,52,54,56,58],\"axisYTitle\":\"能源消费 (亿吨标准煤)\"},{\"type\":\"line\",\"data\":[0.1,0.12,0.14,0.16,0.18],\"axisYTitle\":\"可再生能源占比 (%)\"}]}", + "reference": [ + "[WIP]双轴图 - DualAxes Chart 基础概念", + "柱形图 - Column Chart 使用示例", + "条形图 - Bar Chart 使用示例" + ] + }, + { + "type": "data2chart", + "question": "用双轴图可视化我的数据 [{ \"year\": 2019, \"sales\": 300, \"profit_margin\": 20 }, { \"year\": 2020, \"sales\": 400, \"profit_margin\": 22 }, { \"year\": 2021, \"sales\": 500, \"profit_margin\": 25 }]", + "response": "{\"type\":\"dual-axes\",\"categories\":[\"2019\",\"2020\",\"2021\"],\"title\":\"2019-2021 Sales and Profit Margin\",\"axisXTitle\":\"Year\",\"series\":[{\"type\":\"column\",\"data\":[300,400,500],\"axisYTitle\":\"Sales\"},{\"type\":\"line\",\"data\":[20,22,25],\"axisYTitle\":\"Profit Margin\"}]}", + "answer": "{\"type\":\"dual-axes\",\"categories\":[\"2019\",\"2020\",\"2021\"],\"title\":\"2019-2021 Sales and Profit Margin\",\"axisXTitle\":\"Year\",\"series\":[{\"type\":\"column\",\"data\":[300,400,500],\"axisYTitle\":\"Sales\"},{\"type\":\"line\",\"data\":[20,22,25],\"axisYTitle\":\"Profit Margin (%)\"}]}", + "reference": [ + "[WIP]双轴图 - DualAxes Chart 使用示例", + "折线图 - Line Chart 使用示例", + "条形图 - Bar Chart 使用示例" + ] + }, + { + "type": "data2chart", + "question": "用双轴图展示过去三年的气温和降水量数据 [{ \"month\": \"Jan\", \"temperature\": 5, \"rainfall\": 50 }, { \"month\": \"Feb\", \"temperature\": 7, \"rainfall\": 60 }, { \"month\": \"Mar\", \"temperature\": 10, \"rainfall\": 80 }]", + "response": "{\"type\":\"dual-axes\",\"categories\":[\"Jan\",\"Feb\",\"Mar\"],\"title\":\"过去三年的气温和降水量\",\"axisXTitle\":\"月份\",\"series\":[{\"type\":\"line\",\"data\":[5,7,10],\"axisYTitle\":\"气温\"},{\"type\":\"column\",\"data\":[50,60,80],\"axisYTitle\":\"降水量\"}]}", + "answer": "{\"type\":\"dual-axes\",\"categories\":[\"Jan\",\"Feb\",\"Mar\"],\"title\":\"Monthly Temperature and Rainfall (Q1)\",\"axisXTitle\":\"Month\",\"series\":[{\"type\":\"line\",\"data\":[5,7,10],\"axisYTitle\":\"Temperature (°C)\"},{\"type\":\"column\",\"data\":[50,60,80],\"axisYTitle\":\"Rainfall (mm)\"}]}", + "reference": [ + "[WIP]双轴图 - DualAxes Chart 基础概念", + "热力地图 - HeatMap 使用示例" + ] + }, + { + "type": "data2chart", + "question": "用双轴图显示用户增长与活跃度 [{ \"quarter\": \"Q1\", \"user_growth\": 500, \"activity_rate\": 60 }, { \"quarter\": \"Q2\", \"user_growth\": 700, \"activity_rate\": 65 }, { \"quarter\": \"Q3\", \"user_growth\": 900, \"activity_rate\": 70 }]", + "response": "{\n \"type\": \"dual-axes\",\n \"categories\": [\"Q1\", \"Q2\", \"Q3\"],\n \"title\": \"用户增长与活跃度\",\n \"axisXTitle\": \"季度\",\n \"series\": [\n {\n \"type\": \"column\",\n \"data\": [500, 700, 900],\n \"axisYTitle\": \"用户增长\"\n },\n {\n \"type\": \"line\",\n \"data\": [60, 65, 70],\n \"axisYTitle\": \"活跃度\"\n }\n ]\n}", + "answer": "{\"type\":\"dual-axes\",\"categories\":[\"Q1\",\"Q2\",\"Q3\"],\"title\":\"User Growth and Activity Rate by Quarter\",\"axisXTitle\":\"Quarter\",\"series\":[{\"type\":\"column\",\"data\":[500,700,900],\"axisYTitle\":\"User Growth\"},{\"type\":\"line\",\"data\":[60,65,70],\"axisYTitle\":\"Activity Rate (%)\"}]}", + "reference": [ + "[WIP]双轴图 - DualAxes Chart 基础概念", + "折线图 - Line Chart 使用示例", + "热力地图 - HeatMap 使用示例" + ] + }, + { + "type": "data2chart", + "question": "用双轴图表示产品销售量与退货率 [{ \"product\": \"A\", \"sales_volume\": 200, \"return_rate\": 5 }, { \"product\": \"B\", \"sales_volume\": 300, \"return_rate\": 7 }, { \"product\": \"C\", \"sales_volume\": 400, \"return_rate\": 9 }]", + "response": "{\"type\":\"dual-axes\",\"categories\":[\"A\",\"B\",\"C\"],\"title\":\"产品销售量与退货率\",\"axisXTitle\":\"产品\",\"series\":[{\"type\":\"column\",\"data\":[200,300,400],\"axisYTitle\":\"销售量\"},{\"type\":\"line\",\"data\":[5,7,9],\"axisYTitle\":\"退货率\"}]}", + "answer": "{\"type\":\"dual-axes\",\"categories\":[\"A\",\"B\",\"C\"],\"title\":\"Product Sales Volume and Return Rate\",\"axisXTitle\":\"Product\",\"series\":[{\"type\":\"column\",\"data\":[200,300,400],\"axisYTitle\":\"Sales Volume\"},{\"type\":\"line\",\"data\":[5,7,9],\"axisYTitle\":\"Return Rate (%)\"}]}", + "reference": [ + "[WIP]双轴图 - DualAxes Chart 基础概念", + "矩阵树图 -Treemap Chart 使用示例", + "折线图 - Line Chart 使用示例" + ] + }, + { + "type": "data2chart", + "question": "用双轴图绘制公司收入与支出情况 [{ \"year\": 2018, \"income\": 1000, \"expenses\": 800 }, { \"year\": 2019, \"income\": 1200, \"expenses\": 900 }, { \"year\": 2020, \"income\": 1500, \"expenses\": 1000 }]", + "response": "{\"type\":\"dual-axes\",\"categories\":[\"2018\",\"2019\",\"2020\"],\"title\":\"2018-2020 Income and Expenses\",\"axisXTitle\":\"Year\",\"series\":[{\"type\":\"column\",\"data\":[1000,1200,1500],\"axisYTitle\":\"Income\"},{\"type\":\"line\",\"data\":[800,900,1000],\"axisYTitle\":\"Expenses\"}]}", + "answer": "{\"type\":\"dual-axes\",\"categories\":[\"2018\",\"2019\",\"2020\"],\"title\":\"Annual Income and Expenses\",\"axisXTitle\":\"Year\",\"series\":[{\"type\":\"column\",\"data\":[1000,1200,1500],\"axisYTitle\":\"Income\"},{\"type\":\"line\",\"data\":[800,900,1000],\"axisYTitle\":\"Expenses\"}]}", + "reference": [ + "[WIP]双轴图 - DualAxes Chart 使用示例", + "散点图 - Scatter Chart 使用示例", + "折线图 - Line Chart 使用示例" + ] + }, + { + "type": "data2chart", + "question": "用组合图可视化我的数据 [{ \"year\": 2017, \"revenue\": 800, \"profit_margin\": 15 }, { \"year\": 2018, \"revenue\": 900, \"profit_margin\": 18 }, { \"year\": 2019, \"revenue\": 1000, \"profit_margin\": 20 }]", + "response": "{\"type\":\"dual-axes\",\"categories\":[\"2017\",\"2018\",\"2019\"],\"title\":\"2017-2019 Revenue and Profit Margin\",\"axisXTitle\":\"Year\",\"series\":[{\"type\":\"column\",\"data\":[800,900,1000],\"axisYTitle\":\"Revenue\"},{\"type\":\"line\",\"data\":[15,18,20],\"axisYTitle\":\"Profit Margin\"}]}", + "answer": "{\"type\":\"dual-axes\",\"categories\":[\"2017\",\"2018\",\"2019\"],\"title\":\"2017-2019 Revenue and Profit Margin\",\"axisXTitle\":\"Year\",\"series\":[{\"type\":\"column\",\"data\":[800,900,1000],\"axisYTitle\":\"Revenue\"},{\"type\":\"line\",\"data\":[15,18,20],\"axisYTitle\":\"Profit Margin (%)\"}]}", + "reference": [ + "[WIP]双轴图 - DualAxes Chart 使用示例", + "饼图 - Pie Chart 使用示例", + "折线图 - Line Chart 使用示例" + ] + }, + { + "type": "data2chart", + "question": "用组合图展示过去三年的网站访问量和转化率 [{ \"month\": \"Apr\", \"visits\": 10000, \"conversion_rate\": 2.5 }, { \"month\": \"May\", \"visits\": 12000, \"conversion_rate\": 3.0 }, { \"month\": \"Jun\", \"visits\": 15000, \"conversion_rate\": 3.5 }]", + "response": "{\"type\":\"dual-axes\",\"categories\":[\"Apr\",\"May\",\"Jun\"],\"title\":\"过去三年的网站访问量与转化率\",\"axisXTitle\":\"月份\",\"series\":[{\"type\":\"column\",\"data\":[10000,12000,15000],\"axisYTitle\":\"访问量\"},{\"type\":\"line\",\"data\":[2.5,3.0,3.5],\"axisYTitle\":\"转化率\"}]}", + "answer": "{\"type\":\"dual-axes\",\"categories\":[\"Apr\",\"May\",\"Jun\"],\"title\":\"Monthly Website Visits and Conversion Rate (Q2)\",\"axisXTitle\":\"Month\",\"series\":[{\"type\":\"column\",\"data\":[10000,12000,15000],\"axisYTitle\":\"Visits\"},{\"type\":\"line\",\"data\":[2.5,3,3.5],\"axisYTitle\":\"Conversion Rate (%)\"}]}", + "reference": [ + "[WIP]双轴图 - DualAxes Chart 使用示例", + "折线图 - Line Chart 使用示例", + "面积图 - Area Chart 使用示例" + ] + }, + { + "type": "data2chart", + "question": "用组合图表示不同地区的销售额和市场份额 [{ \"region\": \"North\", \"sales\": 5000, \"market_share\": 20 }, { \"region\": \"South\", \"sales\": 7000, \"market_share\": 25 }, { \"region\": \"East\", \"sales\": 6000, \"market_share\": 22 }]", + "response": "{\"type\":\"dual-axes\",\"categories\":[\"North\",\"South\",\"East\"],\"title\":\"不同地区的销售额与市场份额\",\"axisXTitle\":\"地区\",\"series\":[{\"type\":\"column\",\"data\":[5000,7000,6000],\"axisYTitle\":\"销售额\"},{\"type\":\"line\",\"data\":[20,25,22],\"axisYTitle\":\"市场份额\"}]}", + "answer": "{\"type\":\"dual-axes\",\"categories\":[\"North\",\"South\",\"East\"],\"title\":\"Regional Sales and Market Share\",\"axisXTitle\":\"Region\",\"series\":[{\"type\":\"column\",\"data\":[5000,7000,6000],\"axisYTitle\":\"Sales\"},{\"type\":\"line\",\"data\":[20,25,22],\"axisYTitle\":\"Market Share (%)\"}]}", + "reference": [ + "[WIP]双轴图 - DualAxes Chart 使用示例", + "矩阵树图 -Treemap Chart 使用示例", + "条形图 - Bar Chart 使用示例" + ] + }, + { + "type": "data2chart", + "question": "用组合图可视化过去50天的股票价格和交易量 [{\"day\":1,\"price\":100,\"volume\":10000},{\"day\":2,\"price\":102,\"volume\":12000},{\"day\":3,\"price\":101,\"volume\":11000},{\"day\":4,\"price\":103,\"volume\":13000},{\"day\":5,\"price\":104,\"volume\":14000},{\"day\":6,\"price\":105,\"volume\":15000},{\"day\":7,\"price\":106,\"volume\":16000},{\"day\":8,\"price\":107,\"volume\":17000},{\"day\":9,\"price\":108,\"volume\":18000},{\"day\":10,\"price\":109,\"volume\":19000},{\"day\":11,\"price\":110,\"volume\":20000},{\"day\":12,\"price\":111,\"volume\":21000},{\"day\":13,\"price\":112,\"volume\":22000},{\"day\":14,\"price\":113,\"volume\":23000},{\"day\":15,\"price\":114,\"volume\":24000},{\"day\":16,\"price\":115,\"volume\":25000},{\"day\":17,\"price\":116,\"volume\":26000},{\"day\":18,\"price\":117,\"volume\":27000},{\"day\":19,\"price\":118,\"volume\":28000},{\"day\":20,\"price\":119,\"volume\":29000},{\"day\":21,\"price\":120,\"volume\":30000},{\"day\":22,\"price\":121,\"volume\":31000},{\"day\":23,\"price\":122,\"volume\":32000},{\"day\":24,\"price\":123,\"volume\":33000},{\"day\":25,\"price\":124,\"volume\":34000},{\"day\":26,\"price\":125,\"volume\":35000},{\"day\":27,\"price\":126,\"volume\":36000},{\"day\":28,\"price\":127,\"volume\":37000},{\"day\":29,\"price\":128,\"volume\":38000},{\"day\":30,\"price\":129,\"volume\":39000},{\"day\":31,\"price\":130,\"volume\":40000},{\"day\":32,\"price\":131,\"volume\":41000},{\"day\":33,\"price\":132,\"volume\":42000},{\"day\":34,\"price\":133,\"volume\":43000},{\"day\":35,\"price\":134,\"volume\":44000},{\"day\":36,\"price\":135,\"volume\":45000},{\"day\":37,\"price\":136,\"volume\":46000},{\"day\":38,\"price\":137,\"volume\":47000},{\"day\":39,\"price\":138,\"volume\":48000},{\"day\":40,\"price\":139,\"volume\":49000},{\"day\":41,\"price\":140,\"volume\":50000},{\"day\":42,\"price\":141,\"volume\":51000},{\"day\":43,\"price\":142,\"volume\":52000},{\"day\":44,\"price\":143,\"volume\":53000},{\"day\":45,\"price\":144,\"volume\":54000},{\"day\":46,\"price\":145,\"volume\":55000},{\"day\":47,\"price\":146,\"volume\":56000},{\"day\":48,\"price\":147,\"volume\":57000},{\"day\":49,\"price\":148,\"volume\":58000},{\"day\":50,\"price\":149,\"volume\":59000}]", + "response": "{\"type\":\"combo\",\"data\":[{\"day\":1,\"price\":100,\"volume\":10000},{\"day\":2,\"price\":102,\"volume\":12000},{\"day\":3,\"price\":101,\"volume\":11000},{\"day\":4,\"price\":103,\"volume\":13000},{\"day\":5,\"price\":104,\"volume\":14000},{\"day\":6,\"price\":105,\"volume\":15000},{\"day\":7,\"price\":106,\"volume\":16000},{\"day\":8,\"price\":107,\"volume\":17000},{\"day\":9,\"price\":108,\"volume\":18000},{\"day\":10,\"price\":109,\"volume\":19000},{\"day\":11,\"price\":110,\"volume\":20000},{\"day\":12,\"price\":111,\"volume\":21000},{\"day\":13,\"price\":112,\"volume\":22000},{\"day\":14,\"price\":113,\"volume\":23000},{\"day\":15,\"price\":114,\"volume\":24000},{\"day\":16,\"price\":115,\"volume\":25000},{\"day\":17,\"price\":116,\"volume\":26000},{\"day\":18,\"price\":117,\"volume\":27000},{\"day\":19,\"price\":118,\"volume\":28000},{\"day\":20,\"price\":119,\"volume\":29000},{\"day\":21,\"price\":120,\"volume\":30000},{\"day\":22,\"price\":121,\"volume\":31000},{\"day\":23,\"price\":122,\"volume\":32000},{\"day\":24,\"price\":123,\"volume\":33000},{\"day\":25,\"price\":124,\"volume\":34000},{\"day\":26,\"price\":125,\"volume\":35000},{\"day\":27,\"price\":126,\"volume\":36000},{\"day\":28,\"price\":127,\"volume\":37000},{\"day\":29,\"price\":128,\"volume\":38000},{\"day\":30,\"price\":129,\"volume\":39000},{\"day\":31,\"price\":130,\"volume\":40000},{\"day\":32,\"price\":131,\"volume\":41000},{\"day\":33,\"price\":132,\"volume\":42000},{\"day\":34,\"price\":133,\"volume\":43000},{\"day\":35,\"price\":134,\"volume\":44000},{\"day\":36,\"price\":135,\"volume\":45000},{\"day\":37,\"price\":136,\"volume\":46000},{\"day\":38,\"price\":137,\"volume\":47000},{\"day\":39,\"price\":138,\"volume\":48000},{\"day\":40,\"price\":139,\"volume\":49000},{\"day\":41,\"price\":140,\"volume\":50000},{\"day\":42,\"price\":141,\"volume\":51000},{\"day\":43,\"price\":142,\"volume\":52000},{\"day\":44,\"price\":143,\"volume\":53000},{\"day\":45,\"price\":144,\"volume\":54000},{\"day\":46,\"price\":145,\"volume\":55000},{\"day\":47,\"price\":146,\"volume\":56000},{\"day\":48,\"price\":147,\"volume\":57000},{\"day\":49,\"price\":148,\"volume\":58000},{\"day\":50,\"price\":149,\"volume\":59000}],\"title\": \"股票价格与交易量变化\",\"axisXTitle\": \"天数\",\"axisYTitle\": [\"股票价格\",\"交易量\"],\"series\": [{\"name\": \"股票价格\",\"type\": \"line\"},{\"name\": \"交易量\",\"type\": \"bar\"}]}", + "answer": "{\"type\":\"dual-axes\",\"categories\":[\"Day 1\",\"Day 2\",\"Day 3\",\"Day 4\",\"Day 5\",\"Day 6\",\"Day 7\",\"Day 8\",\"Day 9\",\"Day 10\",\"Day 11\",\"Day 12\",\"Day 13\",\"Day 14\",\"Day 15\",\"Day 16\",\"Day 17\",\"Day 18\",\"Day 19\",\"Day 20\",\"Day 21\",\"Day 22\",\"Day 23\",\"Day 24\",\"Day 25\",\"Day 26\",\"Day 27\",\"Day 28\",\"Day 29\",\"Day 30\",\"Day 31\",\"Day 32\",\"Day 33\",\"Day 34\",\"Day 35\",\"Day 36\",\"Day 37\",\"Day 38\",\"Day 39\",\"Day 40\",\"Day 41\",\"Day 42\",\"Day 43\",\"Day 44\",\"Day 45\",\"Day 46\",\"Day 47\",\"Day 48\",\"Day 49\",\"Day 50\"],\"title\":\"Stock Price and Trading Volume Over 50 Days\",\"axisXTitle\":\"Day\",\"series\":[{\"type\":\"line\",\"data\":[100,102,101,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149],\"axisYTitle\":\"Stock Price\"},{\"type\":\"column\",\"data\":[10000,12000,11000,13000,14000,15000,16000,17000,18000,19000,20000,21000,22000,23000,24000,25000,26000,27000,28000,29000,30000,31000,32000,33000,34000,35000,36000,37000,38000,39000,40000,41000,42000,43000,44000,45000,46000,47000,48000,49000,50000,51000,52000,53000,54000,55000,56000,57000,58000,59000],\"axisYTitle\":\"Trading Volume\"}]}", + "reference": [] + } +] diff --git a/evaluations/datastes/chart/dual-axes/metrics.json b/evaluations/datastes/chart/dual-axes/metrics.json new file mode 100644 index 0000000..adf4a17 --- /dev/null +++ b/evaluations/datastes/chart/dual-axes/metrics.json @@ -0,0 +1,164 @@ +[ + { + "type": "text2chart", + "question": "用双轴图展示某公司的年收入与员工满意度,2017年至2021年的收入分别为85.4亿、93.2亿、100.1亿、108.6亿、115.5亿,员工满意度(满分10分)分别为7.2、7.5、7.8、8.0、8.2。", + "response": "{\"type\":\"dual-axes\",\"categories\":[\"2017\",\"2018\",\"2019\",\"2020\",\"2021\"],\"title\":\"2017-2021年收入与员工满意度\",\"axisXTitle\":\"年份\",\"series\":[{\"type\":\"column\",\"data\":[85.4,93.2,100.1,108.6,115.5],\"axisYTitle\":\"收入(亿)\"},{\"type\":\"line\",\"data\":[7.2,7.5,7.8,8,8.2],\"axisYTitle\":\"员工满意度\"}]}", + "answer": "{\"type\":\"dual-axes\",\"categories\":[\"2017\",\"2018\",\"2019\",\"2020\",\"2021\"],\"title\":\"2017-2021年收入与员工满意度\",\"axisXTitle\":\"年份\",\"series\":[{\"type\":\"column\",\"data\":[85.4,93.2,100.1,108.6,115.5],\"axisYTitle\":\"年收入 (亿)\"},{\"type\":\"line\",\"data\":[7.2,7.5,7.8,8,8.2],\"axisYTitle\":\"员工满意度\"}]}", + "reference": [ + "[WIP]双轴图 - DualAxes Chart 使用示例", + "柱形图 - Column Chart 使用示例", + "条形图 - Bar Chart 使用示例" + ], + "correctness": 1 + }, + { + "type": "text2chart", + "question": "用双轴图来表示一个城市的年度平均气温和降水量。从2016到2020年,平均气温分别是15°C、16°C、17°C、18°C、19°C;同期的年降水量为800mm、850mm、900mm、950mm、1000mm。", + "response": "{\"type\":\"dual-axes\",\"categories\":[\"2016\",\"2017\",\"2018\",\"2019\",\"2020\"],\"title\":\"2016-2020年平均气温与降水量\",\"axisXTitle\":\"年份\",\"series\":[{\"type\":\"line\",\"data\":[15,16,17,18,19],\"axisYTitle\":\"平均气温(°C)\"},{\"type\":\"column\",\"data\":[800,850,900,950,1000],\"axisYTitle\":\"年降水量(mm)\"}]}", + "answer": "{\"type\":\"dual-axes\",\"categories\":[\"2016\",\"2017\",\"2018\",\"2019\",\"2020\"],\"title\":\"2016-2020年城市气候数据\",\"axisXTitle\":\"年份\",\"series\":[{\"type\":\"line\",\"data\":[15,16,17,18,19],\"axisYTitle\":\"平均气温 (°C)\"},{\"type\":\"column\",\"data\":[800,850,900,950,1000],\"axisYTitle\":\"降水量 (mm)\"}]}", + "reference": [ + "[WIP]双轴图 - DualAxes Chart 基础概念", + "热力地图 - HeatMap 使用示例" + ], + "correctness": 1 + }, + { + "type": "text2chart", + "question": "利用双轴图展示一家电商平台的商品销量和退货率。在2019至2023年间,商品销量依次是120万件、130万件、140万件、150万件、160万件;相应的退货率则为2%、2.5%、3%、3.5%、4%。", + "response": "{\"type\":\"dual-axes\",\"categories\":[\"2019\",\"2020\",\"2021\",\"2022\",\"2023\"],\"title\":\"2019-2023年商品销量与退货率\",\"axisXTitle\":\"年份\",\"series\":[{\"type\":\"column\",\"data\":[120,130,140,150,160],\"axisYTitle\":\"商品销量(万件)\"},{\"type\":\"line\",\"data\":[0.02,0.025,0.03,0.035,0.04],\"axisYTitle\":\"退货率\"}]}", + "answer": "{\"type\":\"dual-axes\",\"categories\":[\"2019\",\"2020\",\"2021\",\"2022\",\"2023\"],\"title\":\"2019-2023电商平台销量及退货情况\",\"axisXTitle\":\"年份\",\"series\":[{\"type\":\"column\",\"data\":[120,130,140,150,160],\"axisYTitle\":\"销量 (万件)\"},{\"type\":\"line\",\"data\":[0.02,0.025,0.03,0.035,0.04],\"axisYTitle\":\"退货率 (%)\"}]}", + "reference": [ + "[WIP]双轴图 - DualAxes Chart 基础概念", + "折线图 - Line Chart 使用示例", + "条形图 - Bar Chart 使用示例" + ], + "correctness": 1 + }, + { + "type": "text2chart", + "question": "通过双轴图呈现某地区每年的人口增长数量以及经济增长率。2015年至2019年间,人口增量分别是12万、14万、16万、18万、20万;同期GDP增长率分别为3.5%、4.0%、4.5%、5.0%、5.5%。", + "response": "{\"type\":\"dual-axes\",\"categories\":[\"2015\",\"2016\",\"2017\",\"2018\",\"2019\"],\"title\":\"人口增长与经济增长率\",\"axisXTitle\":\"年份\",\"series\":[{\"type\":\"column\",\"data\":[12,14,16,18,20],\"axisYTitle\":\"人口增量(万)\"},{\"type\":\"line\",\"data\":[3.5,4.0,4.5,5.0,5.5],\"axisYTitle\":\"GDP增长率\"}]}", + "answer": "{\"type\":\"dual-axes\",\"categories\":[\"2015\",\"2016\",\"2017\",\"2018\",\"2019\"],\"title\":\"2015-2019人口增长与经济增长\",\"axisXTitle\":\"年份\",\"series\":[{\"type\":\"column\",\"data\":[12,14,16,18,20],\"axisYTitle\":\"人口增长 (万人)\"},{\"type\":\"line\",\"data\":[0.035,0.04,0.045,0.05,0.055],\"axisYTitle\":\"GDP增长率 (%)\"}]}", + "reference": [ + "[WIP]双轴图 - DualAxes Chart 基础概念", + "饼图 - Pie Chart 使用示例", + "折线图 - Line Chart 使用示例" + ], + "correctness": 1 + }, + { + "type": "text2chart", + "question": "采用双轴图形式描绘一国能源消费总量及其可再生能源占比的变化趋势。从2013到2017年,该国总能源消费量分别为50亿吨标准煤、52亿吨标准煤、54亿吨标准煤、56亿吨标准煤、58亿吨标准煤;可再生能源比例依次为10%、12%、14%、16%、18%。", + "response": "{\"type\":\"dual-axes\",\"categories\":[\"2013\",\"2014\",\"2015\",\"2016\",\"2017\"],\"title\":\"2013-2017年能源消费总量与可再生能源占比\",\"axisXTitle\":\"年份\",\"series\":[{\"type\":\"column\",\"data\":[50,52,54,56,58],\"axisYTitle\":\"能源消费总量(亿吨标准煤)\"},{\"type\":\"line\",\"data\":[10,12,14,16,18],\"axisYTitle\":\"可再生能源占比(%)\"}]}", + "answer": "{\"type\":\"dual-axes\",\"categories\":[\"2013\",\"2014\",\"2015\",\"2016\",\"2017\"],\"title\":\"2013-2017能源消费与可再生能源占比\",\"axisXTitle\":\"年份\",\"series\":[{\"type\":\"column\",\"data\":[50,52,54,56,58],\"axisYTitle\":\"能源消费 (亿吨标准煤)\"},{\"type\":\"line\",\"data\":[0.1,0.12,0.14,0.16,0.18],\"axisYTitle\":\"可再生能源占比 (%)\"}]}", + "reference": [ + "[WIP]双轴图 - DualAxes Chart 基础概念", + "柱形图 - Column Chart 使用示例", + "条形图 - Bar Chart 使用示例" + ], + "correctness": 1 + }, + { + "type": "data2chart", + "question": "用双轴图可视化我的数据 [{ \"year\": 2019, \"sales\": 300, \"profit_margin\": 20 }, { \"year\": 2020, \"sales\": 400, \"profit_margin\": 22 }, { \"year\": 2021, \"sales\": 500, \"profit_margin\": 25 }]", + "response": "{\"type\":\"dual-axes\",\"categories\":[\"2019\",\"2020\",\"2021\"],\"title\":\"2019-2021 Sales and Profit Margin\",\"axisXTitle\":\"Year\",\"series\":[{\"type\":\"column\",\"data\":[300,400,500],\"axisYTitle\":\"Sales\"},{\"type\":\"line\",\"data\":[20,22,25],\"axisYTitle\":\"Profit Margin\"}]}", + "answer": "{\"type\":\"dual-axes\",\"categories\":[\"2019\",\"2020\",\"2021\"],\"title\":\"2019-2021 Sales and Profit Margin\",\"axisXTitle\":\"Year\",\"series\":[{\"type\":\"column\",\"data\":[300,400,500],\"axisYTitle\":\"Sales\"},{\"type\":\"line\",\"data\":[20,22,25],\"axisYTitle\":\"Profit Margin (%)\"}]}", + "reference": [ + "[WIP]双轴图 - DualAxes Chart 使用示例", + "折线图 - Line Chart 使用示例", + "条形图 - Bar Chart 使用示例" + ], + "correctness": 1 + }, + { + "type": "data2chart", + "question": "用双轴图展示过去三年的气温和降水量数据 [{ \"month\": \"Jan\", \"temperature\": 5, \"rainfall\": 50 }, { \"month\": \"Feb\", \"temperature\": 7, \"rainfall\": 60 }, { \"month\": \"Mar\", \"temperature\": 10, \"rainfall\": 80 }]", + "response": "{\"type\":\"dual-axes\",\"categories\":[\"Jan\",\"Feb\",\"Mar\"],\"title\":\"过去三年的气温和降水量\",\"axisXTitle\":\"月份\",\"series\":[{\"type\":\"line\",\"data\":[5,7,10],\"axisYTitle\":\"气温\"},{\"type\":\"column\",\"data\":[50,60,80],\"axisYTitle\":\"降水量\"}]}", + "answer": "{\"type\":\"dual-axes\",\"categories\":[\"Jan\",\"Feb\",\"Mar\"],\"title\":\"Monthly Temperature and Rainfall (Q1)\",\"axisXTitle\":\"Month\",\"series\":[{\"type\":\"line\",\"data\":[5,7,10],\"axisYTitle\":\"Temperature (°C)\"},{\"type\":\"column\",\"data\":[50,60,80],\"axisYTitle\":\"Rainfall (mm)\"}]}", + "reference": [ + "[WIP]双轴图 - DualAxes Chart 基础概念", + "热力地图 - HeatMap 使用示例" + ], + "correctness": 1 + }, + { + "type": "data2chart", + "question": "用双轴图显示用户增长与活跃度 [{ \"quarter\": \"Q1\", \"user_growth\": 500, \"activity_rate\": 60 }, { \"quarter\": \"Q2\", \"user_growth\": 700, \"activity_rate\": 65 }, { \"quarter\": \"Q3\", \"user_growth\": 900, \"activity_rate\": 70 }]", + "response": "{\n \"type\": \"dual-axes\",\n \"categories\": [\"Q1\", \"Q2\", \"Q3\"],\n \"title\": \"用户增长与活跃度\",\n \"axisXTitle\": \"季度\",\n \"series\": [\n {\n \"type\": \"column\",\n \"data\": [500, 700, 900],\n \"axisYTitle\": \"用户增长\"\n },\n {\n \"type\": \"line\",\n \"data\": [60, 65, 70],\n \"axisYTitle\": \"活跃度\"\n }\n ]\n}", + "answer": "{\"type\":\"dual-axes\",\"categories\":[\"Q1\",\"Q2\",\"Q3\"],\"title\":\"User Growth and Activity Rate by Quarter\",\"axisXTitle\":\"Quarter\",\"series\":[{\"type\":\"column\",\"data\":[500,700,900],\"axisYTitle\":\"User Growth\"},{\"type\":\"line\",\"data\":[60,65,70],\"axisYTitle\":\"Activity Rate (%)\"}]}", + "reference": [ + "[WIP]双轴图 - DualAxes Chart 基础概念", + "折线图 - Line Chart 使用示例", + "热力地图 - HeatMap 使用示例" + ], + "correctness": 1 + }, + { + "type": "data2chart", + "question": "用双轴图表示产品销售量与退货率 [{ \"product\": \"A\", \"sales_volume\": 200, \"return_rate\": 5 }, { \"product\": \"B\", \"sales_volume\": 300, \"return_rate\": 7 }, { \"product\": \"C\", \"sales_volume\": 400, \"return_rate\": 9 }]", + "response": "{\"type\":\"dual-axes\",\"categories\":[\"A\",\"B\",\"C\"],\"title\":\"产品销售量与退货率\",\"axisXTitle\":\"产品\",\"series\":[{\"type\":\"column\",\"data\":[200,300,400],\"axisYTitle\":\"销售量\"},{\"type\":\"line\",\"data\":[5,7,9],\"axisYTitle\":\"退货率\"}]}", + "answer": "{\"type\":\"dual-axes\",\"categories\":[\"A\",\"B\",\"C\"],\"title\":\"Product Sales Volume and Return Rate\",\"axisXTitle\":\"Product\",\"series\":[{\"type\":\"column\",\"data\":[200,300,400],\"axisYTitle\":\"Sales Volume\"},{\"type\":\"line\",\"data\":[5,7,9],\"axisYTitle\":\"Return Rate (%)\"}]}", + "reference": [ + "[WIP]双轴图 - DualAxes Chart 基础概念", + "矩阵树图 -Treemap Chart 使用示例", + "折线图 - Line Chart 使用示例" + ], + "correctness": 1 + }, + { + "type": "data2chart", + "question": "用双轴图绘制公司收入与支出情况 [{ \"year\": 2018, \"income\": 1000, \"expenses\": 800 }, { \"year\": 2019, \"income\": 1200, \"expenses\": 900 }, { \"year\": 2020, \"income\": 1500, \"expenses\": 1000 }]", + "response": "{\"type\":\"dual-axes\",\"categories\":[\"2018\",\"2019\",\"2020\"],\"title\":\"2018-2020 Income and Expenses\",\"axisXTitle\":\"Year\",\"series\":[{\"type\":\"column\",\"data\":[1000,1200,1500],\"axisYTitle\":\"Income\"},{\"type\":\"line\",\"data\":[800,900,1000],\"axisYTitle\":\"Expenses\"}]}", + "answer": "{\"type\":\"dual-axes\",\"categories\":[\"2018\",\"2019\",\"2020\"],\"title\":\"Annual Income and Expenses\",\"axisXTitle\":\"Year\",\"series\":[{\"type\":\"column\",\"data\":[1000,1200,1500],\"axisYTitle\":\"Income\"},{\"type\":\"line\",\"data\":[800,900,1000],\"axisYTitle\":\"Expenses\"}]}", + "reference": [ + "[WIP]双轴图 - DualAxes Chart 使用示例", + "散点图 - Scatter Chart 使用示例", + "折线图 - Line Chart 使用示例" + ], + "correctness": 1 + }, + { + "type": "data2chart", + "question": "用组合图可视化我的数据 [{ \"year\": 2017, \"revenue\": 800, \"profit_margin\": 15 }, { \"year\": 2018, \"revenue\": 900, \"profit_margin\": 18 }, { \"year\": 2019, \"revenue\": 1000, \"profit_margin\": 20 }]", + "response": "{\"type\":\"dual-axes\",\"categories\":[\"2017\",\"2018\",\"2019\"],\"title\":\"2017-2019 Revenue and Profit Margin\",\"axisXTitle\":\"Year\",\"series\":[{\"type\":\"column\",\"data\":[800,900,1000],\"axisYTitle\":\"Revenue\"},{\"type\":\"line\",\"data\":[15,18,20],\"axisYTitle\":\"Profit Margin\"}]}", + "answer": "{\"type\":\"dual-axes\",\"categories\":[\"2017\",\"2018\",\"2019\"],\"title\":\"2017-2019 Revenue and Profit Margin\",\"axisXTitle\":\"Year\",\"series\":[{\"type\":\"column\",\"data\":[800,900,1000],\"axisYTitle\":\"Revenue\"},{\"type\":\"line\",\"data\":[15,18,20],\"axisYTitle\":\"Profit Margin (%)\"}]}", + "reference": [ + "[WIP]双轴图 - DualAxes Chart 使用示例", + "饼图 - Pie Chart 使用示例", + "折线图 - Line Chart 使用示例" + ], + "correctness": 1 + }, + { + "type": "data2chart", + "question": "用组合图展示过去三年的网站访问量和转化率 [{ \"month\": \"Apr\", \"visits\": 10000, \"conversion_rate\": 2.5 }, { \"month\": \"May\", \"visits\": 12000, \"conversion_rate\": 3.0 }, { \"month\": \"Jun\", \"visits\": 15000, \"conversion_rate\": 3.5 }]", + "response": "{\"type\":\"dual-axes\",\"categories\":[\"Apr\",\"May\",\"Jun\"],\"title\":\"过去三年的网站访问量与转化率\",\"axisXTitle\":\"月份\",\"series\":[{\"type\":\"column\",\"data\":[10000,12000,15000],\"axisYTitle\":\"访问量\"},{\"type\":\"line\",\"data\":[2.5,3.0,3.5],\"axisYTitle\":\"转化率\"}]}", + "answer": "{\"type\":\"dual-axes\",\"categories\":[\"Apr\",\"May\",\"Jun\"],\"title\":\"Monthly Website Visits and Conversion Rate (Q2)\",\"axisXTitle\":\"Month\",\"series\":[{\"type\":\"column\",\"data\":[10000,12000,15000],\"axisYTitle\":\"Visits\"},{\"type\":\"line\",\"data\":[2.5,3,3.5],\"axisYTitle\":\"Conversion Rate (%)\"}]}", + "reference": [ + "[WIP]双轴图 - DualAxes Chart 使用示例", + "折线图 - Line Chart 使用示例", + "面积图 - Area Chart 使用示例" + ], + "correctness": 1 + }, + { + "type": "data2chart", + "question": "用组合图表示不同地区的销售额和市场份额 [{ \"region\": \"North\", \"sales\": 5000, \"market_share\": 20 }, { \"region\": \"South\", \"sales\": 7000, \"market_share\": 25 }, { \"region\": \"East\", \"sales\": 6000, \"market_share\": 22 }]", + "response": "{\"type\":\"dual-axes\",\"categories\":[\"North\",\"South\",\"East\"],\"title\":\"不同地区的销售额与市场份额\",\"axisXTitle\":\"地区\",\"series\":[{\"type\":\"column\",\"data\":[5000,7000,6000],\"axisYTitle\":\"销售额\"},{\"type\":\"line\",\"data\":[20,25,22],\"axisYTitle\":\"市场份额\"}]}", + "answer": "{\"type\":\"dual-axes\",\"categories\":[\"North\",\"South\",\"East\"],\"title\":\"Regional Sales and Market Share\",\"axisXTitle\":\"Region\",\"series\":[{\"type\":\"column\",\"data\":[5000,7000,6000],\"axisYTitle\":\"Sales\"},{\"type\":\"line\",\"data\":[20,25,22],\"axisYTitle\":\"Market Share (%)\"}]}", + "reference": [ + "[WIP]双轴图 - DualAxes Chart 使用示例", + "矩阵树图 -Treemap Chart 使用示例", + "条形图 - Bar Chart 使用示例" + ], + "correctness": 1 + }, + { + "type": "data2chart", + "question": "用组合图可视化过去50天的股票价格和交易量 [{\"day\":1,\"price\":100,\"volume\":10000},{\"day\":2,\"price\":102,\"volume\":12000},{\"day\":3,\"price\":101,\"volume\":11000},{\"day\":4,\"price\":103,\"volume\":13000},{\"day\":5,\"price\":104,\"volume\":14000},{\"day\":6,\"price\":105,\"volume\":15000},{\"day\":7,\"price\":106,\"volume\":16000},{\"day\":8,\"price\":107,\"volume\":17000},{\"day\":9,\"price\":108,\"volume\":18000},{\"day\":10,\"price\":109,\"volume\":19000},{\"day\":11,\"price\":110,\"volume\":20000},{\"day\":12,\"price\":111,\"volume\":21000},{\"day\":13,\"price\":112,\"volume\":22000},{\"day\":14,\"price\":113,\"volume\":23000},{\"day\":15,\"price\":114,\"volume\":24000},{\"day\":16,\"price\":115,\"volume\":25000},{\"day\":17,\"price\":116,\"volume\":26000},{\"day\":18,\"price\":117,\"volume\":27000},{\"day\":19,\"price\":118,\"volume\":28000},{\"day\":20,\"price\":119,\"volume\":29000},{\"day\":21,\"price\":120,\"volume\":30000},{\"day\":22,\"price\":121,\"volume\":31000},{\"day\":23,\"price\":122,\"volume\":32000},{\"day\":24,\"price\":123,\"volume\":33000},{\"day\":25,\"price\":124,\"volume\":34000},{\"day\":26,\"price\":125,\"volume\":35000},{\"day\":27,\"price\":126,\"volume\":36000},{\"day\":28,\"price\":127,\"volume\":37000},{\"day\":29,\"price\":128,\"volume\":38000},{\"day\":30,\"price\":129,\"volume\":39000},{\"day\":31,\"price\":130,\"volume\":40000},{\"day\":32,\"price\":131,\"volume\":41000},{\"day\":33,\"price\":132,\"volume\":42000},{\"day\":34,\"price\":133,\"volume\":43000},{\"day\":35,\"price\":134,\"volume\":44000},{\"day\":36,\"price\":135,\"volume\":45000},{\"day\":37,\"price\":136,\"volume\":46000},{\"day\":38,\"price\":137,\"volume\":47000},{\"day\":39,\"price\":138,\"volume\":48000},{\"day\":40,\"price\":139,\"volume\":49000},{\"day\":41,\"price\":140,\"volume\":50000},{\"day\":42,\"price\":141,\"volume\":51000},{\"day\":43,\"price\":142,\"volume\":52000},{\"day\":44,\"price\":143,\"volume\":53000},{\"day\":45,\"price\":144,\"volume\":54000},{\"day\":46,\"price\":145,\"volume\":55000},{\"day\":47,\"price\":146,\"volume\":56000},{\"day\":48,\"price\":147,\"volume\":57000},{\"day\":49,\"price\":148,\"volume\":58000},{\"day\":50,\"price\":149,\"volume\":59000}]", + "response": "{\"type\":\"combo\",\"data\":[{\"day\":1,\"price\":100,\"volume\":10000},{\"day\":2,\"price\":102,\"volume\":12000},{\"day\":3,\"price\":101,\"volume\":11000},{\"day\":4,\"price\":103,\"volume\":13000},{\"day\":5,\"price\":104,\"volume\":14000},{\"day\":6,\"price\":105,\"volume\":15000},{\"day\":7,\"price\":106,\"volume\":16000},{\"day\":8,\"price\":107,\"volume\":17000},{\"day\":9,\"price\":108,\"volume\":18000},{\"day\":10,\"price\":109,\"volume\":19000},{\"day\":11,\"price\":110,\"volume\":20000},{\"day\":12,\"price\":111,\"volume\":21000},{\"day\":13,\"price\":112,\"volume\":22000},{\"day\":14,\"price\":113,\"volume\":23000},{\"day\":15,\"price\":114,\"volume\":24000},{\"day\":16,\"price\":115,\"volume\":25000},{\"day\":17,\"price\":116,\"volume\":26000},{\"day\":18,\"price\":117,\"volume\":27000},{\"day\":19,\"price\":118,\"volume\":28000},{\"day\":20,\"price\":119,\"volume\":29000},{\"day\":21,\"price\":120,\"volume\":30000},{\"day\":22,\"price\":121,\"volume\":31000},{\"day\":23,\"price\":122,\"volume\":32000},{\"day\":24,\"price\":123,\"volume\":33000},{\"day\":25,\"price\":124,\"volume\":34000},{\"day\":26,\"price\":125,\"volume\":35000},{\"day\":27,\"price\":126,\"volume\":36000},{\"day\":28,\"price\":127,\"volume\":37000},{\"day\":29,\"price\":128,\"volume\":38000},{\"day\":30,\"price\":129,\"volume\":39000},{\"day\":31,\"price\":130,\"volume\":40000},{\"day\":32,\"price\":131,\"volume\":41000},{\"day\":33,\"price\":132,\"volume\":42000},{\"day\":34,\"price\":133,\"volume\":43000},{\"day\":35,\"price\":134,\"volume\":44000},{\"day\":36,\"price\":135,\"volume\":45000},{\"day\":37,\"price\":136,\"volume\":46000},{\"day\":38,\"price\":137,\"volume\":47000},{\"day\":39,\"price\":138,\"volume\":48000},{\"day\":40,\"price\":139,\"volume\":49000},{\"day\":41,\"price\":140,\"volume\":50000},{\"day\":42,\"price\":141,\"volume\":51000},{\"day\":43,\"price\":142,\"volume\":52000},{\"day\":44,\"price\":143,\"volume\":53000},{\"day\":45,\"price\":144,\"volume\":54000},{\"day\":46,\"price\":145,\"volume\":55000},{\"day\":47,\"price\":146,\"volume\":56000},{\"day\":48,\"price\":147,\"volume\":57000},{\"day\":49,\"price\":148,\"volume\":58000},{\"day\":50,\"price\":149,\"volume\":59000}],\"title\": \"股票价格与交易量变化\",\"axisXTitle\": \"天数\",\"axisYTitle\": [\"股票价格\",\"交易量\"],\"series\": [{\"name\": \"股票价格\",\"type\": \"line\"},{\"name\": \"交易量\",\"type\": \"bar\"}]}", + "answer": "{\"type\":\"dual-axes\",\"categories\":[\"Day 1\",\"Day 2\",\"Day 3\",\"Day 4\",\"Day 5\",\"Day 6\",\"Day 7\",\"Day 8\",\"Day 9\",\"Day 10\",\"Day 11\",\"Day 12\",\"Day 13\",\"Day 14\",\"Day 15\",\"Day 16\",\"Day 17\",\"Day 18\",\"Day 19\",\"Day 20\",\"Day 21\",\"Day 22\",\"Day 23\",\"Day 24\",\"Day 25\",\"Day 26\",\"Day 27\",\"Day 28\",\"Day 29\",\"Day 30\",\"Day 31\",\"Day 32\",\"Day 33\",\"Day 34\",\"Day 35\",\"Day 36\",\"Day 37\",\"Day 38\",\"Day 39\",\"Day 40\",\"Day 41\",\"Day 42\",\"Day 43\",\"Day 44\",\"Day 45\",\"Day 46\",\"Day 47\",\"Day 48\",\"Day 49\",\"Day 50\"],\"title\":\"Stock Price and Trading Volume Over 50 Days\",\"axisXTitle\":\"Day\",\"series\":[{\"type\":\"line\",\"data\":[100,102,101,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149],\"axisYTitle\":\"Stock Price\"},{\"type\":\"column\",\"data\":[10000,12000,11000,13000,14000,15000,16000,17000,18000,19000,20000,21000,22000,23000,24000,25000,26000,27000,28000,29000,30000,31000,32000,33000,34000,35000,36000,37000,38000,39000,40000,41000,42000,43000,44000,45000,46000,47000,48000,49000,50000,51000,52000,53000,54000,55000,56000,57000,58000,59000],\"axisYTitle\":\"Trading Volume\"}]}", + "reference": [], + "correctness": 0 + } +] diff --git a/evaluations/datastes/chart/dual-axes/test.json b/evaluations/datastes/chart/dual-axes/test.json new file mode 100644 index 0000000..d12e61e --- /dev/null +++ b/evaluations/datastes/chart/dual-axes/test.json @@ -0,0 +1,373 @@ +[ + { + "type": "text2chart", + "question": "用双轴图展示某公司的年收入与员工满意度,2017年至2021年的收入分别为85.4亿、93.2亿、100.1亿、108.6亿、115.5亿,员工满意度(满分10分)分别为7.2、7.5、7.8、8.0、8.2。", + "answer": { + "type": "dual-axes", + "categories": ["2017", "2018", "2019", "2020", "2021"], + "title": "2017-2021年收入与员工满意度", + "axisXTitle": "年份", + "series": [ + { + "type": "column", + "data": [85.4, 93.2, 100.1, 108.6, 115.5], + "axisYTitle": "年收入 (亿)" + }, + { + "type": "line", + "data": [7.2, 7.5, 7.8, 8.0, 8.2], + "axisYTitle": "员工满意度" + } + ] + } + }, + { + "type": "text2chart", + "question": "用双轴图来表示一个城市的年度平均气温和降水量。从2016到2020年,平均气温分别是15°C、16°C、17°C、18°C、19°C;同期的年降水量为800mm、850mm、900mm、950mm、1000mm。", + "answer": { + "type": "dual-axes", + "categories": ["2016", "2017", "2018", "2019", "2020"], + "title": "2016-2020年城市气候数据", + "axisXTitle": "年份", + "series": [ + { + "type": "line", + "data": [15, 16, 17, 18, 19], + "axisYTitle": "平均气温 (°C)" + }, + { + "type": "column", + "data": [800, 850, 900, 950, 1000], + "axisYTitle": "降水量 (mm)" + } + ] + } + }, + { + "type": "text2chart", + "question": "利用双轴图展示一家电商平台的商品销量和退货率。在2019至2023年间,商品销量依次是120万件、130万件、140万件、150万件、160万件;相应的退货率则为2%、2.5%、3%、3.5%、4%。", + "answer": { + "type": "dual-axes", + "categories": ["2019", "2020", "2021", "2022", "2023"], + "title": "2019-2023电商平台销量及退货情况", + "axisXTitle": "年份", + "series": [ + { + "type": "column", + "data": [120, 130, 140, 150, 160], + "axisYTitle": "销量 (万件)" + }, + { + "type": "line", + "data": [0.02, 0.025, 0.03, 0.035, 0.04], + "axisYTitle": "退货率 (%)" + } + ] + } + }, + { + "type": "text2chart", + "question": "通过双轴图呈现某地区每年的人口增长数量以及经济增长率。2015年至2019年间,人口增量分别是12万、14万、16万、18万、20万;同期GDP增长率分别为3.5%、4.0%、4.5%、5.0%、5.5%。", + "answer": { + "type": "dual-axes", + "categories": ["2015", "2016", "2017", "2018", "2019"], + "title": "2015-2019人口增长与经济增长", + "axisXTitle": "年份", + "series": [ + { + "type": "column", + "data": [12, 14, 16, 18, 20], + "axisYTitle": "人口增长 (万人)" + }, + { + "type": "line", + "data": [0.035, 0.04, 0.045, 0.05, 0.055], + "axisYTitle": "GDP增长率 (%)" + } + ] + } + }, + { + "type": "text2chart", + "question": "采用双轴图形式描绘一国能源消费总量及其可再生能源占比的变化趋势。从2013到2017年,该国总能源消费量分别为50亿吨标准煤、52亿吨标准煤、54亿吨标准煤、56亿吨标准煤、58亿吨标准煤;可再生能源比例依次为10%、12%、14%、16%、18%。", + "answer": { + "type": "dual-axes", + "categories": ["2013", "2014", "2015", "2016", "2017"], + "title": "2013-2017能源消费与可再生能源占比", + "axisXTitle": "年份", + "series": [ + { + "type": "column", + "data": [50, 52, 54, 56, 58], + "axisYTitle": "能源消费 (亿吨标准煤)" + }, + { + "type": "line", + "data": [0.1, 0.12, 0.14, 0.16, 0.18], + "axisYTitle": "可再生能源占比 (%)" + } + ] + } + }, + { + "type": "data2chart", + "question": "用双轴图可视化我的数据 [{ \"year\": 2019, \"sales\": 300, \"profit_margin\": 20 }, { \"year\": 2020, \"sales\": 400, \"profit_margin\": 22 }, { \"year\": 2021, \"sales\": 500, \"profit_margin\": 25 }]", + "answer": { + "type": "dual-axes", + "categories": ["2019", "2020", "2021"], + "title": "2019-2021 Sales and Profit Margin", + "axisXTitle": "Year", + "series": [ + { + "type": "column", + "data": [300, 400, 500], + "axisYTitle": "Sales" + }, + { + "type": "line", + "data": [20, 22, 25], + "axisYTitle": "Profit Margin (%)" + } + ] + } + }, + { + "type": "data2chart", + "question": "用双轴图展示过去三年的气温和降水量数据 [{ \"month\": \"Jan\", \"temperature\": 5, \"rainfall\": 50 }, { \"month\": \"Feb\", \"temperature\": 7, \"rainfall\": 60 }, { \"month\": \"Mar\", \"temperature\": 10, \"rainfall\": 80 }]", + "answer": { + "type": "dual-axes", + "categories": ["Jan", "Feb", "Mar"], + "title": "Monthly Temperature and Rainfall (Q1)", + "axisXTitle": "Month", + "series": [ + { + "type": "line", + "data": [5, 7, 10], + "axisYTitle": "Temperature (°C)" + }, + { + "type": "column", + "data": [50, 60, 80], + "axisYTitle": "Rainfall (mm)" + } + ] + } + }, + { + "type": "data2chart", + "question": "用双轴图显示用户增长与活跃度 [{ \"quarter\": \"Q1\", \"user_growth\": 500, \"activity_rate\": 60 }, { \"quarter\": \"Q2\", \"user_growth\": 700, \"activity_rate\": 65 }, { \"quarter\": \"Q3\", \"user_growth\": 900, \"activity_rate\": 70 }]", + "answer": { + "type": "dual-axes", + "categories": ["Q1", "Q2", "Q3"], + "title": "User Growth and Activity Rate by Quarter", + "axisXTitle": "Quarter", + "series": [ + { + "type": "column", + "data": [500, 700, 900], + "axisYTitle": "User Growth" + }, + { + "type": "line", + "data": [60, 65, 70], + "axisYTitle": "Activity Rate (%)" + } + ] + } + }, + { + "type": "data2chart", + "question": "用双轴图表示产品销售量与退货率 [{ \"product\": \"A\", \"sales_volume\": 200, \"return_rate\": 5 }, { \"product\": \"B\", \"sales_volume\": 300, \"return_rate\": 7 }, { \"product\": \"C\", \"sales_volume\": 400, \"return_rate\": 9 }]", + "answer": { + "type": "dual-axes", + "categories": ["A", "B", "C"], + "title": "Product Sales Volume and Return Rate", + "axisXTitle": "Product", + "series": [ + { + "type": "column", + "data": [200, 300, 400], + "axisYTitle": "Sales Volume" + }, + { + "type": "line", + "data": [5, 7, 9], + "axisYTitle": "Return Rate (%)" + } + ] + } + }, + { + "type": "data2chart", + "question": "用双轴图绘制公司收入与支出情况 [{ \"year\": 2018, \"income\": 1000, \"expenses\": 800 }, { \"year\": 2019, \"income\": 1200, \"expenses\": 900 }, { \"year\": 2020, \"income\": 1500, \"expenses\": 1000 }]", + "answer": { + "type": "dual-axes", + "categories": ["2018", "2019", "2020"], + "title": "Annual Income and Expenses", + "axisXTitle": "Year", + "series": [ + { + "type": "column", + "data": [1000, 1200, 1500], + "axisYTitle": "Income" + }, + { + "type": "line", + "data": [800, 900, 1000], + "axisYTitle": "Expenses" + } + ] + } + }, + { + "type": "data2chart", + "question": "用组合图可视化我的数据 [{ \"year\": 2017, \"revenue\": 800, \"profit_margin\": 15 }, { \"year\": 2018, \"revenue\": 900, \"profit_margin\": 18 }, { \"year\": 2019, \"revenue\": 1000, \"profit_margin\": 20 }]", + "answer": { + "type": "dual-axes", + "categories": ["2017", "2018", "2019"], + "title": "2017-2019 Revenue and Profit Margin", + "axisXTitle": "Year", + "series": [ + { + "type": "column", + "data": [800, 900, 1000], + "axisYTitle": "Revenue" + }, + { + "type": "line", + "data": [15, 18, 20], + "axisYTitle": "Profit Margin (%)" + } + ] + } + }, + { + "type": "data2chart", + "question": "用组合图展示过去三年的网站访问量和转化率 [{ \"month\": \"Apr\", \"visits\": 10000, \"conversion_rate\": 2.5 }, { \"month\": \"May\", \"visits\": 12000, \"conversion_rate\": 3.0 }, { \"month\": \"Jun\", \"visits\": 15000, \"conversion_rate\": 3.5 }]", + "answer": { + "type": "dual-axes", + "categories": ["Apr", "May", "Jun"], + "title": "Monthly Website Visits and Conversion Rate (Q2)", + "axisXTitle": "Month", + "series": [ + { + "type": "column", + "data": [10000, 12000, 15000], + "axisYTitle": "Visits" + }, + { + "type": "line", + "data": [2.5, 3.0, 3.5], + "axisYTitle": "Conversion Rate (%)" + } + ] + } + }, + { + "type": "data2chart", + "question": "用组合图表示不同地区的销售额和市场份额 [{ \"region\": \"North\", \"sales\": 5000, \"market_share\": 20 }, { \"region\": \"South\", \"sales\": 7000, \"market_share\": 25 }, { \"region\": \"East\", \"sales\": 6000, \"market_share\": 22 }]", + "answer": { + "type": "dual-axes", + "categories": ["North", "South", "East"], + "title": "Regional Sales and Market Share", + "axisXTitle": "Region", + "series": [ + { + "type": "column", + "data": [5000, 7000, 6000], + "axisYTitle": "Sales" + }, + { + "type": "line", + "data": [20, 25, 22], + "axisYTitle": "Market Share (%)" + } + ] + } + }, + { + "type": "data2chart", + "question": "用组合图可视化过去50天的股票价格和交易量 [{\"day\":1,\"price\":100,\"volume\":10000},{\"day\":2,\"price\":102,\"volume\":12000},{\"day\":3,\"price\":101,\"volume\":11000},{\"day\":4,\"price\":103,\"volume\":13000},{\"day\":5,\"price\":104,\"volume\":14000},{\"day\":6,\"price\":105,\"volume\":15000},{\"day\":7,\"price\":106,\"volume\":16000},{\"day\":8,\"price\":107,\"volume\":17000},{\"day\":9,\"price\":108,\"volume\":18000},{\"day\":10,\"price\":109,\"volume\":19000},{\"day\":11,\"price\":110,\"volume\":20000},{\"day\":12,\"price\":111,\"volume\":21000},{\"day\":13,\"price\":112,\"volume\":22000},{\"day\":14,\"price\":113,\"volume\":23000},{\"day\":15,\"price\":114,\"volume\":24000},{\"day\":16,\"price\":115,\"volume\":25000},{\"day\":17,\"price\":116,\"volume\":26000},{\"day\":18,\"price\":117,\"volume\":27000},{\"day\":19,\"price\":118,\"volume\":28000},{\"day\":20,\"price\":119,\"volume\":29000},{\"day\":21,\"price\":120,\"volume\":30000},{\"day\":22,\"price\":121,\"volume\":31000},{\"day\":23,\"price\":122,\"volume\":32000},{\"day\":24,\"price\":123,\"volume\":33000},{\"day\":25,\"price\":124,\"volume\":34000},{\"day\":26,\"price\":125,\"volume\":35000},{\"day\":27,\"price\":126,\"volume\":36000},{\"day\":28,\"price\":127,\"volume\":37000},{\"day\":29,\"price\":128,\"volume\":38000},{\"day\":30,\"price\":129,\"volume\":39000},{\"day\":31,\"price\":130,\"volume\":40000},{\"day\":32,\"price\":131,\"volume\":41000},{\"day\":33,\"price\":132,\"volume\":42000},{\"day\":34,\"price\":133,\"volume\":43000},{\"day\":35,\"price\":134,\"volume\":44000},{\"day\":36,\"price\":135,\"volume\":45000},{\"day\":37,\"price\":136,\"volume\":46000},{\"day\":38,\"price\":137,\"volume\":47000},{\"day\":39,\"price\":138,\"volume\":48000},{\"day\":40,\"price\":139,\"volume\":49000},{\"day\":41,\"price\":140,\"volume\":50000},{\"day\":42,\"price\":141,\"volume\":51000},{\"day\":43,\"price\":142,\"volume\":52000},{\"day\":44,\"price\":143,\"volume\":53000},{\"day\":45,\"price\":144,\"volume\":54000},{\"day\":46,\"price\":145,\"volume\":55000},{\"day\":47,\"price\":146,\"volume\":56000},{\"day\":48,\"price\":147,\"volume\":57000},{\"day\":49,\"price\":148,\"volume\":58000},{\"day\":50,\"price\":149,\"volume\":59000}]", + "answer": { + "type": "dual-axes", + "categories": [ + "Day 1", + "Day 2", + "Day 3", + "Day 4", + "Day 5", + "Day 6", + "Day 7", + "Day 8", + "Day 9", + "Day 10", + "Day 11", + "Day 12", + "Day 13", + "Day 14", + "Day 15", + "Day 16", + "Day 17", + "Day 18", + "Day 19", + "Day 20", + "Day 21", + "Day 22", + "Day 23", + "Day 24", + "Day 25", + "Day 26", + "Day 27", + "Day 28", + "Day 29", + "Day 30", + "Day 31", + "Day 32", + "Day 33", + "Day 34", + "Day 35", + "Day 36", + "Day 37", + "Day 38", + "Day 39", + "Day 40", + "Day 41", + "Day 42", + "Day 43", + "Day 44", + "Day 45", + "Day 46", + "Day 47", + "Day 48", + "Day 49", + "Day 50" + ], + "title": "Stock Price and Trading Volume Over 50 Days", + "axisXTitle": "Day", + "series": [ + { + "type": "line", + "data": [ + 100, 102, 101, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, + 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, + 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, + 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149 + ], + "axisYTitle": "Stock Price" + }, + { + "type": "column", + "data": [ + 10000, 12000, 11000, 13000, 14000, 15000, 16000, 17000, 18000, + 19000, 20000, 21000, 22000, 23000, 24000, 25000, 26000, 27000, + 28000, 29000, 30000, 31000, 32000, 33000, 34000, 35000, 36000, + 37000, 38000, 39000, 40000, 41000, 42000, 43000, 44000, 45000, + 46000, 47000, 48000, 49000, 50000, 51000, 52000, 53000, 54000, + 55000, 56000, 57000, 58000, 59000 + ], + "axisYTitle": "Trading Volume" + } + ] + } + } +] diff --git a/evaluations/prompts/dual-axes-chart/data2chart.md b/evaluations/prompts/dual-axes-chart/data2chart.md new file mode 100644 index 0000000..b363c04 --- /dev/null +++ b/evaluations/prompts/dual-axes-chart/data2chart.md @@ -0,0 +1,50 @@ + +## 角色 + +你是一个 mock 图表数据生成器,生成[WIP]双轴图相关的可视化问答对数据。 + +## 任务 + +1. 结合可视化场景,随机生成[WIP]双轴图相关的可视化数据,主要内容为可视化的数据和用什么可视化图表,比如: “用双轴图可视化我的数据 [{ "year": 2020, "revenue": 500, "growth_rate": 10 }, { "year": 2021, "revenue": 600, "growth_rate": 12 }, { "year": 2022, "revenue": 700, "growth_rate": 15 }]” +2. 根据可视化相关问题,生成[WIP]双轴图图表的配置 +3. 以 JSON 格式归纳为一条问答对数据,{"question": <可视化问题>,"answer": <图表的配置>} + +## [WIP]双轴图图表知识库 + +### 图表属性 +```typescript +type DualAxes = { + type: "dual-axes"; + categories: string[]; + title?: string; + axisXTitle?: string; + series: seriesDataItem[]; +} + +type seriesDataItem = { + type: "line" | "column"; + data: number[]; + axisYTitle?: string; +} + +``` + +### 数据要求 ++ type:图表的类型,必填,文本类型,值必须为 "dual-axes" ++ categories:图表的X轴的数组,必填,数组文本类型 ++ title:图表的标题,选填,文本类型 ++ axisXTitle:图表的X轴的标题,选填,文本类型 ++ series:图表详细组合,必填,数组对象类型,每个对象代表一个基础图表,包含: + - type:基础图表的类型,必填,"column"表示柱状图,"line"表示折线图 + - data:基础图表的数据,必填,数组数值类型 + - axisYTitle:基础图表的Y轴标题,选填,文本类型 + +## 参考例子 + +```json +[{"type":"data2chart","question":"用双轴图可视化我的数据 [{ \"year\": 2020, \"revenue\": 500, \"growth_rate\": 10 }, { \"year\": 2021, \"revenue\": 600, \"growth_rate\": 12 }, { \"year\": 2022, \"revenue\": 700, \"growth_rate\": 15 }]","answer":{"type":"dual-axes","categories":["2020","2021","2022"],"title":"2020-2022 Income and Growth Rate","axisXTitle":"Year","series":[{"type":"column","data":[500,600,700],"axisYTitle":"Income"},{"type":"line","data":[10,12,15],"axisYTitle":"Growth Rate"}]}},{"type":"data2chart","question":"用组合图可视化我的数据 [{ \"day\": \"20240501\", \"cnt\": 1000, \"growth_rate\": 10 }, { \"day\": \"20240502\", \"cnt\": 1200, \"growth_rate\": 12 }, { \"day\": \"20240503\", \"cnt\": 1500, \"growth_rate\": 16 }]","answer":{"type":"dual-axes","categories":["20240501","20240502","20240503"],"title":"五一期间景区人流量","axisXTitle":"日期","series":[{"type":"column","data":[1000,1200,1500],"axisYTitle":"人数"},{"type":"line","data":[10,12,16],"axisYTitle":"增长率"}]}}] +``` + +## 要求 + +- 请生成 5 条这样的记录,并以 JSON 格式输出。 diff --git a/evaluations/prompts/dual-axes-chart/text2chart.md b/evaluations/prompts/dual-axes-chart/text2chart.md new file mode 100644 index 0000000..98a218f --- /dev/null +++ b/evaluations/prompts/dual-axes-chart/text2chart.md @@ -0,0 +1,50 @@ + +## 角色 + +你是一个 mock 图表数据生成器,生成[WIP]双轴图相关的可视化问答对数据。 + +## 任务 + +1. 随机结合可视化场景,生成[WIP]双轴图相关的可视化问题,用自然语言纯文本描述,主要内容为数据描述和用什么可视化图表,比如: “用双轴图展示某公司的年销售额与利润率,2018 年至 2022 年的销售额分别为 91.9 亿、99.1 亿、101.6 亿、114.4 亿、121 亿,利润率分别为 5.5%、6.0%、6.2%、7.0%、7.5%。” +2. 根据可视化相关问题,生成[WIP]双轴图图表的配置 +3. 以 JSON 格式归纳为一条问答对数据,{"question": <可视化问题>,"answer": <图表的配置>} + +## [WIP]双轴图图表知识库 + +### 图表属性 +```typescript +type DualAxes = { + type: "dual-axes"; + categories: string[]; + title?: string; + axisXTitle?: string; + series: seriesDataItem[]; +} + +type seriesDataItem = { + type: "line" | "column"; + data: number[]; + axisYTitle?: string; +} + +``` + +### 数据要求 ++ type:图表的类型,必填,文本类型,值必须为 "dual-axes" ++ categories:图表的X轴的数组,必填,数组文本类型 ++ title:图表的标题,选填,文本类型 ++ axisXTitle:图表的X轴的标题,选填,文本类型 ++ series:图表详细组合,必填,数组对象类型,每个对象代表一个基础图表,包含: + - type:基础图表的类型,必填,"column"表示柱状图,"line"表示折线图 + - data:基础图表的数据,必填,数组数值类型 + - axisYTitle:基础图表的Y轴标题,选填,文本类型 + +## 参考例子 + +```json +[{"type":"text2chart","question":"用双轴图展示某公司的年销售额与利润率,2018 年至 2022 年的销售额分别为 91.9 亿、99.1 亿、101.6 亿、114.4 亿、121 亿,利润率分别为 5.5%、6.0%、6.2%、7.0%、7.5%。","answer":{"type":"dual-axes","categories":["2018","2019","2020","2021","2022"],"title":"2018-2022销售额与利润率","axisXTitle":"年份","series":[{"type":"column","data":[91.9,99.1,101.6,114.4,121],"axisYTitle":"销售额"},{"type":"line","data":[0.055,0.06,0.062,0.07,0.075],"axisYTitle":"利润率"}]}}] +``` + +## 要求 + +- 请生成 5 条这样的记录,并以 JSON 格式输出。 diff --git "a/knowledges/\345\217\214\350\275\264\345\233\276 - DualAxes Chart.md" "b/knowledges/\345\217\214\350\275\264\345\233\276 - DualAxes Chart.md" new file mode 100644 index 0000000..081cb2f --- /dev/null +++ "b/knowledges/\345\217\214\350\275\264\345\233\276 - DualAxes Chart.md" @@ -0,0 +1,124 @@ +## 图表属性 + +- 名称:双轴图 +- 别名:组合图,英文名:DualAxes Chart +- 形状:柱形、折线 +- 图表类别:组合图表 +- 图表功能:多维度比较、趋势分析 + +## 基础概念 + +双轴图是一种结合两个不同图表类型的组合图表,通常是将柱状图与折线图结合起来显示。双轴图通过在一个图表中使用两个垂直 Y 轴(左侧和右侧),分别对应不同的数值维度。柱状图用于展示一组数据的大小或数量,而折线图则展示另一组数据的趋势。双轴图非常适合同时展示不同类型的数据变化趋势。 + +## 适用场景 + +- 同时展示两个具有不同数量级的数据,例如销售额和增长率。 +- 比较两组变量的相对变化趋势,如同时观察某时间段内的销量和利润率。 +- 数据维度不同且具有共同的 X 轴(例如时间、类别)。 + +## 不适用场景 + +- 数据类型相同且数量级相近时,单一类型图表(如折线图或柱状图)更简洁。 +- 无法找到具有相关性的两个数据维度进行比较时,双轴图的价值会降低。 + +## 图表用法 + +### 图表属性 + +```typescript +type DualAxes = { + type: 'dual-axes'; + categories: string[]; + title?: string; + axisXTitle?: string; + series: SeriesDataItem[]; +}; + +type SeriesDataItem = { + type: 'line' | 'column'; + data: number[]; + axisYTitle?: string; +}; +``` + +### 数据要求 + +- type:图表的类型,必填,文本类型,值必须为 "dual-axes"。 +- categories:图表的 X 轴的数组,必填,数组文本类型。 +- title:图表的标题,选填,文本类型。 +- axisXTitle:图表的 X 轴的标题,选填,文本类型。 +- series:图表详细组合,必填,数组对象类型,每个对象代表一个基础图表,包含: + - type:基础图表的类型,必填,"column"表示柱状图,"line"表示折线图; + - data:基础图表的数据,必填,数组数值类型; + - axisYTitle:基础图表的 Y 轴标题,选填,文本类型; + +## 使用示例 + +1. 用双轴图展示某公司的年销售额与利润率,2018 年至 2022 年的销售额分别为 91.9 亿、99.1 亿、101.6 亿、114.4 亿、121 亿,利润率分别为 5.5%、6.0%、6.2%、7.0%、7.5%。 + +```json +{ + "type": "dual-axes", + "categories": ["2018", "2019", "2020", "2021", "2022"], + "title": "2018-2022销售额与利润率", + "axisXTitle": "年份", + "series": [ + { + "type": "column", + "data": [91.9, 99.1, 101.6, 114.4, 121], + "axisYTitle": "销售额" + }, + { + "type": "line", + "data": [0.055, 0.06, 0.062, 0.07, 0.075], + "axisYTitle": "利润率" + } + ] +} +``` + +2. 用双轴图可视化我的数据 [{ "year": 2020, "revenue": 500, "growth_rate": 10 }, { "year": 2021, "revenue": 600, "growth_rate": 12 }, { "year": 2022, "revenue": 700, "growth_rate": 15 }]。 + +```json +{ + "type": "dual-axes", + "categories": ["2020", "2021", "2022"], + "title": "2020-2022 Income and Growth Rate", + "axisXTitle": "Year", + "series": [ + { + "type": "column", + "data": [500, 600, 700], + "axisYTitle": "Income" + }, + { + "type": "line", + "data": [10, 12, 15], + "axisYTitle": "Growth Rate" + } + ] +} +``` + +3. 用组合图可视化我的数据 [{ "day": "20240501", "cnt": 1000, "growth_rate": 10 }, { "day": "20240502", "cnt": 1200, "growth_rate": 12 }, { "day": "20240503", "cnt": 1500, "growth_rate": 16 }]。 + +```json +{ + "type": "dual-axes", + "categories": ["20240501", "20240502", "20240503"], + "title": "五一期间景区人流量", + "axisXTitle": "日期", + "series": [ + { + "type": "column", + "data": [1000, 1200, 1500], + "axisYTitle": "人数" + }, + { + "type": "line", + "data": [10, 12, 16], + "axisYTitle": "增长率" + } + ] +} +```