src/myams/resources/js/ext/flot/jquery.flot.fillbetween.js
changeset 26 f695c11dcd2d
parent 0 f05d7aea098a
equal deleted inserted replaced
25:41732eb0701a 26:f695c11dcd2d
    30 */
    30 */
    31 
    31 
    32 (function ($) {
    32 (function ($) {
    33     var options = {
    33     var options = {
    34         series: {
    34         series: {
    35             fillBetween: null    // or number
    35             fillBetween: null // or number
    36         }
    36         }
    37     };
    37     };
    38 
    38 
    39     function init(plot) {
    39     function init(plot) {
    40         function findBottomSeries(s, allseries) {
    40         function findBottomSeries(s, allseries) {
    58 
    58 
    59         function computeFormat(plot, s, data, datapoints) {
    59         function computeFormat(plot, s, data, datapoints) {
    60             if (s.fillBetween == null) {
    60             if (s.fillBetween == null) {
    61                 return;
    61                 return;
    62             }
    62             }
    63             
    63 
    64             format = datapoints.format;
    64             var format = datapoints.format;
    65             var plotHasId = function(id) {
    65             var plotHasId = function(id) {
    66                 var plotData = plot.getData();
    66                 var plotData = plot.getData();
    67                 for (i = 0; i < plotData.length; i++) {
    67                 for (var i = 0; i < plotData.length; i++) {
    68                     if (plotData[i].id === id) {
    68                     if (plotData[i].id === id) {
    69                         return true;
    69                         return true;
    70                     }
    70                     }
    71                 }
    71                 }
    72 
    72 
    74             }
    74             }
    75 
    75 
    76             if (!format) {
    76             if (!format) {
    77                 format = [];
    77                 format = [];
    78 
    78 
    79                 format.push({ 
    79                 format.push({
    80                     x: true, 
    80                     x: true,
    81                     number: true, 
    81                     number: true,
    82                     computeRange: s.xaxis.options.autoScale !== 'none',
    82                     computeRange: s.xaxis.options.autoScale !== 'none',
    83                     required: true 
    83                     required: true
    84                 });
    84                 });
    85                 format.push({ 
    85                 format.push({
    86                     y: true, 
    86                     y: true,
    87                     number: true, 
    87                     number: true,
    88                     computeRange: s.yaxis.options.autoScale !== 'none',
    88                     computeRange: s.yaxis.options.autoScale !== 'none',
    89                     required: true 
    89                     required: true
    90                 });
    90                 });
    91 
    91 
    92                 if (s.fillBetween !== undefined && s.fillBetween !== '' && plotHasId(s.fillBetween) && s.fillBetween !== s.id) {
    92                 if (s.fillBetween !== undefined && s.fillBetween !== '' && plotHasId(s.fillBetween) && s.fillBetween !== s.id) {
    93                     format.push({
    93                     format.push({
    94                         x: false,
    94                         x: false,