Skip to content
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
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ End Using

{% endtabs %}

You can download a complete working sample from [GitHub](https://github.com/SyncfusionExamples/DocIO-Examples/tree/main/Word-to-PDF-Conversion/Fallback-fonts-based-on-scripttype/)
You can download a complete working sample from [GitHub](https://github.com/SyncfusionExamples/DocIO-Examples/tree/main/Word-to-PDF-Conversion/Fallback-symbol-based-on-scripttype/)

## Fallback fonts for range of Unicode text

Expand Down
173 changes: 10 additions & 163 deletions Document-Processing/Word/Word-Library/NET/Working-with-Charts.md
Original file line number Diff line number Diff line change
Expand Up @@ -1341,169 +1341,6 @@ You can download a complete working sample from [GitHub](https://github.com/Sync
N> 1. To convert chart in Word document as image, it is need to refer chart conversion related [assemblies](https://help.syncfusion.com/document-processing/word/word-library/net/assemblies-required#converting-charts) or [NuGet packages](https://help.syncfusion.com/document-processing/word/word-library/net/nuget-packages-required#converting-charts).
N> 2. The ChartToImageConverter is supported from .NET Framework 4.0 onwards.

## Word 2016 Charts

Essential<sup>&reg;</sup> DocIO supports creating and manipulating new and modern chart types such as waterfall, which is introduced in Microsoft Word 2016.

### Waterfall

[Waterfall](https://support.microsoft.com/en-us/office/create-a-waterfall-chart-8de1ece4-ff21-4d37-acd7-546f5527f185?ui=en-us&rs=en-us&ad=us#) chart helps understand the finances of business owners by viewing profit and loss statements. You can quickly illustrate the line items in your financial data and get a clear picture of how each item is impacting your bottom line using a Waterfall chart.

The following code example illustrates how to create a [Waterfall](https://help.syncfusion.com/cr/document-processing/Syncfusion.OfficeChart.OfficeChartType.html) chart.

{% tabs %}

{% highlight c# tabtitle="C# [Cross-platform]" playgroundButtonLink="https://raw.githubusercontent.com/SyncfusionExamples/DocIO-Examples/main/Charts/Create-waterfall-chart/.NET/Create-waterfall-chart/Program.cs" %}
//Creates a new Word document.
using (WordDocument document = new WordDocument())
{
//Adds section to the document.
IWSection sec = document.AddSection();
//Adds paragraph to the section.
IWParagraph paragraph = sec.AddParagraph();
//Creates and Appends chart to the paragraph.
WChart chart = paragraph.AppendChart(446, 270);
//Sets chart type.
chart.ChartType = OfficeChartType.WaterFall;
//Sets data range.
chart.DataRange = chart.ChartData[1, 1, 8, 2];
chart.IsSeriesInRows = false;
chart.ChartData.SetValue(2, 1, "Start");
chart.ChartData.SetValue(2, 2, 120000);
chart.ChartData.SetValue(3, 1, "Product Revenue");
chart.ChartData.SetValue(3, 2, 570000);
chart.ChartData.SetValue(4, 1, "Service Revenue");
chart.ChartData.SetValue(4, 2, 230000);
chart.ChartData.SetValue(5, 1, "Positive Balance");
chart.ChartData.SetValue(5, 2, 920000);
chart.ChartData.SetValue(6, 1, "Fixed Costs");
chart.ChartData.SetValue(6, 2, -345000);
chart.ChartData.SetValue(7, 1, "Variable Costs");
chart.ChartData.SetValue(7, 2, -230000);
chart.ChartData.SetValue(8, 1, "Total");
chart.ChartData.SetValue(8, 2, 345000);
//Data point settings as total in chart.
IOfficeChartSerie series = chart.Series[0];
chart.Series[0].DataPoints[3].SetAsTotal = true;
chart.Series[0].DataPoints[6].SetAsTotal = true;
//Showing the connector lines between data points.
chart.Series[0].SerieFormat.ShowConnectorLines = true;
//Set the chart title.
chart.ChartTitle = "Company Profit (in USD)";
//Formatting data label and legend option.
chart.Series[0].DataPoints.DefaultDataPoint.DataLabels.IsValue = true;
chart.Series[0].DataPoints.DefaultDataPoint.DataLabels.Size = 8;
chart.Legend.Position = OfficeLegendPosition.Right;
chart.ChartArea.Border.LinePattern = OfficeChartLinePattern.None;
//Saves the Word document to MemoryStream.
MemoryStream outputStream = new MemoryStream();
document.Save(outputStream, FormatType.Docx);
}
{% endhighlight %}

{% highlight c# tabtitle="C# [Windows-specific]" %}
//Creates a new Word document.
using (WordDocument document = new WordDocument())
{
//Adds section to the document.
IWSection sec = document.AddSection();
//Adds paragraph to the section.
IWParagraph paragraph = sec.AddParagraph();
//Creates and Appends chart to the paragraph.
WChart chart = paragraph.AppendChart(446, 270);
//Sets chart type.
chart.ChartType = OfficeChartType.WaterFall;
//Sets data range.
chart.DataRange = chart.ChartData[1, 1, 8, 2];
chart.IsSeriesInRows = false;
chart.ChartData.SetValue(2, 1, "Start");
chart.ChartData.SetValue(2, 2, 120000);
chart.ChartData.SetValue(3, 1, "Product Revenue");
chart.ChartData.SetValue(3, 2, 570000);
chart.ChartData.SetValue(4, 1, "Service Revenue");
chart.ChartData.SetValue(4, 2, 230000);
chart.ChartData.SetValue(5, 1, "Positive Balance");
chart.ChartData.SetValue(5, 2, 920000);
chart.ChartData.SetValue(6, 1, "Fixed Costs");
chart.ChartData.SetValue(6, 2, -345000);
chart.ChartData.SetValue(7, 1, "Variable Costs");
chart.ChartData.SetValue(7, 2, -230000);
chart.ChartData.SetValue(8, 1, "Total");
chart.ChartData.SetValue(8, 2, 345000);
//Data point settings as total in chart.
IOfficeChartSerie series = chart.Series[0];
chart.Series[0].DataPoints[3].SetAsTotal = true;
chart.Series[0].DataPoints[6].SetAsTotal = true;
//Showing the connector lines between data points.
chart.Series[0].SerieFormat.ShowConnectorLines = true;
//Set the chart title.
chart.ChartTitle = "Company Profit (in USD)";
//Formatting data label and legend option.
chart.Series[0].DataPoints.DefaultDataPoint.DataLabels.IsValue = true;
chart.Series[0].DataPoints.DefaultDataPoint.DataLabels.Size = 8;
chart.Legend.Position = OfficeLegendPosition.Right;
chart.ChartArea.Border.LinePattern = OfficeChartLinePattern.None;
//Saves the WordDocument instance.
document.Save("Sample.docx", FormatType.Docx);
}
{% endhighlight %}

{% highlight vb.net tabtitle="VB.NET [Windows-specific]" %}
'Creates a new Word document.
Using document As WordDocument = New WordDocument()
'Adds section to the document.
Dim sec As IWSection = document.AddSection()
'Adds paragraph to the section.
Dim paragraph As IWParagraph = sec.AddParagraph()
'Creates and Appends chart to the paragraph.
Dim chart As WChart = paragraph.AppendChart(446, 270)
'Sets chart type.
chart.ChartType = OfficeChartType.WaterFall
'Sets data range.
chart.DataRange = chart.ChartData(1, 1, 8, 2)
chart.IsSeriesInRows = False
chart.ChartData.SetValue(2, 1, "Start")
chart.ChartData.SetValue(2, 2, 120000)
chart.ChartData.SetValue(3, 1, "Product Revenue")
chart.ChartData.SetValue(3, 2, 570000)
chart.ChartData.SetValue(4, 1, "Service Revenue")
chart.ChartData.SetValue(4, 2, 230000)
chart.ChartData.SetValue(5, 1, "Positive Balance")
chart.ChartData.SetValue(5, 2, 920000)
chart.ChartData.SetValue(6, 1, "Fixed Costs")
chart.ChartData.SetValue(6, 2, -345000)
chart.ChartData.SetValue(7, 1, "Variable Costs")
chart.ChartData.SetValue(7, 2, -230000)
chart.ChartData.SetValue(8, 1, "Total")
chart.ChartData.SetValue(8, 2, 345000)
'Data point settings as total in chart.
Dim series As IOfficeChartSerie = chart.Series(0)
chart.Series(0).DataPoints(3).SetAsTotal = True
chart.Series(0).DataPoints(6).SetAsTotal = True
'Showing the connector lines between data points.
chart.Series(0).SerieFormat.ShowConnectorLines = True
'Set the chart title.
chart.ChartTitle = "Company Profit (in USD)"
'Formatting data label and legend option.
chart.Series(0).DataPoints.DefaultDataPoint.DataLabels.IsValue = True
chart.Series(0).DataPoints.DefaultDataPoint.DataLabels.Size = 8
chart.Legend.Position = OfficeLegendPosition.Right
chart.ChartArea.Border.LinePattern = OfficeChartLinePattern.None
'Saves the WordDocument instance.
document.Save("Sample.docx", FormatType.Docx)
End Using
{% endhighlight %}

{% endtabs %}

You can download a complete working sample from [GitHub](https://github.com/SyncfusionExamples/DocIO-Examples/tree/main/Charts/Create-waterfall-chart).

By executing the code example above, it generates the resultant Word document as follows.

![Word WaterFall Chart](workingwithchartsimages/waterfall-in-file-formats-word.png)

N>These charts are supported only in Word 2016 and are not supported in the previous versions.

## Supported Chart Types

The following chart types are supported in DocIO.
Expand Down Expand Up @@ -1581,7 +1418,17 @@ The following chart types are supported in DocIO.
* [Surface_Contour](https://support.syncfusion.com/kb/article/12250/how-to-create-contour-surface-chart-in-word-document-using-c)
* [Surface_NoColor_3D](https://support.syncfusion.com/kb/article/12247/how-to-create-wireframe-3d-surface-chart-in-word-document-using-c)
* [Surface_NoColor_Contour](https://support.syncfusion.com/kb/article/12245/how-to-create-wireframe-contour-surface-chart-in-word-document-using-c)

### Word 2016 Charts

* [WaterFall](https://support.syncfusion.com/kb/article/12243/how-to-create-waterfall-chart-in-word-document-using-c)
* [Treemap](https://support.syncfusion.com/kb/article/21289/how-to-create-a-treemap-chart-in-a-word-document-using-c)
* [Sunburst](https://support.syncfusion.com/kb/article/21291/how-to-create-sunburst-chart-in-word-document-using-c-net-core)
* [Histogram](https://support.syncfusion.com/kb/article/21150/how-to-create-a-histogram-chart-in-a-word-document-using-c)
* [Funnel](https://support.syncfusion.com/kb/article/21210/how-to-create-a-funnel-chart-in-a-word-document-using-c)
* [Box and Whisker](https://support.syncfusion.com/kb/article/21214/how-to-create-a-box-and-whisker-chart-in-a-word-document-using-c)

N>These charts are supported only in Word 2016 and are not supported in the previous versions.

## Online Demo

Expand Down