LCOV - code coverage report
Current view: top level - chart - chart_line.dart (source / functions) Hit Total Coverage
Test: lcov_filtered.info Lines: 19 19 100.0 %
Date: 2019-08-23 11:26:09 Functions: 0 0 -

          Line data    Source code
       1             : import 'dart:ui';
       2             : 
       3             : import 'package:fl_animated_linechart/chart/chart_point.dart';
       4             : 
       5             : class ChartLine {
       6             :   final List<ChartPoint> points;
       7             :   final Color color;
       8             :   final String unit;
       9             : 
      10             :   double _minX = 0;
      11             :   double _minY = 0;
      12             :   double _maxX = 0;
      13             :   double _maxY = 0;
      14             : 
      15           2 :   ChartLine(this.points, this.color, this.unit) {
      16           6 :     if (points.length > 0) {
      17           8 :       _minX = points[0].x;
      18           8 :       _maxX = points[0].x;
      19           8 :       _minY = points[0].y;
      20           8 :       _maxY = points[0].y;
      21             :     }
      22             : 
      23           6 :     points.forEach((p) {
      24           6 :       if (p.x < _minX) {
      25           2 :         _minX = p.x;
      26             :       }
      27           6 :       if (p.x > _maxX) {
      28           4 :         _maxX = p.x;
      29             :       }
      30           6 :       if (p.y < _minY) {
      31           4 :         _minY = p.y;
      32             :       }
      33           6 :       if (p.y > _maxY) {
      34           4 :         _maxY = p.y;
      35             :       }
      36             :     });
      37             :   }
      38             : 
      39           4 :   double get minX => _minX;
      40           4 :   double get minY => _minY;
      41           4 :   double get maxX => _maxX;
      42           4 :   double get maxY => _maxY;
      43             : }

Generated by: LCOV version 1.14