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?
In mathematics, an argument of a function is a value provided to obtain the function's result. It is also called an independent variable. , is called a unary function.
The terms parameter and argument can be used for the same thing: information that are passed into a function. From a function's perspective: A parameter is the variable listed inside the parentheses in the function definition. An argument is the value that are sent to the function when it is called.
Here are simple rules to define a function in Python. Function blocks begin with the keyword def followed by the function name and parentheses ( ( ) ). Any input parameters or arguments should be placed within these parentheses. You can also define parameters inside these parentheses.
There are two ways to pass arguments to a function: by reference or by value. Modifying an argument that's passed by reference is reflected globally, but modifying an argument that's passed by value is reflected only inside the function.
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.
(source: achartengine.org)
I believe that scale is meant to refer to which series that you are editing. In a multipleXYseriesrenderer, the scale number refers to the "nth" series you entered. For example, if you only have 1 series, then editing scale "0" will edit only that series. This is what my understanding is, although I cannot say for certain. IT seems that the documentation could certainly use some cleaning up.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With