Error while using scalax chart in scala spark shell ver 2.0.1

Hi,

Tried running scala chart in spark shell version 2.0.1, but got error.
Same code running in Intellij.
Is it possible to display the charts in spark shell. If no, any alternative in order to work with scala charts.

ERROR :
scala> chart.show()
Exception in thread “AWT-EventQueue-0” java.awt.HeadlessException:
No X11 DISPLAY variable was set, but this program performed an operation which requires it.
at java.awt.GraphicsEnvironment.checkHeadless(GraphicsEnvironment.java:207)
at java.awt.Window.(Window.java:536)
at java.awt.Frame.(Frame.java:420)
at javax.swing.JFrame.(JFrame.java:233)
at org.jfree.chart.ChartFrame.(ChartFrame.java:76)

Hi @arijit,

You can not display charts on console as the console will not have X window.

May be you can try Jupyter notebooks for the same.

Thanks

1 Like