Android Question [xChart] Force axis to start from 0

angel_

Well-Known Member
Licensed User
Longtime User
Although autoscale works very well, sometimes, I would like to force the 'y' axis to start from 0, is this possible?
 

Attachments

  • Screenshot_20200422-125506.jpg
    Screenshot_20200422-125506.jpg
    67.2 KB · Views: 245

klaus

Expert
Licensed User
Longtime User
I would like to force the 'y' axis to start from 0, is this possible?
For logarithmic scales it is mathematically IMPOSSIBLE.
You can set the min value to 1, 0.1, 0.01, 0.001 etc but NOT to 0!

What you can do is to set manual scales, for example:
B4X:
    LineChart1.YScaleLogaritmic = True
    LineChart1.AutomaticScale = False
    LineChart1.YMinValue = 0.1
    LineChart1.YMaxValue = 500

While testing I found a bug with manual logarithmic scales, the xChart thread has been updated.
 
Upvote 0

Mahares

Expert
Licensed User
Longtime User
What you can do is to set manual scales,
Can you perhaps do something like this based on a given filter or criteria:
B4X:
Dim v As Int =Rnd(.1, 10001)  'certain criteria
         If v < = 100 Then
              chart.AutomaticScale = True
         Else
               chart.YScaleMinValue =1
          End If
 
Upvote 0
Top