PAP-715 : Y –axis and X –axis values should be display in the yearly graph details.

merge-update-with-lab-changes
Elham Rababh 5 years ago
parent 5d05b09345
commit 7ad4e03c1a

@ -158,19 +158,13 @@ class CurvedChartBloodPressure extends StatelessWidget {
), ),
leftTitles: SideTitles( leftTitles: SideTitles(
showTitles: true, showTitles: true,
interval:getMaxY() - getMinY() <=500?50:getMaxY() - getMinY() <=1000?100:200,
getTextStyles: (value) => const TextStyle( getTextStyles: (value) => const TextStyle(
color: Colors.black, color: Colors.black,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
fontSize: 10, fontSize: 10,
), ),
getTitles: (value) {
if (value.toInt() == 0)
return '${value.toInt()}';
else if (value.toInt() % horizontalInterval == 0)
return '${value.toInt()}';
else
return '';
},
margin: 12, margin: 12,
), ),
), ),

@ -86,7 +86,6 @@ class LineChartCurved extends StatelessWidget {
} }
} }
} }
LineChartData sampleData1(context) { LineChartData sampleData1(context) {
return LineChartData( return LineChartData(
lineTouchData: LineTouchData( lineTouchData: LineTouchData(
@ -131,26 +130,13 @@ class LineChartCurved extends StatelessWidget {
), ),
leftTitles: SideTitles( leftTitles: SideTitles(
showTitles: true, showTitles: true,
interval:getMaxY() - getMinY() <=500?50:getMaxY() - getMinY() <=1000?100:200,
getTextStyles: (value) => const TextStyle( getTextStyles: (value) => const TextStyle(
color: Colors.black, color: Colors.black,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
fontSize: 10, fontSize: 10,
), ),
getTitles: (value) {
// if (value.toInt() == 0)
// return '${value.toInt()}';
// else if (value.toInt() % horizontalInterval == 0)
// return '${value.toInt()}';
// else
// return '';
// if (value.toInt() == 0)
// return '${value.toInt()}';
// else if (value.toInt() % horizontalInterval == 0)
// return '${value.toInt()}';
// else
return '${value.toInt()}';//'${(value.toInt() +(horizontalInterval - value.toInt() % horizontalInterval) )}';
},
margin: 12, margin: 12,
), ),
), ),
@ -175,7 +161,7 @@ class LineChartCurved extends StatelessWidget {
minX: 0, minX: 0,
maxX: (timeSeries.length - 1).toDouble(), maxX: (timeSeries.length - 1).toDouble(),
maxY: getMaxY() + 0.3, maxY: getMaxY() + 0.3,
minY: getMinY(), minY: 0,//getMinY(),
lineBarsData: getData(context), lineBarsData: getData(context),
); );
} }

@ -137,19 +137,21 @@ class MonthCurvedChartBloodPressure extends StatelessWidget {
), ),
leftTitles: SideTitles( leftTitles: SideTitles(
showTitles: true, showTitles: true,
interval:getMaxY() - getMinY() <=500?50:getMaxY() - getMinY() <=1000?100:200,
getTextStyles: (value) => const TextStyle( getTextStyles: (value) => const TextStyle(
color: Colors.black, color: Colors.black,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
fontSize: 10, fontSize: 10,
), ),
getTitles: (value) { // getTitles: (value) {
// if (value.toInt() == 0) // // if (value.toInt() == 0)
// return '${value.toInt()}'; // // return '${value.toInt()}';
// else if (value.toInt() % horizontalInterval == 0) // // else if (value.toInt() % horizontalInterval == 0)
// return '${value.toInt()}'; // // return '${value.toInt()}';
// else // // else
return '${value.toInt()}'; // return '${value.toInt()}';
}, // },
margin: 12, margin: 12,
), ),
), ),

@ -120,14 +120,16 @@ class MonthLineChartCurved extends StatelessWidget {
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
fontSize: 10, fontSize: 10,
), ),
getTitles: (value) { interval:getMaxY() - getMinY() <=500?50:getMaxY() - getMinY() <=1000?100:200,
if (value.toInt() == 0)
return '${value.toInt()}'; // getTitles: (value) {
else if (value.toInt() % horizontalInterval == 0) // if (value.toInt() == 0)
return '${value.toInt()}'; // return '${value.toInt()}';
else // else if (value.toInt() % horizontalInterval == 0)
return ''; // return '${value.toInt()}';
}, // else
// return '';
// },
margin: 12, margin: 12,
), ),
), ),

@ -134,21 +134,8 @@ class LineChartCurved extends StatelessWidget {
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
fontSize: 10, fontSize: 10,
), ),
getTitles: (value) { interval:getMaxY() - getMinY() <=500?getMaxY() - getMinY() <=50?10:50:getMaxY() - getMinY() <=1000?100:getMaxY() - getMinY()>=10000?5000:200,
if (timeSeries.length < 15) {
return '${value.toInt()}';
} else {
if (value == minY)
return '${value.toInt()}';
if (value == getMaxY())
return '${value.toInt()}';
//if (yAxixs.contains(value)) {
return '${value.toInt()}';
return '';
}
return '${value.toInt()}';
},
margin: 12, margin: 12,
), ),
), ),

@ -151,9 +151,8 @@ class LineChartCurvedBloodPressure extends StatelessWidget {
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
fontSize: 10, fontSize: 10,
), ),
getTitles: (value) { interval:getMaxY() - getMinY() <=500?50:getMaxY() - getMinY() <=1000?100:200,
return '${value.toInt()}';
},
margin: 12, margin: 12,
), ),
), ),

Loading…
Cancel
Save