问题
I am facing a very serious bug using graphael. Therefore, I want to change the procedure it uses to calculate the maximum value for the y axis. However, It's way to confusing for me, and I cannot find it. Can anyone help me to change that procedure?
回答1:
Sorry, I don't have any experience with gRaphael, but since no one else has answered, I might be able to help you somewhat...
The code for gRaphael's LineChart is located here.
Normally, I would suggest overriding the function that calculates the y axis max value, but since that object is enclosed in a private scope, you will only be able to change the code, directly, through a local copy of that file.
I only skimmed the code, but was not able to find where in it the actual calculation was being done.
回答2:
It calculates them through the .snapEnds()
method in gRaphael core. If you want, you can expose the values to the linechart options using this method.
来源:https://stackoverflow.com/questions/21098797/where-does-graphael-line-chart-calculates-its-maximum-value