Product Information: API for Rendering Charts
Polar coordinates represent data in terms of an angle and magnitude (radius). They are defined by the
PolarCoord object, which accepts a RectCoord object as input. The following sections explain how to create and
modify polar coordinates. They also demonstrate a common use of polar coordinates, the pie chart.
Converting Rectangular to Polar Coordinates To use polar coordinates, you first need to create a set of
rectangular coordinates. Consider the script from the previous section, Rectangular Coordinates:
importPackage(inetsoft.graph)
importPackage(inetsoft.graph.element)
importPackage(inetsoft.graph.scale)
importPackage(inetsoft.graph.aesthetic)
importPackage(inetsoft.graph.coord)
importPackage(inetsoft.graph.data)
var arr = [["Direction", "Score"],
[(Math.PI/2),20],
[(Math.PI/4),30],
[(Math.PI),35]];
dataset = new DefaultDataSet(arr);
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(GraphConstants.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(GraphConstants.DOT_LINE);
xscale.setAxisSpec(xaxis);
graph.setScale("Direction",xscale);
graph.setScale("Score",yscale);
var rect = new RectCoord(xscale,yscale);
graph.setCoordinate(rect);
graph.addElement(elem);
Note that this script explicitly creates a set of rectangular coordinates by calling the RectCoord
constructor. To convert the chart to a polar coordinate system, use this RectCoord object to create a new
PolarCoord object:
var polar = new PolarCoord(rect);
Assign this new coordinate set to the chart to obtain the desired polar representation. The modified script
is shown below:
importPackage(inetsoft.graph)
importPackage(inetsoft.graph.element)
importPackage(inetsoft.graph.scale)
importPackage(inetsoft.graph.aesthetic)
importPackage(inetsoft.graph.coord)
var arr = [["Direction", "Score"],
[(Math.PI/2),20],
[(Math.PI/4),30],
[(Math.PI),35]];
dataset = new inetsoft.graph.data.DefaultDataSet(arr);
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(GraphConstants.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(GraphConstants.DOT_LINE);
xscale.setAxisSpec(xaxis);
graph.setScale("Direction",xscale);
graph.setScale("Score",yscale);
var rect = new RectCoord(xscale,yscale);
var polar = new PolarCoord(rect);
graph.setCoordinate(polar);
graph.addElement(elem);
More Articles About Charts
Evaluate InetSoft's Decision Support System Dashboards - Are you looking for good decision support system dashboards? InetSoft's pioneering dashboard reporting application produces great-looking web-based dashboards with an easy-to-use drag-and-drop designer. View a demo and try interactive examples. All new customers get mentoring assistance for free to speed up their project delivery...
Example of a Facebook Ads Manager Visual Analysis - This example above illustrates the analysis of Facebook Ads performance. With Facebook's built-in reporting interface you can filter on all of the PPC metrics, but you can only sort on one at a time, which quickly frustrates you when you are trying to simultaneously maximize or minimize two of them, such as conversion rate and click through rate...
False Positives Percentage - False positives are instances that were first classified as dangers but were subsequently shown to be harmless. An excessive number of false positives suggests that the risk detection system is inefficient, which might cause the team to be overburdened with pointless inquiries. An effective risk detection system works to minimize false positives so the team may concentrate on real threats...
Ocean Shipping Analyst - A Shipping Analyst at an ocean freight transportation company plays a crucial role in ensuring the efficient and cost-effective movement of goods across the seas. Their responsibilities involve conducting various analyses to optimize shipping operations. Here are some key analyses that a Shipping Analyst might perform: Route Optimization Analysis: Evaluate different shipping routes to identify the most efficient and cost-effective paths. Consider factors such as distance, transit time, fuel costs, and potential risks (e.g., weather conditions, piracy)...
Product Return Advanced Analytics - Advanced analytics on product return data involves utilizing sophisticated data analysis techniques and tools to extract valuable insights from data related to product returns. This information can help businesses improve product quality, enhance customer satisfaction, optimize supply chain processes, and ultimately reduce return rates. Here, we explore the various advanced analytics techniques applied to product return data, their definitions, and their significance in performance management...