Build a Zoho Analytics Custom Visualization

Building a Zoho Analytics Custom Visualization: Manifest, main.js and APIs

This guide comes from the 1 Cloud Consultants knowledge base. We are an Authorized Zoho Partner, and our Zoho Analytics page explains what we do.

When the built-in charts in Zoho Analytics are not enough, a developer can build a custom visualization with a JavaScript library such as D3.js, Highcharts, or Plotly, and package it as a plugin. This guide is for that developer. It explains the two files you write, the functions Zoho Analytics gives you, and the traps to watch for. For adding the finished visual and managing it, see Zoho Analytics Custom Visuals: Using the Gallery and Managing Plugins. It is based on Zoho's help page as we read it on 29 October 2026, and the plan note there applies: Zoho says the feature is for Enterprise users.

The two files

File Job
ZAViz_Manifest.jsonDescribes the visual: its name, icon, library dependencies, the drop areas for columns, and the settings users can change.
main.jsDraws the visual.

Put both in one ZIP file. An Account or Organization Admin uploads it.

The manifest

These are its top-level properties:

Property What it holds
nameThe name shown in the interface.
iconA web address or local path to the icon.
dependenciesThe libraries the visual needs, as web addresses or local files.
structureThe drop areas where users place columns.
settingsThe options users can change in the Settings panel.

Drop areas (structure)

Each drop area is an array of four values, in this order:

Position Value
1. NameThe label shown for the drop area.
2. Cardinality"single" for one column, or "multi" for several.
3. Data type"MEASURE" for numbers, or "DIMENSIONAL" for categories.
4. Supported operationsThe aggregations allowed. An empty string allows all.

User settings

Settings are grouped into named tabs, and each setting needs a uniqueName (how your code finds its value), a type, a label, and a defaultValue. The multipleToggle and dropdown types also need an options list. The supported types are:

Type Use for
checkBox, toggleOn or off choices, as a tick box or a switch.
inputTextFree text.
colorComponentA colour picker.
multipleToggle, dropdownA choice from a fixed list of text options.

Here is an example manifest. It is our own illustration, built from the structure above, and we have not tested it in a live workspace.

{
  "name": "Sales Waterfall",
  "icon": "icons/waterfall.png",
  "dependencies": ["https://cdn.plot.ly/plotly-3.0.0.min.js"],
  "structure": [
    ["Category", "single", "DIMENSIONAL", ""],
    ["Value", "single", "MEASURE", ""]
  ],
  "settings": {
    "Title": [
      {
        "uniqueName": "chartTitle",
        "type": "inputText",
        "label": "Title",
        "defaultValue": ""
      }
    ]
  }
}

main.js

You must write a function called generateCustomVisual. Zoho Analytics calls it whenever the visual needs to be drawn or refreshed. It receives three things:

Parameter What it is
containerThe page element Zoho Analytics gives you as your drawing area. Everything you draw must go inside it.
dataThe values of the columns the user dropped in, as an array of rows, one row per record. Each row holds values in the order the columns were dropped, and only the selected columns, with their aggregations, are included.
metaDataDescribes the data and the user's settings, in two parts: columns and customSettings.

metaData.columns

One entry for each dropped column, in the same order as the values in each row.

Field Meaning
operationThe aggregation applied, such as GROUPBY or SUM.
datatypeordinal for categories, numeric for numbers.
columnnameThe display name of the column.
dataindexWhere the column's value sits in each row, starting from 0.
dropBoxNameThe drop area the column was placed in, so you can tell columns apart in code.

metaData.customSettings

The current values of the options from the Settings panel, read by each setting's uniqueName.

Here is a matching main.js for the manifest above. Again, this is our own illustration of how the pieces fit, and we have not tested it in a live workspace.

function generateCustomVisual(container, data, metaData) {
  const title = metaData.customSettings.chartTitle;
  const labels = data.map(function (row) { return row[0]; });
  const values = data.map(function (row) { return row[1]; });
  Plotly.newPlot(
    container,
    [{ type: "waterfall", x: labels, y: values }],
    { title: title }
  );
}

Utility functions: ZAViz_Utils

A trap with two different counts. The utility functions and the interaction functions number columns from 1, in the order they were dropped, counting top to bottom and left to right across all drop areas. But dataindex in metaData.columns, and the position of values in each data row, start from 0. Mixing them up is an easy off-by-one mistake.
  • ZAViz_Utils.getFormattedValue(columnIndex, data) returns a value formatted the way the column's own formatting is set up, so your visual matches the rest of the report.
  • ZAViz_Utils.getSuitableStyle(styleType) returns a theme-appropriate colour in hex. The style types are fontColor and backgroundColor, which follow the current dashboard theme or common appearance, and legendColor, which follows the workspace colour palette. Use it so the visual adapts when someone changes the theme.
const text = ZAViz_Utils.getFormattedValue(2, 17443.52);
const fontColor = ZAViz_Utils.getSuitableStyle("fontColor");
const backgroundColor = ZAViz_Utils.getSuitableStyle("backgroundColor");
const legendColor = ZAViz_Utils.getSuitableStyle("legendColor");

Interaction functions: ZAViz_ActionsAPI

These let people click a data point in your visual and get the standard Zoho Analytics actions. In each one, the clicked data is an object whose keys are column indexes (counting from 1) and whose values are the clicked values.

Function What it does
showInteractionMenu(dataPoints, coordinates)Shows the standard interaction menu at the clicked point. The coordinates are optional, and without them the menu appears in the middle of the chart.
invokeViewUnderlyingData(clicked_data)Opens the underlying data for the clicked point.
invokeExplainData(clicked_data)Opens the Explain Data view for the clicked point.
invokeDrillThrough(clicked_data, view_name)Drills through from the clicked point to the named view.
invokeDrillAction(clicked_data, name)Runs the named drill action for the clicked point.
const clicked_data = { 1: "West", 2: "110.06" };
ZAViz_ActionsAPI.invokeExplainData(clicked_data);
ZAViz_ActionsAPI.invokeDrillThrough(clicked_data, "Product wise Sales");

You connect these to your chart library's own click event, passing the clicked point's values. Zoho's page shows examples for Plotly and Highcharts.

External libraries and formatting

  • Libraries: list the address or local file of any library in the manifest's dependencies array. Any JavaScript visualization library can be used. Zoho Analytics does not check licences, so you must.
  • Formatting: custom visuals support only basic formatting, covering colours, fonts, legends, and number and date formats. For anything more advanced, use Zoho's JavaScript functions to match the look and the data formats of Zoho Analytics.

Where Zoho's page is unclear

  • A copy-and-paste slip. The page describes invokeViewUnderlyingData with the same words as showInteractionMenu ("displays the interaction menu"). From its name and its example, it is meant to open the underlying data. Test it.
  • No limits are given for the size of the ZIP file, how many visuals you can add, or how long drawing can take.
  • No testing or debugging guidance, and nothing on whether a visual can call outside services. Our two code examples are illustrations, and not Zoho's.

Building one that lasts: our advice

This section is our own advice, not Zoho's.

  1. Pin the library version. The manifest's address should name an exact release, as in Zoho's example, and not a moving latest version, so the visual does not change under you.
  2. Read the data by column name, not by position, where you can, using dropBoxName, so a change to the drop areas does not silently break the visual.
  3. Handle empty and odd data. A report with no rows, or a missing value, should show a clear message, not a blank box.
  4. Use the theme functions. A visual with hard-coded colours looks wrong the moment someone applies a dark theme.
  5. Keep data inside the page. Do not send your report data to outside services from the visual. In the UK and Ireland, that would move personal data without your control. This is general guidance and not legal advice.
  6. Version and document it. Keep the source in version control, number each release, and record what changed, so an update can be rolled back.
Need help? As a Zoho Partner serving the UK and Ireland, we can design, build, and review custom visualizations for your Zoho Analytics, and take care of the upload and testing. Email zoho@1cloudconsultants.com or raise a support request with 1 Cloud Consultants.