forked from wger-project/flutter
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request wger-project#449 from wger-project/fix/replace-cha…
…rt-lib Replace chart lib
- Loading branch information
Showing
32 changed files
with
1,231 additions
and
670 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
double chartGetInterval(DateTime first, DateTime last, {divider = 3}) { | ||
final dayDiff = last.difference(first); | ||
|
||
return dayDiff.inMilliseconds == 0 ? 1000 : dayDiff.inMilliseconds.abs() / divider; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
import 'dart:math'; | ||
import 'dart:ui'; | ||
|
||
const LIST_OF_COLORS8 = [ | ||
Color(0xFF2A4C7D), | ||
Color(0xFF5B5291), | ||
Color(0xFF8E5298), | ||
Color(0xFFBF5092), | ||
Color(0xFFE7537E), | ||
Color(0xFFFF6461), | ||
Color(0xFFFF813D), | ||
Color(0xFFFFA600), | ||
]; | ||
|
||
const LIST_OF_COLORS5 = [ | ||
Color(0xFF2A4C7D), | ||
Color(0xFF825298), | ||
Color(0xFFD45089), | ||
Color(0xFFFF6A59), | ||
Color(0xFFFFA600), | ||
]; | ||
|
||
const LIST_OF_COLORS3 = [ | ||
Color(0xFF2A4C7D), | ||
Color(0xFFD45089), | ||
Color(0xFFFFA600), | ||
]; | ||
|
||
Iterable<Color> generateChartColors(int nrOfItems) sync* { | ||
final List<Color> colors; | ||
|
||
if (nrOfItems <= 3) { | ||
colors = LIST_OF_COLORS3; | ||
} else if (nrOfItems <= 5) { | ||
colors = LIST_OF_COLORS5; | ||
} else { | ||
colors = LIST_OF_COLORS8; | ||
} | ||
|
||
for (final color in colors) { | ||
yield color; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.