Include Python / Bokeh plot in PowerPoint presentation preserving data pop-ups - python

If an EXCEL chart is pasted into a PowerPoint presentation as an EXCEL object, it is possible to hover the mouse over the line and see it's value. My boss likes this feature. I don't like having to do charts in EXCEL.
It is possible to get the same effect with bokeh or plotly, but as far as I am aware, that either relies on a stand-alone html file or a server instance.
Is it possible to paste a bokeh chart into a PowerPoint presentation preserving the feature that when you hover your mouse over a point, the value (and some other information) pops up?
Or is there another python solution that would allow this feature in PowerPoint (ppt is essential) while also allowing plots to be generated via code?

An available option is to create powerpoints with Plotly: https://towardsdatascience.com/embed-interactive-plots-in-your-slides-with-plotly-fde92a5865a and https://evidencen.com/how-to-embed-plotly-graphs-in-powerpoint/
Also it seems this question has been asked before and you can hyperlink the HTML source in the .pptx file: Output of Plotly in PowerPoint

yes. it's a hover tool. here is an example

Related

How to use python-pptx to replace specific categories in the chart

Currently, I am doing repeated work like find and replace some content in PowerPoint. And I find some codes to F&R the text in the text-box or table. However, I cannot F&R those words in the chart that I need to edit in excel. Is there any possible solution? Instead of extracting the data to create a new chart.
Charts in Powerpoint are a little tricky, as they are stored in two places.
You'll need to first edit the "real" chart data by loading the excel behind (in C# this is the EmbeddedData section), and then update the cached values that Powerpoint has. These are descendants of the chartspace. If you don't do this, then you have to click in and out of the slide deck to trick Powerpoint into updating. I'm afraid I don't have python code to do that as I did the same in C#/Dotnet for slidetemplater.com
That does however have a python API too (https://pypi.org/project/slidetemplater/)

Is there a way to insert interactive animations from python plotly to a powerpoint?

I want to insert the plotly interactive animation into a powerpoint. I read online that you can generate a gif, however I want to be able to use the animation bar that you get from plotly on the powerpoint slide. Is there any way to do that? Sorry if this is a stupid question, this is my first time doing something like that.
You can try getting an extension that allows embedding the plotly webpage you have into powerpoint. How well this works will depend on the specifics of the extension you choose to use.
There is some discussion about embedding iframes into powerpoint here: https://answers.microsoft.com/en-us/msoffice/forum/all/how-do-i-embed-iframe-code-into-my-powerpoint/5b7b5bc9-a68b-46d9-88ad-207387d621b7

Is it possible to embed bokeh charts with hover tool in PowerPoint?

I am going to embed bokeh charts into PowerPoint (Office 365) using Python. The charts must have at least hover tool stating x and y values. I think there are 2 ways of implementation both of which don't give solution to me:
save the charts in html format and embed them in PowerPoint - I don't know if there is a way to save the open html file (not the link) in the PowerPoint.
save the chart in svg format - but the hover tool is missing there.
Please help me to solve this problem.

How to Embed Excel Files and Link Data into PowerPoint by python in specific place of slide

There is an excel file with different sheets which is included by different charts and data. I want to make a powerpoint for my daily presentation automatically by python(PPTx lib in python).
my problem is I have to copy the charts which exist in excel and past in my powerpoint which is created by python (pptx). I want to know is there any possibility to export charts from excel file to powerpoint by python?
There is no direct API support for this in python-pptx. However, there are other approaches that might work for you.
Perhaps the simplest would be to use a package like openpyxl to read the data from the spreadsheet and recreate the chart using python-pptx, based on the data read from Excel.
If you wanted to copy the chart exactly, this is also possible but would require detailed knowledge of the Open Packaging Convention (OPC) file format and XML schemas to accomplish. Essentially, you would copy the chart-part for the chart into the PowerPoint package (zip file) and connect it to a graphic-frame shape on a slide. You'd also need to embed the Excel worksheet into the PowerPoint, perhaps repeatedly (once for each chart) and make any format-specific adjustments (Excel and PowerPoint handle charts slightly differently in certain details).
This latter approach would be a big job, so I would recommend trying the simpler approach first and see if that will get it done for you.

Obtain the current value when parsing an html file with bokeh sliders

I am using bokeh to plot my math functions created with python/numpy.
I would like to use sliders as shown in
http://docs.bokeh.org/en/latest/docs/server_gallery/sliders_server.html
Once I create the html file with the plot, I would like to select different values on the sliders which modify the plot and then read back the chosen values in into python to use it for other manipulations.
What is the best way to read the chosen value on the slider from the html file back into python ?
I saw pyquery could be useful, but I cannot really figure that out.
Any suggestions would be appreciated based on above scenario.
There are two slider examples in the bokeh repo, where the slider is connected back to python via the bokeh server.
Sliders App
Taylor server
If this isn't what you were after, can you elaborate a little more?
A static HTML file and the state of the slider is inside a web browser and never reflected back to the HTML file. What you should be doing is to use bokeh-server - answered via bokeh-google group

Categories

Resources