i am trying to change the tooltip label using tooltip property in the ng2-nouislider.
when both min handle and max handle range are collide(are in the same range). then i need to show the tooltip in the form of YYYY-YYYY. please refer below image for the reference.
So in tooltip in config, i am calling MyFormatter class as below
tooltips: [new MyFormatter(this._dataService), new MyFormatter(this._dataService), new MyFormatter(this._dataService)]
And in the MyFormatter class using "to" and "from" methods of NouiFormatter
export class MyFormatter implements NouiFormatter {
to(value: number): string {
let output = value + " Day";
let playerObj = this._dataService.getPlayerObject();
if (value != 1) { output += "s";}
return output;
}
from(value: string): number {
return Number(value.split(" ")[0]);
}
}
Here i need to get min and max range value so that i can check the condition and format the label.
So could you please any one suggest how to get dragged(updated) min and max value here.
Hi All,
i am trying to change the tooltip label using tooltip property in the ng2-nouislider.
when both min handle and max handle range are collide(are in the same range). then i need to show the tooltip in the form of YYYY-YYYY. please refer below image for the reference.
So in tooltip in config, i am calling MyFormatter class as below
tooltips: [new MyFormatter(this._dataService), new MyFormatter(this._dataService), new MyFormatter(this._dataService)]
And in the MyFormatter class using "to" and "from" methods of NouiFormatter
export class MyFormatter implements NouiFormatter { to(value: number): string { let output = value + " Day"; let playerObj = this._dataService.getPlayerObject(); if (value != 1) { output += "s";} return output; }
from(value: string): number { return Number(value.split(" ")[0]); } }
Here i need to get min and max range value so that i can check the condition and format the label. So could you please any one suggest how to get dragged(updated) min and max value here.
Thanks in advance.