In python I am trying to plot a graph with the pygal
package
import pygal # First import pygal
bar_chart = pygal.Bar()
bar_chart.add('Fibonacci', [0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55])
bar_chart.add('Padovan', [1, 1, 1, 2, 2, 3, 4, 5, 7, 9, 12])
bar_chart.render_in_browser()
Unfortunately, it always opens the HTML file, but not an HTML page in the browser window. I read many posts and I see that people had similar issues in the past. I did not find a solution that works. I also tried to open it via the webbrowser
module, but that also opens the HTML file in notepad.
url='file://C:/Users/User1/AppData/Local/Temp/tmpsblpwtpr.html'
webbrowser.open(url)
Anyone any thoughts?
See the following from the webbrowser module documentation:
Note that on some platforms, trying to open a filename using this function, may work and start the operating system’s associated program.
Most likely the associated program for .html files on your system is notepad, not your browser.