Skip to product menu

Zoho Analytics has been recognized in the 2024 Gartner® Magic Quadrant™ for ABI PlatformsRead more

Skip to main content

Change Chart Type

You can use this API to change the chart type of the specified view. It allows you to change the chart type to any compatible chart type.

Function Call

Objname.changeChartType('ChartType')

Parameters

Parameter NameDescription
Chart Type

String

Enter the type of chart to which the specified view needs to be changed.
Note: The string are case sensitive.

  • area
  • area with points
  • area without points
  • bar
  • horizontal bar
  • bubble
  • combo
  • combo bar with smooth line
  • funnel
  • line
  • line with points
  • line without points
  • map area
  • map bubble
  • map filled
  • map pie
  • map pie bubble
  • map scatter
  • packed bubble
  • pie
  • ring
  • scatter
  • smooth area
  • smooth area with points
  • smooth area without points
  • smooth line
  • smooth line with points
  • smooth line without points
  • stacked area
  • stacked area with points
  • stacked bar
  • horizontal stacked bar
  • stacked smooth area
  • stacked smooth area with points
  • stacked smooth area without points
  • step
  • table chart
  • web
  • web with fill
  • web without fill
  • geo heat map
  • butterfly
  • heat map
  • pyramid
  • semi pie
  • semi ring

Sample Response

ZAnalytics JS API
 

Sample Request:

Copied<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>ZAnalytics JS API</title>
    <link rel="icon" type="image/x-icon" href="https://analytics.zoho.com/favicon.ico">
<script src="https://downloads.zohocdn.com/zanalyticslib/jsapi/v1/zanalytics.min.js"></script>
</head>
<style>
    button {
        background: #fff;
        border-radius: 3px;
        border: 1px solid #b8b8b8;
        height: 30px;
        margin: 5px;
        cursor: pointer;
    }
</style>
<body>
    <div class="viewcontainer">
        <div class="row" style="float: right;">
           <button onclick="vizObj.changeChartType('area')">Area Chart</button>
            <button onclick="vizObj.changeChartType('bubble')">Bubble Chart</button>  
           <button onclick="vizObj.changeChartType('line')">Line Chart</button> 
           <button onclick="vizObj.changeChartType('pie')">Pie Chart</button> 
           <button onclick="vizObj.changeChartType('web')">Web Chart</button> 
        </div>
        <div id="analysisView"></div>
        <script>
            const containerDiv = document.getElementById("analysisView");
            const url = "https://analytics.zoho.com/open-view/2588560000000010083";
            const options = {
                width: '100%',
                height: 600
            };
            const vizObj = new ZAnalyticsLib(containerDiv, url, options);
            vizObj.createViz();
        </script>
    </div>
</body>
</html>
Thanks for your interest. We shall get back to you shortly.