Open thierryH91200 opened 7 years ago
eh... seems a bug.
I looked into it:
When setting yAxis.axisMaximum
,
in open override func notifyDataSetChanged()
, the input is
_yAxisRenderer?.computeAxis(min: _yAxis._axisMinimum, max: _yAxis._axisMaximum, inverted: _yAxis.isInverted)
however inside computeAxis()
-> computeAxisValues()
in YAxisRendererRadarChart
, computeAxisValues()
is changing axis.entries
and updating _axisMaximum
and _axisMinimum
after getting new entires:
axis._axisMinimum = axis.entries[0]
axis._axisMaximum = axis.entries[n-1]
axis.axisRange = abs(axis._axisMaximum - axis._axisMinimum)
And here come's the dead loop, axisMaximum
is increasing forever if computeAxis()
is called, causing the radar area disappearing.
I remember I modified the code here a long time ago in https://github.com/danielgindi/Charts/pull/207,
however, I just add _yAxis.axisMinimum = _yAxis.entries[0]
, axis._axisMaximum = axis.entries[n-1]
is there all the time.
Looks like an old bug, but I'm not sure if Chart 2.x has the same issue or it happen for Chart 3.x
Not having a clean shot for how to fix it.
Thanks for the explanation I understand better now
axis._axisMinimum = axis.entries[0]
axis._axisMaximum = axis.entries[n-1]
print ("axis._axisMaximum = ", axis._axisMaximum)
axis.axisRange = abs(axis._axisMaximum - axis._axisMinimum)
Log View :
enlarge the window
axis._axisMaximum = 100.0 axis._axisMaximum = 120.0 axis._axisMaximum = 140.0 axis._axisMaximum = 150.0 axis._axisMaximum = 180.0 axis._axisMaximum = 200.0
decrease the window
axis._axisMaximum = 240.0 axis._axisMaximum = 250.0 axis._axisMaximum = 300.0 axis._axisMaximum = 400.0 axis._axisMaximum = 500.0 axis._axisMaximum = 600.0
yep, it just keeps increasing no matter you how you change the window. However I need @danielgindi to give some thoughts for chart 3.x, is it possible to remove it.
In my program inspired by ios demo This is what happens
https://www.dropbox.com/s/r4bmn262esatiuf/screencast%202017-02-28%2010-31-41.mp4?dl=0
If in my program I put in comment the next line?
the problem is solved
https://www.dropbox.com/s/n1vvg4e37m5psxv/screencast%202017-02-28%2010-33-20.mp4?dl=0
OK but why ??