I’m using the Apache POI library 5.2.3 in Scala to create a line chart in a PowerPoint presentation.
// createData returns XDDFChartData
var chartData = chart.createData(
ChartTypes.LINE,
bottomAxis,
leftAxis
).asInstanceOf[XDDFLineChartData]
// addSeries returns XDDFChartData.Series
var series = chartData.addSeries(bottomAxisDataSource, seriesDataSource)
series.setSmooth(false)
error: value setSmooth is not a member of org.apache.poi.xddf.usermodel.chart.XDDFChartData.Series
However I need series
to be of type XDDFLineChartData.Series
not XDDFChartData.Series
so I can access the setSmooth()
method. How do I cast to the inner member type Series
here?
The following attempt fails
chartData.addSeries(bottomAxisDataSource, seriesDataSource).asInstanceOf[XDDFLineChartData.Series]
with
error: type Series is not a member of object org.apache.poi.xddf.usermodel.chart.XDDFLineChartData