[]
        
(Showing Draft Content)

Preserve Unsupported Charts

SpreadJS provides you with the ability to preserve unsupported charts when imported from other file formats. The preserveUnsupportedChart flag can be set to true which preserves the chart and its properties. The unsupported chart can also be exported to other file formats.


The below image displays unsupported chart type in SpreadJS with default text "Unsupported Chart Type":




The default value of preserveUnsupportedChart is false which converts the unsupported chart to column chart when imported in SpreadJS.


The following code sample preserves the unsupported chart in SpreadJS after importing it from Excel using code.

var sheet = workbook.getSheet(1);
sheet.charts.preserveUnsupportedChart(true);

Note: The preserveUnsupportedChart flag is applied at worksheet level and hence, it needs to be called again when the active sheet is changed.

The following code sample defines customized text over the unsupported chart using code.

sheet.charts.preserveUnsupportedChart(true, function (chart, chartHost) {
    var paintElement = document.createElement('div');
    paintElement.innerHTML = 'Chart display not supported';
    chartHost.appendChild(paintElement);
});

Note: The text displayed over the chart cannot be serialized to json data.

The following chart types are currently not supported in SpreadJS:

  • line3D

  • column3D

  • area3D

  • columnClustered3D

  • columnStacked3D

  • columnStacked1003D

  • barClustered3D

  • barStacked3D

  • barStacked1003D

  • pieOfPie

  • pieExploded

  • pieExploded3D

  • barOfPie

  • areaStacked3D

  • areaStacked1003D

  • doughnutExploded

  • bubble3DEffect

  • surface

  • surfaceWireframe

  • surfaceTopView

  • surfaceTopViewWireframe

  • bubble3DEffect

  • boxWhisker

  • funnel

  • paretoLine

  • regionMap

  • waterfall

  • histogram