IRONSOFTWAREHOME
Criar gráfico no Excel
using IronXL;
using IronXL.Drawing.Charts;

WorkBook workBook = WorkBook.Load("test.xlsx");
WorkSheet workSheet = workBook.DefaultWorkSheet;

// Set the chart type and it's position  on the worksheet.
var 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 horizontal(category) axis.
// The second  parameter represents the address of the range for vertical(value) axis.
var 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 call of this method leads to plotting multiple charts instead of modifying the existing chart.
// Yet there is no possibility to remove chart or edit it's series/position.
// We can just create new one.
chart.Plot();

workBook.SaveAs("CreateLineChart.xlsx");
Imports IronXL
Imports IronXL.Drawing.Charts

Dim workBook As WorkBook = WorkBook.Load("test.xlsx")
Dim workSheet As WorkSheet = workBook.DefaultWorkSheet

' Set the chart type and its position on the worksheet.
Dim 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 horizontal(category) axis.
' The second parameter represents the address of the range for vertical(value) axis.
Dim 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 of this method lead to plotting multiple charts instead of modifying the existing chart.
' Yet there is no possibility to remove chart or edit its series/position.
' We can just create a new one.
chart.Plot()

workBook.SaveAs("CreateLineChart.xlsx")
NuGet Download
PM > Install-Package IronXL.Excel
Criar gráfico no Excel

Criar gráfico no Excel

IronXL suporta a criação e edição de gráficos para documentos Excel no formato moderno de arquivo XLSX.

Este exemplo mostra como criar um LineChart. Outros tipos de gráfico também são suportados.

Explore nosso Guia de Criação e Edição de Gráficos Excel em C#
Ver no GitHub

Pronto para começar?

Nuget Downloads 2,280,941Versão:2026.10recém-lançado

Key in blue circle

Obtenha sua chave de avaliação gratuita de 30 dias instantaneamente.

Your trial license will be sent to your email address

Sem limitações. 100% desbloqueado. Sem cartão de crédito.

bullet_checkedNão é necessário cartão de crédito nem criação de conta.Sem limitações. 100% desbloqueado. Sem cartão de crédito.
  • Logo Aetna
  • Logo NASA
  • Logo GE
  • Logo Porsche
  • Logo USDA
  • Logo Qatar
Join Millions of Engineers who’ve tried IronXL
Agende sua demonstração ao vivo gratuita.
Booking Badge

Aprovado por milhões de engenheiros em todo o mundo.

Logotipos dos clientes da Iron Software
Agende sua consulta sem compromisso.
Os seus dados serão sempre mantidos em sigilo.
  • Logo Aetna
  • Logo NASA
  • Logo GE
  • Logo Porsche
  • Logo USDA
  • Logo Qatar
Aprovado por milhões de engenheiros em todo o mundo.
Obtenha sua chave de avaliação gratuita de 30 dias instantaneamente.
Não é necessário cartão de crédito nem criação de conta.
Biblioteca NuGet C# para PDF
Instalar com NuGet

Versão: 2026.10

PM > Install-Package IronXL.Excel
nuget.org/packages/IronXL.Excel/
  1. No Solution Explorer, clique com o botão direito do mouse em Referências e selecione Gerenciar Pacotes NuGet.
  2. Selecione Procurar e pesquise "IronXL".
  3. Selecione o pacote e instale.
DLL de PDF em C#
Baixar DLL

Versão: 2026.10

  1. Baixe e descompacte o IronXL em um local como ~/Libs dentro do diretório da sua solução.
  2. No Solution Explorer do Visual Studio, clique com o botão direito do mouse em Referências. Selecione Procurar e digite "IronXL.dll".

Licenças a partir de US$ 999