From 27c701112d9bbbd99efa495668a3414414bdc0d6 Mon Sep 17 00:00:00 2001 From: David Schnur Date: Sun, 3 Mar 2013 17:32:29 -0500 Subject: [PATCH] Updated the API docs for axis text changes. --- API.md | 29 +++++++++++++++++++++++------ 1 file changed, 23 insertions(+), 6 deletions(-) diff --git a/API.md b/API.md index bcf5d25..c474fd8 100644 --- a/API.md +++ b/API.md @@ -266,11 +266,27 @@ you can also set the color of the ticks separately with "tickColor" (otherwise it's autogenerated as the base color with some transparency). -You can customize the font used to draw the labels with CSS or -directly with "font". The default value of null means that the font is -read from the font style on the placeholder element (80% the size of -that to be precise). If you set it directly with "font: { ... }", the -format is like this: +You can customize the font used to draw the labels with CSS or directly via the +"font" option. When "font" is null - the default - each tick label is given the +'flot-tick-label' class. For compatibility with Flot 0.7 and earlier the labels +are also given the 'tickLabel' class, but this is deprecated and scheduled to +be removed with the release of version 1.0.0. + +To enable more granular control over styles, labels are divided between a set +of text containers, with each holding the labels for one axis. These containers +are given the classes 'flot-text', 'flot-[x|y]-axis', and 'flot-[x|y]#-axis', +where '#' is the number of the axis when there are multiple axes. For example, +the x-axis labels for a simple plot with only one x-axis might look like this: + +```html +
+
January 2013
+ ... +
+``` + +For direct control over label styles you can also provide "font" as an object +with this format: ```js { @@ -278,7 +294,8 @@ format is like this: style: "italic", weight: "bold", family: "sans-serif", - variant: "small-caps" + variant: "small-caps", + color: "#545454" } ```