I have a list of several DateTimes.
The DateTime is actually a String in HH:mm:ss format which i convert to DateTime.
From this list i retrieve the largest value (in minutes)
I calculate the total Minutes like the following:
//t is a DateTime
Double totalMin = TimeSpan.Parse(t.ToString()).TotalMinutes;
The largest value (in minutes) should be used as the “100%” value.
I already have calculated the largest value of the list.
Meaning all the other values (also in minutes) in the list will be calculate based on this value.
The other lower values have to scale on this max value in other words.
This will be used in a bar chart. So the largest value will take the most space followed by the lower values.
How exactly can i do this?
Thanks PeterP.
You want to know how to calculate a percentage? Divide the current by the max and multiply it with 100. Then you can format the percentage like you want (like “20%”, “20.2%”, …).