MCP ExplorerExplorer

Mcp Chart Generator

@lhyn81on 10 months ago
1 MIT
FreeCommunity
AI Systems
a mcp tool for generating charts(line, bar, pie, hist)

Overview

What is Mcp Chart Generator

mcp-chart-generator is a tool based on FastMCP for generating various types of charts from JSON data, including line charts, bar charts, pie charts, and histograms. The generated charts can be saved as image files.

Use cases

Use cases for mcp-chart-generator include generating visual reports for business data, creating educational materials that require data visualization, and analyzing trends in datasets through graphical representation.

How to use

To use mcp-chart-generator, first install the required Python libraries: matplotlib, numpy, and FastMCP. You can install them using the command ‘pip install matplotlib numpy fastmcp’. Then, run the main program file ‘v1.py’ to generate charts from your JSON data.

Key features

Key features of mcp-chart-generator include support for multiple chart types (line, bar, pie, histogram), support for Chinese characters using the SimHei font, automatic directory creation for saving charts, and detailed error handling during chart generation.

Where to use

mcp-chart-generator can be used in various fields such as data analysis, reporting, educational purposes, and any scenario where visual representation of data is required.

Content

图表生成工具

本项目是一个基于 FastMCP 的图表生成工具,支持从 JSON 数据生成多种类型的图表,包括折线图、柱状图、饼图和直方图。生成的图表可以保存为图片文件。

功能特性

  • 支持的图表类型
    • 折线图(Line Chart)
    • 柱状图(Bar Chart)
    • 饼图(Pie Chart)
    • 直方图(Histogram)
  • 支持中文字符:通过设置 SimHei 字体,图表可以正确显示中文字符。
  • 自动创建目录:如果保存图表的路径不存在,程序会自动创建目录。
  • 错误处理:在生成图表过程中发生错误时,会返回详细的错误信息。

文件结构

  • v1.py:主程序文件,包含图表生成工具的实现。
  • README.md:项目说明文件。

使用方法

  1. 安装依赖
    确保已安装以下 Python 库:

    • matplotlib
    • numpy
    • FastMCP

    使用以下命令安装依赖:

    pip install matplotlib numpy fastmcp

Tools

No tools

Comments

Recommend MCP Servers

View All MCP Servers