Open praswebdev opened 9 years ago
good idea, I see what I can do with dimension string, maybe with a specific character to handle prefix or suffix.
That would be really useful, i've stumbled upon the need of it.
need time but ok I will stop what I was doing to implement it first ;)
i'm actually WIP with this stuff and came up with this monkey-patch:
At first i added an array of label values to options object
var OPTIONS = {
...
discreteValues: ["value1", "value2", "value3"]
...
}
than in directive i've rewritten the defaults
var OPTIONS = {
from: 0,
to: scope.options.discreteValues.length - 1
...
discreteValues: scope.options.discreteValues
}
and finally just set the value to map to corresponding string in discreteValues array
this.o.labels[pointer.uid].value.html(
this.settings.discreteValues[this.nice(pointer.value.origin)]
);
let me know what you do think i can send a PR if you think this is fine solution
dimension
is given ability to set suffix string, would a prefix string enough for you ?
dimension
"km" : will display "1 km", "2 km", "3 km"...
dimension
">> km " : will display "km 1", "km 2", "km 3"...
I was thinking about that.
You all mean labels on pointers ? we change nothing to scale labels ? ;)
hmm or just display scale value for pointer when pointers on it ?
Thanks for reply!
Suffix string would not be option for me. I need to display strings without numbers :/ I need a value that works like dropdown:
I think binding a model to pointer value would be useful case.
ok, maybe still not closed enough to what you mean but can you check this one:
http://jsfiddle.net/darul75/3kt5mv8w/1/
value binding is set in options with json obj "keyModel:valueLabel"
modelLabels: {1: 'WTF', 2: 'OK'},`
bit it is display on top of pointers ?
Yeah, this fiddle looks like what i need! So the question is how to attach modelLabels to the top fo pointer?
to the bottom you mean ? ;)
Hahaha, yeah! I guess i need one more cup of coffee.
I have to go now but check that asap
Hi, Can we display a label for the slider with steps, which moves with the pointer? Right now i can see the the values 0, 1, 2, etc displayed for step labels. Instead can i display the scale value test1, test2,test3 etc.. $scope.singleoptions = { from: 0, to: 4, step: 1, dimension: " ", scale: ['test1', 'test2', 'test3', 'test4', 'test5'] }; http://jsfiddle.net/g9e9n8xc/67/