Opened 9 years ago
Closed 8 years ago
#12408 closed defect (fixed)
Problem with chart's tooltip
Reported by: | kiuma | Owned by: | Eugene Lazutkin |
---|---|---|---|
Priority: | high | Milestone: | 1.7.2 |
Component: | Charting | Version: | 1.6.0rc1 |
Keywords: | Cc: | ||
Blocked By: | Blocking: |
Description (last modified by )
After a zoom on a chart, the tooltip is displayed outside the chart (on bars and columns). I've fixed the problem modifying dojox/charting/action2d/Tooltip.js
at the end of process function place this code:
var lt = dojo.coords(this.chart.node, true); var chartRect = { x: o.chart.offsets.l, y: o.chart.offsets.t, width: o.chart.plotArea.width,// - o.chart.offsets.l,// - o.chart.offsets.r, height: o.chart.plotArea.height// - o.chart.offsets.t// - o.chart.offsets.b }; aroundRect.x += lt.x; aroundRect.y += lt.y; aroundRect.x = Math.round(Math.max(aroundRect.x, chartRect.x)); aroundRect.y = Math.round(Math.max(aroundRect.y, chartRect.y)); aroundRect.width = Math.ceil(Math.min(aroundRect.width, chartRect.width)); aroundRect.height = Math.ceil(Math.min(aroundRect.height, chartRect.height)); this.aroundRect = aroundRect; var tooltip = this.text(o); if(tooltip){ dijit.showTooltip(tooltip, this.aroundRect, position); }
instead of the previous:
var lt = dojo.coords(this.chart.node, true); aroundRect.x += lt.x; aroundRect.y += lt.y; aroundRect.x = Math.round(aroundRect.x); aroundRect.y = Math.round(aroundRect.y); aroundRect.width = Math.ceil(aroundRect.width); aroundRect.height = Math.ceil(aroundRect.height); this.aroundRect = aroundRect; var tooltip = this.text(o); if(tooltip){ dijit.showTooltip(tooltip, this.aroundRect, position); }
Change History (5)
comment:1 Changed 9 years ago by
comment:2 Changed 9 years ago by
Component: | DojoX Grid → Charting |
---|---|
Description: | modified (diff) |
Milestone: | tbd → future |
Owner: | changed from bryanforbes to Eugene Lazutkin |
Priority: | high → normal |
severity: | blocker → normal |
Status: | new → assigned |
comment:3 Changed 8 years ago by
Actually ran into the same problem (using bars), and my fix is a little simpler. In the case "bar" statement, around line 93:
case "bar": aroundRect = lang.clone(o.shape.getShape()); aroundRect.w = aroundRect.width; aroundRect.h = aroundRect.height; break;
It looks to me like the problem is that dijit.Tooltip is looking for w/h as opposed to width/height.
comment:4 Changed 8 years ago by
Milestone: | future → 1.7.2 |
---|
This was fixed using ttrenka suggestion, so let's close this.
comment:5 Changed 8 years ago by
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
Note: See
TracTickets for help on using
tickets.
sorry I had formatting problems the code is: