I have a getx Controller. In it i have declared two variables, which will be updated
var percentageEVS = 0.obs;
var percentOthers =0.obs;
Im trying to change the values of these variables using the following function
calculatespentTime(){
final totalDuration = dashboard[0].duration??0;
final durationEVS = dashboard[1].duration!.toInt();
final _percentageEVS = (durationEVS/totalDuration)*100;
percentageEVS.value = _percentageEVS.toInt() ;
}
How ever I'm not getting the changed values
final List<ChartData> chartData = [
ChartData(x: 'Maths', y:_controller.percentageEVS.value.toDouble(), color: Colors.red),
ChartData(x: 'English', y: 38, color: Colors.blue),
]
How can i get the changed value and pass it to chartData??