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")