-
9 May 2012 11:00 AM #1
[4.1.0]Ext.chart.axis.Radial with label.display = "categories" problem
[4.1.0]Ext.chart.axis.Radial with label.display = "categories" problem
Some labels are misplaced and have the wrong text. The problem is in drawLabel().
If display = "categories" the value of i should be 0 but instead retains a value assign earlier in the function. The solution would be to explicitly assign i = 0 in this case.Code:if (!this.labelArray) { ... } else { labelArray = this.labelArray; if (display != 'categories') { for (i = 0; i < steps; i++) { labelArray[i].setAttributes({ text: round((i + 1) / steps * maxValue), x: centerX, y: centerY - rho * (i + 1) / steps, 'text-anchor': 'middle', 'stroke-width': 0.1, stroke: '#333' }, true); } } if (display != 'scale') { for (j = 0, steps = categories.length; j < steps; j++) { dx = cos(j / steps * pi2) * (rho + margin); dy = sin(j / steps * pi2) * (rho + margin); if (labelArray[i + j]) { labelArray[i + j].setAttributes({ type: 'text', text: categories[j], x: centerX + dx, y: centerY + dy, 'text-anchor': dx * dx <= 0.001? 'middle' : (dx < 0? 'end' : 'start') }, true); } } } }
Code:if (display != 'categories') { ... } else { i = 0; }
Thank you for reporting this bug. We will make it our priority to review this report.


Reply With Quote