diff --git a/Examples/Charts/NumberOfVisitors.ps1 b/Examples/Charts/NumberOfVisitors.ps1 new file mode 100644 index 0000000..b3c8517 --- /dev/null +++ b/Examples/Charts/NumberOfVisitors.ps1 @@ -0,0 +1,27 @@ +$xlfile = "$env:TEMP\visitors.xlsx" +Remove-Item $xlfile -ErrorAction SilentlyContinue + +$data = ConvertFrom-Csv @" +Week, TotalVisitors +1,11916 +2,11665 +3,13901 +4,15444 +5,21592 +6,15057 +7,26187 +8,20662 +9,28935 +10,32443 +"@ + +$cd = New-ExcelChartDefinition ` + -XRange Week ` + -YRange TotalVisitors ` + -Title "No. Of Visitors" ` + -ChartType ColumnClustered ` + -NoLegend ` + -ChartTrendLine Linear + +$data | Export-Excel $xlfile -Show -AutoNameRange -AutoSize -TableName Visitors -ExcelChartDefinition $cd +