Skip to content

feat(ticks): Add legend support #318

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 24, 2016
Merged

feat(ticks): Add legend support #318

merged 1 commit into from
Apr 24, 2016

Conversation

ValentinH
Copy link
Member

@ValentinH ValentinH commented Apr 24, 2016

This feature enables to display legend under each slider tick.

A new getLegend option has been added that works pretty much like the translate function:

getLegend: function(value, sliderId) {
    if (value !== 0)
        return 'legend' + value; // will display 'legendX` under each tick
   return null; // won't display any legend
}

Also, now stepsArray handles objects like {value: 12} or {value: 1, legend: 'Legend for 1'}.

In order to get enough space to display legends under the slider, you need to add the with-legend class to the slider component. The default margin-bottom is then 40px which is enough for legend that are displayed on 2 lines. If you need more, simply override the style for the class.

Demo: http://jsfiddle.net/45y4hmzt/

This feature enables to display legend under each slider tick.
@ValentinH ValentinH merged commit d64b96b into master Apr 24, 2016
@ValentinH ValentinH deleted the legend-support branch June 4, 2016 10:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant