Skip to content

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.

2 participants