Kaydet (Commit) dd55a4e8 authored tarafından Markus Mohrhard's avatar Markus Mohrhard

also export basic chart structure for empty charts

Change-Id: I545be33e5e093d5bd3fda4236213a413a6cc9ce7
Reviewed-on: https://gerrit.libreoffice.org/46939Reviewed-by: 's avatarMarkus Mohrhard <markus.mohrhard@googlemail.com>
Tested-by: 's avatarJenkins <ci@libreoffice.org>
üst 1d2eb0b6
......@@ -149,6 +149,8 @@ private:
void exportPieChart( const css::uno::Reference< css::chart2::XChartType >& xChartType );
void exportRadarChart( const css::uno::Reference< css::chart2::XChartType >& xChartType );
void exportScatterChart( const css::uno::Reference< css::chart2::XChartType >& xChartType );
void exportScatterChartSeries( const css::uno::Reference< css::chart2::XChartType >& xChartType,
css::uno::Sequence<css::uno::Reference<css::chart2::XDataSeries>>* pSeries);
void exportStockChart( const css::uno::Reference< css::chart2::XChartType >& xChartType );
void exportSurfaceChart( const css::uno::Reference< css::chart2::XChartType >& xChartType );
void exportHiLowLines();
......
......@@ -1628,43 +1628,55 @@ void ChartExport::exportRadarChart( const Reference< chart2::XChartType >& xChar
pFS->endElement( FSNS( XML_c, XML_radarChart ) );
}
void ChartExport::exportScatterChartSeries( const Reference< chart2::XChartType >& xChartType,
css::uno::Sequence<css::uno::Reference<chart2::XDataSeries>>* pSeries)
{
FSHelperPtr pFS = GetFS();
pFS->startElement( FSNS( XML_c, XML_scatterChart ),
FSEND );
// TODO:scatterStyle
sal_Int32 nSymbolType = css::chart::ChartSymbolType::NONE;
Reference< XPropertySet > xPropSet( mxDiagram , uno::UNO_QUERY);
if( GetProperty( xPropSet, "SymbolType" ) )
mAny >>= nSymbolType;
const char* scatterStyle = "lineMarker";
if (nSymbolType == css::chart::ChartSymbolType::NONE)
{
scatterStyle = "line";
}
pFS->singleElement( FSNS( XML_c, XML_scatterStyle ),
XML_val, scatterStyle,
FSEND );
exportVaryColors(xChartType);
// FIXME: should export xVal and yVal
bool bPrimaryAxes = true;
if (pSeries)
exportSeries(xChartType, *pSeries, bPrimaryAxes);
exportAxesId(bPrimaryAxes);
pFS->endElement( FSNS( XML_c, XML_scatterChart ) );
}
void ChartExport::exportScatterChart( const Reference< chart2::XChartType >& xChartType )
{
FSHelperPtr pFS = GetFS();
std::vector<Sequence<Reference<chart2::XDataSeries> > > aSplitDataSeries = splitDataSeriesByAxis(xChartType);
bool bExported = false;
for (auto itr = aSplitDataSeries.begin(), itrEnd = aSplitDataSeries.end();
itr != itrEnd; ++itr)
{
if (itr->getLength() == 0)
continue;
pFS->startElement( FSNS( XML_c, XML_scatterChart ),
FSEND );
// TODO:scatterStyle
sal_Int32 nSymbolType = css::chart::ChartSymbolType::NONE;
Reference< XPropertySet > xPropSet( mxDiagram , uno::UNO_QUERY);
if( GetProperty( xPropSet, "SymbolType" ) )
mAny >>= nSymbolType;
const char* scatterStyle = "lineMarker";
if (nSymbolType == css::chart::ChartSymbolType::NONE)
{
scatterStyle = "line";
}
pFS->singleElement( FSNS( XML_c, XML_scatterStyle ),
XML_val, scatterStyle,
FSEND );
exportVaryColors(xChartType);
// FIXME: should export xVal and yVal
bool bPrimaryAxes = true;
exportSeries(xChartType, *itr, bPrimaryAxes);
exportAxesId(bPrimaryAxes);
pFS->endElement( FSNS( XML_c, XML_scatterChart ) );
bExported = true;
exportScatterChartSeries(xChartType, &(*itr));
}
if (!bExported)
exportScatterChartSeries(xChartType, nullptr);
}
void ChartExport::exportStockChart( const Reference< chart2::XChartType >& xChartType )
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment