Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ This is the exploded view of possbile options (with included defaults)
labelSize: 22, // Popover Heading size
metricSize: 14, // Popover Metric size
opacity: 0.6,
popoverShowData: true // Show the data value of the bubble in the popover
}
}
```
Expand Down
9 changes: 8 additions & 1 deletion src/classes/BubbleChart/Popover.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ class BubbleChart.Popover
@opacity = o.opacity or 0.8
@labelSize = o.labelSize or 18
@metricSize = o.metricSize or 12
@popoverShowData = true
if o.popoverShowData?
@popoverShowData = o.popoverShowData
@last_draw = null
@textDems = {}
@pre = null
Expand Down Expand Up @@ -62,7 +65,11 @@ class BubbleChart.Popover
tb_pad = 5 * ratio
triangle_width = 16 * ratio
triangle_height = 8 * ratio
metric_text = "#{@bubble.data} #{@bubble.metric}"

if this.popoverShowData
metric_text = "#{@bubble.data} #{@bubble.metric}"
else
metric_text = "#{@bubble.metric}"

l_dems = @getTextDems context, @bubble.label, labelSize, @textFont
m_dems = @getTextDems context, metric_text, metricSize, @textFont
Expand Down
2 changes: 2 additions & 0 deletions test/classes/BubbleChart/PopoverTest.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
labelSize: 3,
metricSize: 5,
opacity: 5,
popoverShowData: true
});

equal(popover.fillColor, '#000');
Expand All @@ -37,6 +38,7 @@
equal(popover.labelSize, 3);
equal(popover.metricSize, 5);
equal(popover.opacity, 5);
equal(popover.popoverShowData, true);
});

test('constructor-defaults', function() {
Expand Down