More fluent for the api

This commit is contained in:
Doug Finke
2016-04-07 21:42:38 -04:00
parent c5503f79d8
commit fd1776432c
2 changed files with 25 additions and 4 deletions

View File

@@ -20,6 +20,21 @@ iex (new-object System.Net.WebClient).DownloadString('https://raw.github.com/dfi
# What's new
#### 4/7/2016
Made more methods fluent
```
$t=Get-Range 0 5 .2
$t2=$t|%{$_*$_}
$t3=$t|%{$_*$_*$_}
(New-Plot).
Plot($t,$t, $t,$t2, $t,$t3).
SetChartPosition("i").
SetChartSize(500,500).
Title("Hello World").
Show()
```
#### 3/31/2016
* Thanks to [redoz](https://github.com/redoz) Multi Series Charts are now working

View File

@@ -122,9 +122,11 @@ class PSPlot {
return $this
}
SetChartPosition($yCol) {
[PSPLot] SetChartPosition($yCol) {
$columnNumber = $this.GetColumnNumber($yCol)+1
$this.chart.SetPosition(1,0,$columnNumber,0)
$this.chart.SetPosition(1,0,$columnNumber,0)
return $this
}
AddSeries($xCol,$yCol,$yValues) {
@@ -194,12 +196,16 @@ class PSPlot {
$this.SetChartSize(300,300)
}
SetChartSize([int]$width,[int]$height){
[PSPlot] SetChartSize([int]$width,[int]$height){
$this.chart.SetSize($width, $height)
return $this
}
Title($title) {
[PSPlot] Title($title) {
$this.chart.Title.Text = $title
return $this
}
Show() {