(range, ax)
| 691 | // this function should be (and is) called before reversing the range |
| 692 | // so range[0] is the minimum and range[1] is the maximum |
| 693 | function applyAutorangeOptions(range, ax) { |
| 694 | if(!ax || !ax.autorangeoptions) return range; |
| 695 | |
| 696 | var min = range[0]; |
| 697 | var max = range[1]; |
| 698 | |
| 699 | var include = ax.autorangeoptions.include; |
| 700 | if(include !== undefined) { |
| 701 | var lMin = ax.d2l(min); |
| 702 | var lMax = ax.d2l(max); |
| 703 | |
| 704 | if(!Lib.isArrayOrTypedArray(include)) include = [include]; |
| 705 | for(var i = 0; i < include.length; i++) { |
| 706 | var v = ax.d2l(include[i]); |
| 707 | if(lMin >= v) { |
| 708 | lMin = v; |
| 709 | min = v; |
| 710 | } |
| 711 | if(lMax <= v) { |
| 712 | lMax = v; |
| 713 | max = v; |
| 714 | } |
| 715 | } |
| 716 | } |
| 717 | |
| 718 | min = applyAutorangeMinOptions(min, ax); |
| 719 | max = applyAutorangeMaxOptions(max, ax); |
| 720 | |
| 721 | return [min, max]; |
| 722 | } |
no test coverage detected
searching dependent graphs…