Support for SheetType.Chart in gridjs-spreadsheet

The first sheet in https://obr.uk/docs/PSF_aggregates_databank_Aug-1.xlsx is of type Chart, which Cells.NET can handle when rendering to PDF, however GridJS conversion drops this sheet entirely.

Are there any plans to support the Chart sheet type in GridJS?

@jrf.att
We will support it.
We have opened the following new ticket(s) in our internal issue tracking system and will deliver their fixes according to the terms mentioned in Free Support Policies.

Issue ID(s): CELLSGRIDJS-815

You can obtain Paid Support Services if you need support on a priority basis, along with the direct access to our Paid Support management team.

you can try set Config.ShowChartSheet = true;
then it will show the chart worksheet in the file.
it will be ready in the next coming 23.6 release

The issues you have found earlier (filed as CELLSGRIDJS-815) have been fixed in this update. This message was posted using Bugs notification tool by johnson.shi

Hi @peter.zhou, I just tested the file linked in the original post on using Aspose’s online Viewer, however the chart still isn’t displaying. I can see in the DetailJson network response that the active sheet is supposed to be “Spending and receipts” however that sheet is not in the ‘data’ array, and is not displayed in the list of sheets at the bottom of the viewer.

@jrf.att
you need to set Config.ShowChartSheet = true;
the default value is false.
our online viewer is just use the default setting.
Please have a try.

Aha, that did the trick! Thanks!

@jrf.att,

It is nice to know that it figures out your issue now. Feel free to write us back if you have further queries or comments.

Hey @amjad.sahi, one small issue I noticed with my test sheet (the one linked above). The A1 cell is given a default size, which means that if the gridjs-spreadsheet viewer is smaller than the chart, then it’s cut off with no ability to scroll to see the rest of the chart.

In that screenshot, the viewer is approximately 850px wide, 500px high. The GridJS JSON data shows the chart is 967x589, so does not fit. I don’t think this will be a huge issue in practice, as most users should have large monitors, but there will be some users with small monitors. If there are Excel files with very large charts, even users with bigger monitors may be affected.

@jrf.att,

We will evaluate and look into it soon.

@jrf.att
we’ve already considered such a case, the viewer range will always be auto-adjusted to fit the whole chart size.

Hey @peter.zhou, I’m not sure I understand. When constructing the spreadsheet, we provide a function that tells gridjs-spreadsheet how big the container is:

    new Spreadsheet(container, {
        mode: 'read',
        showToolbar: false,
        showContextmenu: false,
        evalPaused: true,
        view: {
            height: () => container.clientHeight,
            width: () => container.clientWidth,
        },
    });

If the container is not big enough for the chart, then it is not fully displayed, and no scrollbars are provided for the user to see the rest of the chart.

I’ve updated the screenshot in my previous comment to hopefully explain a little better what I mean. Note how there’s no scrollbar at the bottom, and the right hand side of the chart cannot be seen.

@jrf.att
It will add enough empty rows columns to keep enough width /height for the chart image.so that the vertical and horizontal scroll will automatically appeared after the chart loaded.
If you still find the issue ,can you show us the file. we will check it in detail .
here is the snapshot in my side,as you can see the columns and rows is auto extend to bigger to hold the chart.
QQ截图20230711173233.png (149.7 KB)

Ah, I think I see what’s going on. We have Config.UsePrintArea = true, and are calculating the print area based on LowerRightRow and LowerRightColumn of each sheet’s shapes. For a shape on a Chart sheet, these values are both 0. I’ll update our code to not set a print area for Chart sheets. Thanks for your help debugging!

@jrf.att,

It seems you have sorted it out now. Please update your code segment accordingly. Let us know if you still find any issue.

@jrf.att,

Config.UsePrintArea = true is server side configuration. It will not affect the display of chart worksheet. The work for add enough empty rows columns to keep enough width/height for the chart image is just done at client side. Make sure you have got the latest v23.6 version gridjs client.

One more thing, we will publish v23.7 release very soon, in this week.

:man_facepalming: Sorry @peter.zhou, you’re right - I updated the .NET dependencies but somehow missed the client-side update.