엑셀 차트 만들기
from ironxl import *

# Load the Excel workbook
workbook = WorkBook.Load("test.xlsx")
worksheet = workbook.DefaultWorkSheet

# Set the chart type and its position on the worksheet.
chart = worksheet.CreateChart(ChartType.Line, 10, 10, 18, 20)

# Add the series to the chart
# The first parameter represents the address of the range for the horizontal(category) axis.
# The second parameter represents the address of the range for the vertical(value) axis.
series = chart.AddSeries("B3:B8", "A3:A8")

# Set the chart title.
series.Title = "Line Chart"

# Set the legend position.
# Can be removed by setting it to None.
chart.SetLegendPosition(LegendPosition.Bottom)

# We can change the position of the chart.
chart.Position.LeftColumnIndex = 2
chart.Position.RightColumnIndex = chart.Position.LeftColumnIndex + 3

# Plot all the data that was added to the chart before.
# Multiple calls to this method lead to plotting multiple charts instead of modifying the existing chart.
# Yet there is no possibility to remove a chart or edit its series/position.
# We can just create a new one.
chart.Plot()

# Save changes with the created line chart
workbook.SaveAs("CreateLineChart.xlsx")
pip install ironxl
엑셀 차트 만들기

엑셀 차트 만들기

IronXL for Python은 최신 XLSX 파일 형식의 Excel 문서 내에서 차트를 생성하고 편집하는 기능을 지원합니다.

이 예제는 선형 차트를 만드는 방법을 보여줍니다. 다른 차트 유형도 지원됩니다.

Python Excel 차트 생성 및 편집 가이드를 탐색하세요

시작할 준비 되셨나요?

버전:2026.11방금 출시