Code Monkey home page Code Monkey logo

poshcharts's People

Contributors

jzabroski avatar proxb avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

poshcharts's Issues

Out-BarChart throws on DataBindXY method

Reproduced as follows

gwmi -class win32_PerfFormattedData_PerfProc_Process -Filter "Name != '_Total' AND Name != 'idle' AND PercentProcessorTime != '0'" | Select Name, @{N='ProcTime';E={$_.PercentProcessorTime}} | Out-BarChart -XField Name -YField ProcTime

Error
168,13 Excetion calling "DataBindXY" with "2" argument(s) "Series data points do not support values of type System.Management.Automation.PSObject only values of these types can be used: Double, Decimal, Single, int, long, uint, ulong, String, DateTime, short, ushort.

$i is undefined in Else clauses when -IncludeLegend and -LegendText parameterset used

Arrange

 Invoke-WebRequest -Uri "http://data.githubarchive.org/2015-01-01-12.json.gz" -OutFile githubarchive2012-01-01-12.json.gz"
 Install-Module PS7Zip -Repository PSGallery -Scope CurrentUser
 Set-ExecutionPolicy RemoteSigned -CurrentUser
 Import-Module PS7Zip
 Expand-7Zip .\githubarchive2012-01-01-12.json.gz
 $data = Get-Content .\githubarchive2012-01-01-12.json | ConvertFrom-Json
 Import-Module .\PoshCharts.psm1
 $plottable = $data | group type;
 $legend = $plottable | select -ExpandProperty name

Act 1

 $plottable | Out-ColumnChart -XField Name -YField Count -IncludeLegend -LegendText $legend -Title "# of Events"

Assert 1

  # Should not throw error - fails

Actual 1

Index operation failed; the array index evaluated to null.
At C:\source\PoshCharts\PoshCharts\Functions\Public\Out-ColumnChart.ps1:172 char:21

  • ... $chart.Series[$SeriesLabel].LegendText = $LegendText[($i- ...
  •             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    • CategoryInfo : InvalidOperation: (:) [], RuntimeException
    • FullyQualifiedErrorId : NullArrayIndex

Act 2

 $data | group type | Out-AreaChart -XField Name -YField Count -IncludeLegend -LegendText $legend -Title "# of Events"

Assert 2

 # Should not throw error - fails

Actual 2

Index operation failed; the array index evaluated to null.
At C:\source\PoshCharts\PoshCharts\Functions\Public\Out-AreaChart.ps1:172 char:21

  • ... $chart.Series[$SeriesLabel].LegendText = $LegendText[($i- ...
  •             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    • CategoryInfo : InvalidOperation: (:) [], RuntimeException
    • FullyQualifiedErrorId : NullArrayIndex

Act 3

$data | group type | Out-BarChart -XField Name -YField Count -IncludeLegend -LegendText $legend -Title "# of Events"

Assert 3

 # Should not throw error - fails

Actual 3

Index operation failed; the array index evaluated to null.
At C:\source\PoshCharts\PoshCharts\Functions\Public\Out-BarChart.ps1:172 char:21

  • ... $chart.Series[$SeriesLabel].LegendText = $LegendText[($i- ...
  •             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    • CategoryInfo : InvalidOperation: (:) [], RuntimeException
    • FullyQualifiedErrorId : NullArrayIndex

etc.

Use Orthogonal Array Testing Strategy (OATS) to test pairwise combination of (charttype, feature) pairs

My previous Issue #10 was getting highly repetitive, and I wanted a way to parameterize my test cases and make them more efficient. Plus, I still haven't bothered learning Pester yet.

Feature 1 - Chart Type

  • AreaChart
  • BarChart
  • BubbleChart
  • ColumnChart
  • DoughnutChart
  • FunnelChart
  • KagiChart
  • LineChart
  • PieChart
  • PointChart
  • PyramidChart
  • SplineChart
  • StackedAreaChart
  • StackedBarChart
  • StackedColumnChart

Feature 2 - With or without legend

  • With combination
  • Without combination

Test cases to use GitHubArchive.com

http://www.githubarchive.org/

GitHubArchive stores all the public events from the GitHub timeline and exposes them for processing. The events contain info about the repositories, so you should be able to pull the data out of there to fit your use-case.

I am inspired by Sourcer.IO, but I do not trust them with my login details, so I thought it would be cool if some test cases also served as an interactive tutorial.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.