Sha256: 6f5276cfbc352095b2d8415d07ceb2637655206243b680b66ccad636cd532f06

Contents?: true

Size: 1.17 KB

Versions: 5

Compression:

Stored size: 1.17 KB

Contents

class FailsGraph
  constructor: (@tests, @fails) ->
  conf: ->

    res =
      options:
        chart:
          plotBackgroundColor: null
          plotBorderWidth: null
          plotShadow: false
          type: 'pie'
      title:
        text: 'Fail Rate'

      tooltip:
        pointFormat: '{series.name}: <b>{point.percentage:.1f}%</b>'
      plotOptions: pie:
        allowPointSelect: true
        cursor: 'pointer'
        dataLabels:
          enabled: true
          format:
            '<b>{point.name}</b>: {point.percentage:.1f} %'
          style:
            color:
              Highcharts.theme and Highcharts.theme.contrastTextColor or 'black'
      series: [ {
        name: 'Results'
        colors: [ '#1FEC33', '#EC243B', '#90ed7d', '#f7a35c', '#8085e9', '#f15c80', '#e4d354', '#2b908f', '#f45b5b', '#91e8e1']
        colorByPoint: true
        data: [
          {
            name: 'Passed Examples'
            y: (@tests.length - @fails.length)
          }
          {
            name: 'Failed Examples'
            y: @fails.length
          }
        ]
      } ]

angular.module("SWAT").factory "FailsGraph", ->
  (tests, fails)->
    new FailsGraph(tests, fails).conf()

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
sw2at-ui-0.0.13 app/assets/javascripts/swat/app/factories/summary/fails_graph.coffee
sw2at-ui-0.0.12 app/assets/javascripts/swat/app/factories/fails_graph.coffee
sw2at-ui-0.0.11 app/assets/javascripts/swat/app/factories/fails_graph.coffee
sw2at-ui-0.0.10 app/assets/javascripts/swat/app/factories/fails_graph.coffee
sw2at-ui-0.0.9 app/assets/javascripts/swat/app/factories/fails_graph.coffee