Skip to content

[Topic] Document the ExportOptions.InitScript property #595

@brianlagunas

Description

@brianlagunas

Description

There is currently no documentation on the ExportOptions.InitScript property that can be used in headless server export. This can be used to setup the reveal view just before export such as setting up custom theme colors, or handling the onVisualizationSeriesColorAssigning event to assign custom colors for export.

exportOptions.InitScript = @"
    function initReveal(revealView){
        $.ig.RevealSdkSettings.theme = new $.ig.MountainDarkTheme();

        revealView.refreshTheme();

        // if customizing series colors programatically
        revealView.onVisualizationSeriesColorAssigning = function (visualization, defaultColor, fieldName, categoryName) {
            if (categoryName === ""Critical"") {
                return ""rgb(0,0,0)"";
            }
            return defaultColor;
        }
    }";

This property exists in all platforms.

One limitation here is that he excel export does not use this property as Excel does not require rending of the RevealView to perform the export. It uses a native library for generating the charts along with the data export in the excel workbook.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions