How do I Switch Row/Column programatically on the embedded Excel chart?
I'm inserting Excel charts in PowerPoint and now I'd like to be able to programmatically switch Row/Column just like clicking on the'Switch Row/Column' button under 'Design' in powerpoint.
I'm trying to embed Excel chart into PowerPoint but I understand I have to create an Image of the Excel chart first.
I have an Excel template with a sheet named "ChartSheet" and a single chart named "Chart 1". I'm able to update the chart data. Now, I need to get the image of this updated chart. I'm using the following code below but for some reason, imgChart is still "null" value. Could you please help? Thanks
Dim imgChart As Bitmap = wb.Worksheets("ChartSheet").Charts("Chart 1").ToImage()
Please try the attached latest version of Aspose.Cells and check if it works fine for you. As you are accessing the chart by Name, we have fixed the issue regarding accessing the chart with chart name. You may also try to use the chart index instead of chart name (as you have only one chart so you can use Dim imgChart As Bitmap = wb.Worksheets(“ChartSheet”).Charts(0).ToImage()). If you still face the problem with the attached latest version, please share your template file and we will check it soon.
After looking further into you issue, I am afraid the Cylinder type charts are not supported in the Chart2Image function. You may check the following documentation link to see the list of the supported charts in Chart2Image feature.
Thank you for your reply. I changed the type and ToImage seems to work however, I am using MS Office 2007 and it seems that the color scheme seems to be that of MS 2003. Does it have to do with this line of code below? How can I change it to suit MS 2007?
AddOleObjectFrame(x, y, slideWidth, slideHeight, "Excel.Sheet.8", chartOleData)
We have fixed some of the coloring issues when using chart as ole object in our latest release. Please try it and let us know if it works fine for you. If you still face any problem, please create a sample application to reproduce the issue and share it here, we will check it soon.
Note: Just for your knowledge, in the new release v4.8.0, we have merged Aspose.Grid suite to Aspose.Cells for .NET msi installer as Aspose.Grid would be no longer offered as a separate product now. You need to install the installer (uninstall older one first if you have) and use only Aspose.Cells.dll library in your project for your need. You may also take advantage using Aspose.Cells Grid suite though.
Thank you for your response. I have another question. I'm now able to embed Excel chart from an Excel file into PowerPoint slide. However, when I click to edit the chart in PowerPoint, I noticed that everything is very small. It's hard to make out the data since it seems to be zoomed out. It seems I need to manually increase the fonts after I've embedded into PowerPoint. Have you come accrossed this issue before?
Sets consent for sending user data to Google for online advertising purposes.
Sets consent for personalized advertising.
Cookie Notice
To provide you with the best experience, we use cookies for personalization, analytics, and ads. By using our site, you agree to our cookie policy.
More info
Enables storage, such as cookies, related to analytics.
Enables storage, such as cookies, related to advertising.
Sets consent for sending user data to Google for online advertising purposes.
Sets consent for personalized advertising.
Cookie Notice
To provide you with the best experience, we use cookies for personalization, analytics, and ads. By using our site, you agree to our cookie policy.
More info
Enables storage, such as cookies, related to analytics.
Enables storage, such as cookies, related to advertising.
Sets consent for sending user data to Google for online advertising purposes.