IRONSOFTWAREHOME
Create Excel Chart
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
Create Excel Chart

Create Excel Chart

IronXL for Python supports the creation and editing of charts within Excel documents in the modern XLSX file format.

This example demonstrates how to create a Line Chart. Other chart types are also supported.

Explore the Python Excel Chart Creation and Editing Guide

Ready to Get Started?

Version:2026.10just released

Key in blue circle

Get your free 30-day Trial Key instantly

Your trial license will be sent to your email address

No limitations. 100% unlocked. No credit card.

bullet_checkedNo credit card or account creation requiredNo limitations. 100% unlocked. No credit card.
  • Logo Aetna
  • Logo NASA
  • Logo GE
  • Logo Porsche
  • Logo USDA
  • Logo Qatar
Join Millions of Engineers who’ve tried IronXL for Python
Book your free Live Demo
Booking Badge

Trusted by Millions of Engineers Worldwide

Iron Software's customer logos
Get a Quote, No Obligation
Your details will always be kept confidential.
  • Logo Aetna
  • Logo NASA
  • Logo GE
  • Logo Porsche
  • Logo USDA
  • Logo Qatar
Trusted by Millions of Engineers Worldwide
Get your free 30-day Trial Key instantly.
No credit card or account creation required
Python Module Download for Excel
Install with pip

Version: 2026.10

  1. Download and install Python 3.7+.
  2. Install pip from pypi.org if it isn't installed already.
  3. Execute the above command in the terminal.
Python PDF Module
Download Module

Version: 2026.10

Manually install into your project

  1. Download the package
  2. Run this command from the terminal
    pip install IronXL-2026.10-py37-none-win_amd64.whi

Licenses from $999