Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
F
flot
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
HS-public
flot
Commits
f90481b5
Commit
f90481b5
authored
Jul 15, 2012
by
David Schnur
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added docs for the legend sorted option.
parent
375c06aa
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
0 deletions
+16
-0
API.txt
API.txt
+16
-0
No files found.
API.txt
View file @
f90481b5
...
...
@@ -141,6 +141,7 @@ Customizing the legend
backgroundColor: null or color
backgroundOpacity: number between 0 and 1
container: null or jQuery object/DOM element/jQuery expression
sorted: null/false, true, "ascending", "descending" or a comparator
}
The legend is generated as a table with the data series labels and
...
...
@@ -167,6 +168,21 @@ specify "container" as a jQuery object/expression to put the legend
table into. The "position" and "margin" etc. options will then be
ignored. Note that Flot will overwrite the contents of the container.
Legend entries appear in the same order as their series by default. To
sort them alphabetically, you can specify "sorted" as tue, "ascending"
or "descending", where true and "ascending" are equivalent.
You can also provide your own comparator function that accepts two
objects with "label" and "color" properties, and returns zero if they
are equal, a positive value if the first is greater than the second,
and a negative value if the first is less than the second.
sorted: function(a, b) {
// sort alphabetically in ascending order
return a.label == b.label ? 0 : (
a.label > b.label ? 1 : -1
)
}
Customizing the axes
====================
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment