Changes between Initial Version and Version 2 of Ticket #12408


Ignore:
Timestamp:
Mar 8, 2011, 5:53:57 PM (10 years ago)
Author:
Eugene Lazutkin
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #12408

    • Property Status changed from new to assigned
    • Property Component changed from DojoX Grid to Charting
    • Property Priority changed from high to normal
    • Property Milestone changed from tbd to future
    • Property Owner changed from bryanforbes to Eugene Lazutkin
    • Property Severity changed from blocker to normal
  • Ticket #12408 – Description

    initial v2  
    1 after a zoom on a chart, the tooltip is displayed outside the chart (on bars and columns). I've fixed the problem modifying
     1After 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:
    22
    3 dojox/charting/action2d/Tooltip.js
    4 
    5 at the end of process function place this code:
    6 
     3{{{
     4#!js
    75var lt = dojo.coords(this.chart.node, true);
    86
    9             var chartRect = {
    10                 x: o.chart.offsets.l,
    11                 y: o.chart.offsets.t,
    12                 width: o.chart.plotArea.width,// - o.chart.offsets.l,// - o.chart.offsets.r,
    13                 height: o.chart.plotArea.height// - o.chart.offsets.t// - o.chart.offsets.b
    14             };
     7var chartRect = {
     8  x: o.chart.offsets.l,
     9  y: o.chart.offsets.t,
     10  width: o.chart.plotArea.width,// - o.chart.offsets.l,// - o.chart.offsets.r,
     11  height: o.chart.plotArea.height// - o.chart.offsets.t// - o.chart.offsets.b
     12};
    1513
    16                         aroundRect.x += lt.x;
    17                         aroundRect.y += lt.y;
    18                         aroundRect.x = Math.round(Math.max(aroundRect.x, chartRect.x));
    19                         aroundRect.y = Math.round(Math.max(aroundRect.y, chartRect.y));
    20                         aroundRect.width = Math.ceil(Math.min(aroundRect.width, chartRect.width));
    21                         aroundRect.height = Math.ceil(Math.min(aroundRect.height, chartRect.height));
    22                         this.aroundRect = aroundRect;
     14aroundRect.x += lt.x;
     15aroundRect.y += lt.y;
     16aroundRect.x = Math.round(Math.max(aroundRect.x, chartRect.x));
     17aroundRect.y = Math.round(Math.max(aroundRect.y, chartRect.y));
     18aroundRect.width = Math.ceil(Math.min(aroundRect.width, chartRect.width));
     19aroundRect.height = Math.ceil(Math.min(aroundRect.height, chartRect.height));
     20this.aroundRect = aroundRect;
    2321
    24                         var tooltip = this.text(o);
    25                         if(tooltip){
    26                 dijit.showTooltip(tooltip, this.aroundRect, position);
    27                         }
     22var tooltip = this.text(o);
     23if(tooltip){
     24  dijit.showTooltip(tooltip, this.aroundRect, position);
     25}
     26}}}
    2827
    2928instead of the previous:
    3029
     30{{{
     31#!js
     32
    3133var lt = dojo.coords(this.chart.node, true);
    32                         aroundRect.x += lt.x;
    33                         aroundRect.y += lt.y;
    34                         aroundRect.x = Math.round(aroundRect.x);
    35                         aroundRect.y = Math.round(aroundRect.y);
    36                         aroundRect.width = Math.ceil(aroundRect.width);
    37                         aroundRect.height = Math.ceil(aroundRect.height);
    38                         this.aroundRect = aroundRect;
     34aroundRect.x += lt.x;
     35aroundRect.y += lt.y;
     36aroundRect.x = Math.round(aroundRect.x);
     37aroundRect.y = Math.round(aroundRect.y);
     38aroundRect.width = Math.ceil(aroundRect.width);
     39aroundRect.height = Math.ceil(aroundRect.height);
     40this.aroundRect = aroundRect;
    3941
    40                         var tooltip = this.text(o);
    41                         if(tooltip){
    42                 dijit.showTooltip(tooltip, this.aroundRect, position);
    43                         }
     42var tooltip = this.text(o);
     43if(tooltip){
     44  dijit.showTooltip(tooltip, this.aroundRect, position);
     45}
     46}}}