Skip to content

FLUT-7003-ChartXlsIO-Dev #451

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Dec 14, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
64 changes: 64 additions & 0 deletions Flutter/xlsio/add-line-with-markers-chart.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
---
layout: post
title: Excel Line with Markers Chart of Syncfusion Flutter XlsIO.
description: Learn how to create, add and manipulate the line with markers chart in Excel worksheet using Syncfusion Flutter XlsIO.
platform: flutter
control: Excel
documentation: ug
---

# Adding Stacked line Chart to Excel worksheet

Line marker is a line that is drawn on chart plot and bound to some value on an axis. It may be used to show a trend or mark an important value.

The following code snippet illustrate how to add Line with Markers chart to Excel worksheet using Flutter XlsIO.

{% highlight dart %}
// Create a new Excel document.
final Workbook workbook = Workbook();

// Accessing worksheet via index.
final Worksheet sheet = workbook.worksheets[0];

// Setting value in the cell.
sheet.getRangeByName('A1').setText('City Name');
sheet.getRangeByName('A2').setText('Chennai');
sheet.getRangeByName('A3').setText('Mumbai');
sheet.getRangeByName('A4').setText('Delhi');
sheet.getRangeByName('A5').setText('Hyderabad');
sheet.getRangeByName('A6').setText('Kolkata');
sheet.getRangeByName('B1').setText('Temp in C');
sheet.getRangeByName('B2').setNumber(34);
sheet.getRangeByName('B3').setNumber(40);
sheet.getRangeByName('B4').setNumber(47);
sheet.getRangeByName('B5').setNumber(20);
sheet.getRangeByName('B6').setNumber(66);
sheet.getRangeByName('C1').setText('Temp in F');
sheet.getRangeByName('C2').setNumber(93);
sheet.getRangeByName('C3').setNumber(104);
sheet.getRangeByName('C4').setNumber(120);
sheet.getRangeByName('C5').setNumber(80);
sheet.getRangeByName('C6').setNumber(140);

//Create an instances of chart collection.
final ChartCollection charts = ChartCollection(sheet);

// Add the chart.
final Chart chart1 = charts.add();

// Set Chart Type.
chart1.chartType = ExcelChartType.lineMarkers;

// Set data range in the worksheet.
chart1.dataRange = sheet.getRangeByName('A1:C6');
chart1.isSeriesInRows = false;

// set charts to worksheet.
sheet.charts = charts;

//save and dispose workbook.
final List<int> bytes = workbook.saveAsStream();
workbook.dispose();
File('LineWithMarkersChart.xlsx').writeAsBytes(bytes);
{% endhighlight %}

20 changes: 20 additions & 0 deletions Flutter/xlsio/working-with-charts.md
Original file line number Diff line number Diff line change
Expand Up @@ -199,3 +199,23 @@ The following chart types are supported in Flutter XlsIO.
* [Bar_Stacked](https://help.syncfusion.com/flutter/xlsio/add-stacked-bar-chart)
* [Column_Stacked](https://help.syncfusion.com/flutter/xlsio/add-stacked-column-chart)
* [Line_Stacked](https://help.syncfusion.com/flutter/xlsio/add-stacked-line-chart)
* Line With Markers
* Stacked Line With Markers
* 100% Stacked Line With Markers
* 3-D Line3D
* 3-D Column
* 3-D Clustered Column
* 3-D 100% Stacked Column
* 3-D Stacked Column
* 3-D Clustered Bar
* 3-D 100% Stacked Bar
* High Low Close
* Open High Low Close
* Volume High Low Close
* Volume Open High Low Close
* 3-D Pie
* Pie Of Pie
* Bar Of Pie
* Doughnut
* Doughnut Exploded

1 change: 1 addition & 0 deletions flutter-toc.html
Original file line number Diff line number Diff line change
Expand Up @@ -550,6 +550,7 @@
<li><a href="/Flutter/xlsio/add-stacked-bar-chart">Stacked Bar Chart</a></li>
<li><a href="/Flutter/xlsio/add-stacked-column-chart">Stacked Column Chart</a></li>
<li><a href="/Flutter/xlsio/add-stacked-line-chart">Stacked Line Chart</a></li>
<li><a href="/Flutter/xlsio/add-line-with-markers-chart">Line with Markers Chart</a></li>
</ul></li>
<li><a href="/Flutter/xlsio/working-with-image">Working with Image</a></li>
<li><a href="/Flutter/xlsio/security">Security</a></li>
Expand Down