Permalink
Browse files

Updated the API docs for axis text changes.

  • Loading branch information...
1 parent bb0acac commit 27c701112d9bbbd99efa495668a3414414bdc0d6 @dnschnur dnschnur committed Mar 3, 2013
Showing with 23 additions and 6 deletions.
  1. +23 −6 API.md
View
@@ -266,19 +266,36 @@ 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
+<div class='flot-text flot-x-axis flot-x1-axis'>
+ <div class='flot-tick-label'>January 2013</div>
+ ...
+</div>
+```
+
+For direct control over label styles you can also provide "font" as an object
+with this format:
```js
{
size: 11,
style: "italic",
weight: "bold",
family: "sans-serif",
- variant: "small-caps"
+ variant: "small-caps",
+ color: "#545454"
}
```

0 comments on commit 27c7011

Please sign in to comment.