| 1 |
define(["dojo/_base/declare", "dojo/dom-style"], |
| 2 |
function(declare, domStyle){ |
| 3 |
|
| 4 |
|
| 5 |
return declare(null, { |
| 6 |
_recheckPosition: function(obj,rect,position){ |
| 7 |
if(!this.chart.isRightToLeft()){ |
| 8 |
return; |
| 9 |
} |
| 10 |
var shift = this.chart.offsets.l - this.chart.offsets.r; |
| 11 |
if(obj.element == "marker"){ |
| 12 |
rect.x = this.chart.dim.width - obj.cx + shift; |
| 13 |
position[0] = "before-centered"; |
| 14 |
position[1] = "after-centered"; |
| 15 |
} |
| 16 |
else if(obj.element == "circle"){ |
| 17 |
rect.x = this.chart.dim.width - obj.cx - obj.cr + shift; |
| 18 |
} |
| 19 |
else if(obj.element == "bar" || obj.element == "column"){ |
| 20 |
rect.x = this.chart.dim.width - rect.width - rect.x + shift; |
| 21 |
if(obj.element == "bar"){ |
| 22 |
position[0] = "before-centered"; |
| 23 |
position[1] = "after-centered"; |
| 24 |
} |
| 25 |
} |
| 26 |
else if(obj.element == "candlestick"){ |
| 27 |
rect.x = this.chart.dim.width + shift - obj.x; |
| 28 |
} |
| 29 |
else if(obj.element == "slice"){ |
| 30 |
if((position[0] == "before-centered") || (position[0] == "after-centered")) { |
| 31 |
position.reverse(); |
| 32 |
} |
| 33 |
rect.x = obj.cx + (obj.cx - rect.x); |
| 34 |
} |
| 35 |
}, |
| 36 |
|
| 37 |
_format: function(tooltip){ |
| 38 |
var isChartDirectionRtl = (domStyle.get(this.chart.node, "direction") == "rtl"); |
| 39 |
var isBaseTextDirRtl = (this.chart.getTextDir(tooltip) == "rtl"); |
| 40 |
if(isBaseTextDirRtl && !isChartDirectionRtl){ |
| 41 |
return "<span dir = 'rtl'>" + tooltip +"</span>"; |
| 42 |
} |
| 43 |
else if(!isBaseTextDirRtl && isChartDirectionRtl){ |
| 44 |
return "<span dir = 'ltr'>" + tooltip +"</span>"; |
| 45 |
}else{ |
| 46 |
return tooltip; |
| 47 |
} |
| 48 |
} |
| 49 |
}); |
| 50 |
}); |
| 51 |
|