圖表產生器
把 CSV 或 Tab 分隔的資料貼進來,即可產生折線圖、柱狀圖、堆疊柱狀圖、面積圖、圓餅圖、環形圖、散佈圖與雷達圖,並匯出 SVG 原始碼。
瀏覽器本機執行所有計算都在你的瀏覽器裡完成,資料不會離開本機。
資料(第一行是表頭)
第一欄是分類標籤,其餘欄位是數值;逗號與 Tab 分隔都支援,數值可用引號包住。
圖表預覽
圖表由本站自己產生的 SVG 繪製,資料不會離開瀏覽器。
SVG 原始碼
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 720 420" width="720" height="420" role="img" aria-label="chart" data-test-id="chart" font-family="system-ui, -apple-system, 'Segoe UI', sans-serif"><line x1="58" y1="358.00" x2="702.00" y2="358.00" stroke="#9ca3af" stroke-opacity="0.28" stroke-width="1"/><text x="50" y="358.00" text-anchor="end" dominant-baseline="middle" font-size="11" fill="#6b7280">0</text><line x1="58" y1="289.60" x2="702.00" y2="289.60" stroke="#9ca3af" stroke-opacity="0.28" stroke-width="1"/><text x="50" y="289.60" text-anchor="end" dominant-baseline="middle" font-size="11" fill="#6b7280">50</text><line x1="58" y1="221.20" x2="702.00" y2="221.20" stroke="#9ca3af" stroke-opacity="0.28" stroke-width="1"/><text x="50" y="221.20" text-anchor="end" dominant-baseline="middle" font-size="11" fill="#6b7280">100</text><line x1="58" y1="152.80" x2="702.00" y2="152.80" stroke="#9ca3af" stroke-opacity="0.28" stroke-width="1"/><text x="50" y="152.80" text-anchor="end" dominant-baseline="middle" font-size="11" fill="#6b7280">150</text><line x1="58" y1="84.40" x2="702.00" y2="84.40" stroke="#9ca3af" stroke-opacity="0.28" stroke-width="1"/><text x="50" y="84.40" text-anchor="end" dominant-baseline="middle" font-size="11" fill="#6b7280">200</text><line x1="58" y1="16.00" x2="702.00" y2="16.00" stroke="#9ca3af" stroke-opacity="0.28" stroke-width="1"/><text x="50" y="16.00" text-anchor="end" dominant-baseline="middle" font-size="11" fill="#6b7280">250</text><line x1="58" y1="16" x2="58" y2="358" stroke="#9ca3af" stroke-opacity="0.5" stroke-width="1"/><line x1="58" y1="358" x2="702" y2="358" stroke="#9ca3af" stroke-opacity="0.5" stroke-width="1"/><text x="138.50" y="376" text-anchor="middle" font-size="11" fill="#6b7280">Q1</text><text x="299.50" y="376" text-anchor="middle" font-size="11" fill="#6b7280">Q2</text><text x="460.50" y="376" text-anchor="middle" font-size="11" fill="#6b7280">Q3</text><text x="621.50" y="376" text-anchor="middle" font-size="11" fill="#6b7280">Q4</text><polyline data-series="銷售額" points="138.50,193.84 299.50,152.80 460.50,111.76 621.50,70.72" fill="none" stroke="#4d6bfe" stroke-width="2" stroke-linejoin="round" stroke-linecap="round"/><circle cx="138.50" cy="193.84" r="3" fill="#4d6bfe"><title>銷售額 · Q1: 120</title></circle><circle cx="299.50" cy="152.80" r="3" fill="#4d6bfe"><title>銷售額 · Q2: 150</title></circle><circle cx="460.50" cy="111.76" r="3" fill="#4d6bfe"><title>銷售額 · Q3: 180</title></circle><circle cx="621.50" cy="70.72" r="3" fill="#4d6bfe"><title>銷售額 · Q4: 210</title></circle><polyline data-series="成本" points="138.50,248.56 299.50,228.04 460.50,207.52 621.50,193.84" fill="none" stroke="#f59e0b" stroke-width="2" stroke-linejoin="round" stroke-linecap="round"/><circle cx="138.50" cy="248.56" r="3" fill="#f59e0b"><title>成本 · Q1: 80</title></circle><circle cx="299.50" cy="228.04" r="3" fill="#f59e0b"><title>成本 · Q2: 95</title></circle><circle cx="460.50" cy="207.52" r="3" fill="#f59e0b"><title>成本 · Q3: 110</title></circle><circle cx="621.50" cy="193.84" r="3" fill="#f59e0b"><title>成本 · Q4: 120</title></circle><g transform="translate(12 402)"><rect width="10" height="10" rx="2" fill="#4d6bfe"/><text x="15" y="9" font-size="11" fill="#6b7280">銷售額</text></g><g transform="translate(130 402)"><rect width="10" height="10" rx="2" fill="#f59e0b"/><text x="15" y="9" font-size="11" fill="#6b7280">成本</text></g></svg>
這個工具能做什麼
- 把 Excel 複製出來的兩列表格粘進來,立刻得到一張能插進文件或 PPT 的折線圖 / 柱狀圖,不用開啟圖表軟體。
- 寫技術文件時只需要一張靜態圖:匯出 SVG 原始碼直接內聯進頁面,放大不模糊,還能隨手改配色。
- 對比多組資料時切到堆疊柱狀圖或面積圖,每列一個系列,圖例和網格線都在同一個介面裡開關。
- 只有一個維度的佔比要展示時用餅圖或環形圖,8 種圖表型別覆蓋了大部分臨時出圖需求。
範例
輸入
季度,銷售額,成本 Q1,120,80 Q2,150,95 Q3,180,110 Q4,210,120
輸出
<svg viewBox="0 0 720 420"> 折線圖:y 軸刻度 0/50/100/150/200/250,兩個系列各一條 polyline 與 4 個數據點,圖例顯示「銷售額」「成本」
第一列是分類標籤,其餘列是數值;逗號和製表符都能自動識別,數字裡的千分位逗號會被忽略。
常見問題
為什麼貼上進去提示「至少需要兩列」或者「資料列裡有無法解析的數字」?
表結構固定為「第一列標籤 + 其餘列數值」,只有一列就無法繪圖。某一列出現空單元格、單位符號(120 萬)或「暫無」這類文字時也會報錯,先清理成純數字再試。
餅圖和環形圖報負數或總和為 0 是怎麼回事?
餅圖只描述佔比,負數沒有意義,數值全是 0 也畫不出扇形,所以這兩種情況都會直接報錯。換成柱狀圖或折線圖就能正常顯示負值。
雷達圖為什麼至少要 3 行資料?
雷達圖用頂點之間的連線圍成多邊形,少於 3 個軸連不成面。需要畫 2 個維度的對比時用柱狀圖更合適。
資料量有上限嗎?
最多 2000 行、24 列。生成的是純 SVG 文本,行數太多瀏覽器渲染和閱讀都會吃力,超限會提示而不是卡死。
圖表會上傳到伺服器嗎?
不會。解析和 SVG 生成都是瀏覽器本地計算,頁面不發任何請求,資料只在你的瀏覽器裡處理,斷網也能出圖。
關鍵字:图表图表生成折线图柱状图饼图雷达图svg 图表chartchart makersvg chartline chartbar chartpie chartradar chart