Search code examples
androidchartsachartengine

What is the purpose of the scale argument in functions such as setYLabelsColor()?


In the achartengine library, the class XYMultipleSeriesRenderer which has two functions:

public void setXLabelsColor(int color)

public void setYLabelsColor(int scale, int color)

setXLabelsColor() intuitively makes sense since one only needs to pass in the color, but for the longest time I could not figure out what the 'scale' argument is for setYLabelsColor did. The docs says, it is "renderer scale", but it is not apparently clear what values scale could be. After messing around with the inputs, I finally got the function to work with a 'scale' value of 0. This does not make intuitive sense to me. I thought that a scale value of 1 would mean the chart keeps its scale. Why does a value of 0 work, whereas a default scale value of 1 doesn't?


Solution

  • Take a look at below image. There are two lines in there, scaled in a separate way, the "Air temperature" on the left having scale = 0 and the "Sunshine hours" on the right having scale = 1. pic
    (source: achartengine.org)