sam
sam

Reputation: 2355

flot chart- difference in starting point of x axis

I am trying to draw more than one chart inside a single page, each charts aligned to the center of the page, one below the other. I have given fixed with for graph canvas. Since tick values have different ranges, for example, one graph has y axis range [0-10], another has [0 - 10000], the width of y axis ticks are different for each graph. That somehow brings a bad user experience, as the starting point of x axis of each graph differs.

Is it possible to provide x axis width separately in flot chart, or is there any other solution to get all the graphs aligned, starting from same point.

I am attaching a sample sketch for better understanding of the issue. sample sketch to show the alignment issue

Upvotes: 0

Views: 740

Answers (1)

atomman
atomman

Reputation: 2505

From the flot API:

"labelWidth" and "labelHeight" specifies a fixed size of the tick labels in pixels. They're useful in case you need to align several plots. "reserveSpace" means that even if an axis isn't shown, Flot should reserve space for it - it is useful in combination with labelWidth and labelHeight for aligning multi-axis charts.

Upvotes: 3

Related Questions