Y axis tick label should only show non decimal values / whole numbers as as series . if i set set TickUnit to 1 it should be 1,2,3,4,5,.. if i set Unit Ticks to 2 ..2,4,6,8,.. if i set to 5 5,10,15,20,25.
i set the Unit Ticks to 1 still it sometimes adding the decimal values also and showing 2.5 ,5.0,7.5,10.0,12.5......how to prevent this and show only whole numbers(Non decimal Numbers).?
Asked
Active
Viewed 726 times
3

jawath
- 439
- 7
- 22
-
Same doubt here – Bruno Canongia Aug 04 '19 at 13:16
1 Answers
-2
option 1. store the number as an int, int num = (int)Math.floor(myDouble);
option 2. in your method make the parameter a double and inside the method cast it to an int this will allow you to use the method with both a double and a int. Please keep in mind that this is C# code but java should be very similar.
private List<int> numberSeries(double aDouble)
{
List<int> number = new List<int>();
int base = (int)Math.floor(aDouble);
for(int x = 1;x++ < 10) //change 10 to whatever you want
{
number.Add(aDouble * x);
}
return number;
}

Jacques
- 13
- 3