Merge branch 'Aug_fixes' into 'development'

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

See merge request Cloud_Solution/diplomatic-quarter!338
merge-update-with-lab-changes
Sultan khan 5 years ago
commit 772dcba287

@ -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,
), ),
), ),

@ -80,7 +80,6 @@ class LineChartCurved extends StatelessWidget {
} }
} }
} }
LineChartData sampleData1(context) { LineChartData sampleData1(context) {
return LineChartData( return LineChartData(
lineTouchData: LineTouchData( lineTouchData: LineTouchData(
@ -122,26 +121,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,
), ),
), ),
@ -166,7 +152,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,
), ),
), ),

@ -111,14 +111,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