mirror of
https://github.com/dfinke/ImportExcel.git
synced 2025-12-06 00:23:20 +00:00
Merge remote-tracking branch 'origin/master'
# Conflicts: # Install.ps1
This commit is contained in:
26
Examples/Charts/plot.ps1
Normal file
26
Examples/Charts/plot.ps1
Normal file
@@ -0,0 +1,26 @@
|
||||
function plot {
|
||||
param(
|
||||
$f,
|
||||
$minx,
|
||||
$maxx
|
||||
)
|
||||
|
||||
$minx=[math]::Round($minx,1)
|
||||
$maxx=[math]::Round($maxx,1)
|
||||
|
||||
$file = 'C:\temp\plot.xlsx'
|
||||
rm $file -ErrorAction Ignore
|
||||
|
||||
$c = New-ExcelChart -XRange X -YRange Y -ChartType Line -NoLegend -Title Plot -Column 2 -ColumnOffSetPixels 35
|
||||
|
||||
$(for ($i = $minx; $i -lt $maxx-.1; $i+=.1) {
|
||||
[pscustomobject]@{
|
||||
X=$i.ToString("N1")
|
||||
Y=(&$f $i)
|
||||
}
|
||||
}) | Export-Excel $file -Show -AutoNameRange -ExcelChartDefinition $c
|
||||
}
|
||||
|
||||
function pi {[math]::pi}
|
||||
|
||||
plot {[math]::Tan($args[0])} (pi) (3*(pi)/2-.01)
|
||||
BIN
images/plot.gif
Normal file
BIN
images/plot.gif
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 317 KiB |
Reference in New Issue
Block a user