Setting chart type with the URL API

Set the type of chart you want to display for a CubeViewer object by using the ChartType parameter.

The ChartType parameter uses the following format:

ChartType=ChartName

where ChartName can be the string value for one of the available chart types such as Column or Pie. For a complete list of available chart types, see URL API ChartType parameter.

URL example

Copy and paste the following URL directly into the address bar of your web browser to see this example.

http://localhost:9510/tm1web/UrlApi.jsp#Action=Open&Type=CubeViewer&Cube=plan_BudgetPlan&View=Budget%20Input%20Detailed&AccessType=Public&AdminHost=localhost&TM1Server=Planning%20Sample&DisplayMode=GridAndChart&ChartType=Pie

JavaScript example


<body>
<select title="Chart Type" onchange="setChartType(this.value);>
   <option></option>
   <option value="Point">Point</option>
   <option value="Bubble">Bubble</option>
   <option value="Line">Line</option>
   <option value="Spline">Spline</option>
   <option value="StepLine">Step Line</option>
   <option value="Bar">Bar</option>
   <option value="StackedBar">Stacked Bar</option	>
   <option value="Column">Column</option>
   <option value="StackedColumn">Stacked Column</option>
   <option value="Area">Area</option>
   <option value="SplineArea">Spline Area</option	>
   <option value="StackedArea">Stacked Area</option>
   <option value="Pie">Pie</option>
   <option value="Doughnut">Doughnut</option>
   <option value="Range">Range</option	>
   <option value="SplineRange">Spline Range</option>
</select>

<iframe id="cubeviewId" style="width:100%; height:100%;"></iframe>

<script type="text/javascript">
   function setChartType(value) {
      if(!value) {
         return;
      }

      cubeView = document.getElementById("cubeviewId");
      baseUrl = "http://localhost:9510/tm1web/UrlApi.jsp";
      cubeView.src = baseUrl + "#ChartType=" + value;
   };

</script>
</body>