Free Support Forum - aspose.com

Cells netcore - Chart Data labels shapes (callouts) not rendered correctly in HTML (SVG)

Issue - Aspose Cells - Shapes and overlays are not positioned correctly on a chart exported to HTML.

Steps to reproduce

  • On an Excel chart, click one point of a series.
  • Add a data label (data callout) to the point, choosing the oval
  • Format the data label position to ‘center’.

Result
When rendering the worksheet as HTML (chart as SVG in options), the chart is printed well but the oval is way off.
Same result with other shapes - their positions do not render correctly .

Temporary workaround:
When using just the label text with a large letter “O” (instead of a shape annotation),
it is pretty close what I would expect using the oval.

Happy to send an example worksheet displaying this problem.

BTW, if I use Excel to convert the chart to a PDF and Aspose to create an SVG from that PDF, it looks right.

@ottap,

Kindly post us a standalone example (sample code (without compile time errors)) with sample files (input file and output file(s)) to reproduce the issue on our end, we will check it soon.

PS. please zip the files prior attaching here.

Hi,
please see sheet 53_DL_Callouts and try aspose create HTML.

All circles are meant to have its middle in the point they are referring to on the chart.

But mainly, there is an issue with alignment of Shapes on the chart.

Please ask for any help related to this - happy to help.

Best regards

Pavel OTTA

(Attachment EACDef.xlsx is missing)

@ottap,
It seems that the template file is not attached. Please zip the file before attaching here as suggested by @Amjad_Sahi above. Also share your runnable console application as it is must required to reproduce this issue here.

Hi,
please focus on sheet 53_DL_Callouts and try aspose create HTML.

All circles are meant to have its middle in the point they are referring to on the chart.

Generally, there is an issue with alignment of Shapes on the chart. Bigger charts and bigger shapes on one place tent result in misplacement.

Please ask for any help related to this - happy to help.

Best regards

Pavel OTTA

EACDef.zip (154 KB)

Hi Ahsan,
You can see the same bad result when you put that excel file to your sites:

https://products.aspose.app/cells/conversion/xlsx-to-svg

You will see it by your own eye that those circles are not centered.

Please see attached file with excel.
Just calling save method for active sheet of workbook passing these settings created by this:

private static HtmlSaveOptions GetDefaultHtmlSaveOptions()
{
var htmlSaveOptions = new HtmlSaveOptions
{
Encoding = Encoding.UTF8,
ExportImagesAsBase64 = true,
ExportPrintAreaOnly = false, //was true
ExportActiveWorksheetOnly = true,
CellCssPrefix = CellCssPrefix,
//ExportWorksheetCSSSeparately = true,
ExportWorksheetCSSSeparately = false,
ExcludeUnusedStyles = true,
ExportDocumentProperties = false,
ExportWorkbookProperties = false,
HtmlCrossStringType = HtmlCrossType.Default,
ExportSimilarBorderStyle = true,

// Set the property for scalable width
WidthScalable = true,

// ExportArea = CellArea.CreateCellArea(“A1”, “ZZ500”),
//ExportArea = CellArea.CreateCellArea(“B1”, “J40”),
};

htmlSaveOptions.ImageOptions.SaveFormat = SaveFormat.SVG;
//htmlSaveOptions.ImageOptions.SaveFormat = SaveFormat.TIFF;
htmlSaveOptions.ImageOptions.HorizontalResolution = 150;
htmlSaveOptions.ImageOptions.VerticalResolution = 150;
//htmlSaveOptions.ImageOptions.ImageType = Cells.Drawing.ImageType.Svg;
// htmlSaveOptions.ImageOptions.SmoothingMode = 4;
// htmlSaveOptions.ImageScalable = false;
return htmlSaveOptions;
}

EACDef.zip (154 KB)

@ottap,
We have observed this issue and logged it in our database for further investigation. You will be notified here once any update is ready for sharing.

This issue is logged as:
CELLSNETCORE-121 - Chart Data labels shapes (callouts) not rendered correctly in HTML (SVG)

@ottap,
The problem has been sorted out and we plan to provide a fix version next week.

Hi Ahsan,
Thanks for the answer. It would be fine if this issue is fixed.

Can I ask you about the status of another issue (WORDNET-22168 Column Misalignment - created on April 22 - last communication was from awais.hafeez).
Thanks.

Best regards
Pavel OTTA

@ottap,

To get latest updates or ETA on it, please ask in relevant thread in Aspose.Words forum. One of our colleagues from Aspose.Words team will assist you there.