EXTJS 4 Gauge Chart Tool Tip not working?
i am using EXTJS 4 Gauge Chart. and i want to display extjs4 charts tool tip. but tool tip is not working in extjs Gauge Chart.
Thanks & Regards, Gaur开发者_StackOverflowavp
This is currently a reported issue in ExtJS 4.0.6 and earlier. See here for details on the sencha forums
The problem appears to be because the gauge chart does not implement isItemInPoint, it will never support highlighting or tips - isItemInPoint is used by the getItemForPoint function of a chart series to determine which item in the series is located at an x/y coordinate.
On the same sencha forum post a user "minneyar" has proposed a work-around for now by implementing the isItemInPoint method on the Gauge series prototype, here's the code for that:
Ext.chart.series.Gauge.override({
isItemInPoint: function(x, y, item, i) {
var chartBBox = this.chart.chartBBox;
var centerX = this.centerX = chartBBox.x + (chartBBox.width / 2);
var centerY = this.centerY = chartBBox.y + chartBBox.height;
var outerRadius = Math.min(centerX - chartBBox.x, centerY - chartBBox.y);
var innerRadius = outerRadius * +this.donut / 100;
var r = Math.sqrt(Math.pow(centerX-x, 2) + Math.pow(centerY-y,2));
return r > innerRadius && r < outerRadius;
}
});
精彩评论