Add support for custom x and y axis format functions and rotating the labels

Is there any better way to set default values to the variable than testing in an if?