Tailoring a Coordinate Mapping
When converting rectangular to polar coordinates, you can choose to map only one of the dimensions. Use the PolarCoord Type property to do this.
Mapping just a single dimension is useful for pie charts. See Example: Pie Chart.
The example below is the same as that in Converting Rectangular to Polar Coordinates, except that here only the angle dimension is mapped:
Note: Script that modifies 'graph' should be placed at the element level. See Adding Element-Level Script in Report Scripting and Adding Component Script in Dashboard Scripting for more information.
dataset = [["Direction", "Score"],[(Math.PI/2),20],[(Math.PI/4),30],[(Math.PI),35]];
graph = new EGraph();
var elem = new PointElement("Direction", "Score");
var xscale = new LinearScale("Direction");
var yscale = new LinearScale("Score");
yscale.setMin(0);
yscale.setMax(40);
var yaxis = new AxisSpec();
yaxis.setGridStyle(Chart.DOT_LINE);
yscale.setAxisSpec(yaxis);
xscale.setMin(0);
xscale.setMax(1.95*Math.PI);
xscale.setIncrement(Math.PI/8);
var xaxis = new AxisSpec();
var tspec = new TextSpec();
tspec.setFormat(new java.text.DecimalFormat("0.0"));
xaxis.setTextSpec(tspec);
xaxis.setGridStyle(Chart.DOT_LINE);
xscale.setAxisSpec(xaxis);
graph.setScale("Direction",xscale);
graph.setScale("Score",yscale);
var rect = new RectCoord(xscale,yscale);
var polar = new PolarCoord(rect);
polar.setType(PolarCoord.THETA);
graph.setCoordinate(polar);
graph.addElement(elem);

The result is that all points have the same magnitude, with variation only along the angle dimension. To reverse a mapping, use the Coordinate object's transpose() method.
| << Converting Rectangular to Polar Coordinates | © 1996-2013 InetSoft Technology Corporation (v11.5) | Example: Pie Chart >> |