Skip to content

Commit

Permalink
Was added format applying for hints (#22)
Browse files Browse the repository at this point in the history
* Was added format applying for hints
  • Loading branch information
EugeneElkin authored and ignatvilesov committed Sep 14, 2017
1 parent ffbd2ca commit 3867eb2
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 3 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
## 1.3.2
* FIX. Applying of value format to tooltip values

## 1.3.1
* FIX. Option for showing of special characters was repaired

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "powerbi-visuals-wordcloud",
"version": "1.3.1",
"version": "1.3.2",
"description": "Word Cloud is a visual representation of word frequency and value. Use it to get instant insight into the most important terms in a set.",
"repository": {
"type": "git",
Expand Down
2 changes: 1 addition & 1 deletion pbiviz.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"displayName": "WordCloud",
"guid": "WordCloud1447959067750",
"visualClassName": "WordCloud",
"version": "1.3.1",
"version": "1.3.2",
"description": "Word Cloud is a visual representation of word frequency and value. Use it to get instant insight into the most important terms in a set.",
"supportUrl": "http://community.powerbi.com",
"gitHubUrl": "https://github.com/Microsoft/PowerBI-visuals-WordCloud"
Expand Down
12 changes: 11 additions & 1 deletion src/visual.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1503,10 +1503,20 @@ module powerbi.extensibility.visual {
.each("end", callback);
}
private renderTooltip(selection: UpdateSelection<WordCloudDataPoint>): void {
let categorical: WordCloudColumns<DataViewCategoryColumn> = WordCloudColumns.getCategoricalColumns(this.incomingUpdateOptions.dataViews[0]),
wordValueFormatter: IValueFormatter = null;

if (categorical.Values && categorical.Values[0]) {
wordValueFormatter = ValueFormatter.create({
format: ValueFormatter.getFormatStringByColumn(categorical.Values[0].source)
});
}

this.tooltipService.addTooltip(selection, (tooltipEvent: TooltipEventArgs<WordCloudDataPoint>) => {
let item = wordValueFormatter !== null ? wordValueFormatter.format(tooltipEvent.data.count) : tooltipEvent.data.count;
return [{
displayName: tooltipEvent.data.text,
value: tooltipEvent.data.count.toString()
value: item.toString()
}];
});
}
Expand Down

0 comments on commit 3867eb2

Please sign in to comment.