Thomas
Thomas

Reputation: 2767

Cant transform y axis of flot graph

Is there any limitation towards transforming the y axis of a flot graph, or any reason why the following transformation option would not work?

yaxis: {
    transform: function(v) { return v*10; },
    inversetransform : function(v) { return v/10; }
}

I've created a test example in this fiddle. Commenting or commenting the y-axis transformation lines doesn't seem to affect the Y points, but I do not see any error in the syntax of the code... Is there a problem with the code? Or is there a reason why the maximum Y should not have been transformed to 36360 after I apply the transformation?

Upvotes: 0

Views: 359

Answers (1)

Thomas
Thomas

Reputation: 2767

Thanks to @Mark for pointing out that the transform option operates only in the axis, but not on the data. I've completely overlooked that =S

I guess the solution to the problem is simply to loop into your data and transform it before you call flot.

Upvotes: 1

Related Questions