We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Multi-Level Category Labels On Charts

Hello,

I searched the forums for this particular problem but couldn't find it, so my apologies if this has been asked before. Attached you will find the Excel spreadsheet and the image generated by the code below. If you open the Excel spreadsheet, the image appears correctly; however, the jpg image generated by the toImage() procedure does not look like it should. Is this a bug in the software, or am I missing some options that I should be setting?

Thanks,

Matt

Code:

Dim workbook As workbook = New workbook

Dim sheet As Worksheet = workbook.Worksheets(0)

Dim license As Aspose.Cells.License = New Aspose.Cells.License

license.SetLicense("Aspose.Total.lic")

Dim cells As cells = sheet.Cells

cells(0, 2).PutValue("Income")

cells(1, 0).PutValue("Foreign")

cells(2, 0).PutValue("Domestic")

cells(3, 0).PutValue("Domestic")

cells.Merge(1, 0, 2, 1)

cells(1, 1).PutValue("Company A")

cells(2, 1).PutValue("Company B")

cells(3, 1).PutValue("Company C")

cells(1, 2).PutValue(10000)

cells(2, 2).PutValue(20000)

cells(3, 2).PutValue(30000)

Dim chartIndex As Integer = sheet.Charts.Add(ChartType.Bar, 9, 9, 30, 15)

Dim chart As chart = sheet.Charts(chartIndex)

chart.NSeries.Add("C2:C4", True)

chart.NSeries.CategoryData = "A2:B4"

Dim aSeries As aSeries = chart.NSeries(0)

aSeries.Name = "=C1"

chart.IsLegendShown = True

chart.Title.Text = "Income Analysis"

chart.ToImage(C:\aspose\aspose.jpg")

workbook.Save(C:\aspose\aspose.xls")

FYI, we are using the latest version of Aspose.Total.

Hi,

Thanks for providing us details,

Yes, we found the issue for Chart.ToImage() related labels positioning, we will figure it out soon.

Thank you.

Thank you very much for the quick reply. Do you have any idea how long before a fix would be released for this? We need to be able to implement this kind of chart within the next month or so.

Thanks,

Matt

Hi,

No, worries! :) we will fix the issue soon. Normally, it takes 1-2 days to resolve an issue if there is not much complexity involved in it.

Have a great day!

Hi,

Please try this fix.

Thanks you very much for the quick response! This works perfectly!