faheem801 / flot

Automatically exported from code.google.com/p/flot
MIT License
0 stars 0 forks source link

[Patch] Display lines with and without threshold #409

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Flot: 
  version 0.6

Browsers: 
  - Firefox 3.6/4.0
  - Chrome 7.0
  - IE 7.0

Context: 
 I needed to display lines with and without threshold

Code:
  $(function () {
    $.plot($("#placeholder"),
           [{data:      [[1,1], [2,2], [3,3]]
            }
           ,{data:      [[1,4], [2,3], [3,2]]
            ,threshold: {below: 2.5
                        ,color: '#FF0000'
                        }
            }
           ]);
  });

Result:
  - nothing displayed
  - Uncaught TypeError: Cannot read property 'show' of null

Analysis:
  - jquery.flot.threshold.js: 28: default series: { threshold: null }
  - jquery.flot.threshold.js: 33: if (!s.threshold) return;
    --> code does not return for the first serie
    --> Cannot read property 'show' of null

Patch:
  - replace default value null by {}

Original issue reported on code.google.com by role...@gmail.com on 2 Sep 2010 at 3:16

Attachments:

GoogleCodeExporter commented 9 years ago

Original comment by dnsch...@gmail.com on 5 Jun 2012 at 4:11