chart2/qa/extras/chart2export.cxx                                         |   
34 +++++++
 chart2/qa/extras/data/ods/ser_labels.ods                                  
|binary
 chart2/qa/extras/data/xlsx/ser_labels.xlsx                                
|binary
 chart2/source/controller/chartapiwrapper/WrappedDataCaptionProperties.cxx |    
6 +
 chart2/source/controller/dialogs/res_DataLabel.cxx                        |   
16 ++-
 chart2/source/controller/dialogs/res_DataLabel.hxx                        |    
1 
 chart2/source/controller/itemsetwrapper/DataPointItemConverter.cxx        |    
8 +
 chart2/source/controller/itemsetwrapper/TextLabelItemConverter.cxx        |    
8 +
 chart2/source/controller/main/ChartController_Tools.cxx                   |    
1 
 chart2/source/inc/chartview/ChartSfxItemIds.hxx                           |    
3 
 chart2/source/model/main/DataPointProperties.cxx                          |    
3 
 chart2/source/tools/DataSeriesHelper.cxx                                  |   
13 ++
 chart2/source/view/charttypes/VSeriesPlotter.cxx                          |   
15 ++-
 chart2/source/view/main/ChartItemPool.cxx                                 |    
1 
 chart2/source/view/main/VDataSeries.cxx                                   |    
2 
 chart2/uiconfig/ui/dlg_DataLabel.ui                                       |   
44 +++++++---
 chart2/uiconfig/ui/tp_DataLabel.ui                                        |   
44 +++++++---
 include/xmloff/xmltoken.hxx                                               |    
1 
 offapi/com/sun/star/chart/ChartDataCaption.idl                            |    
6 +
 offapi/com/sun/star/chart2/DataPointLabel.idl                             |    
6 +
 oox/source/drawingml/chart/seriesconverter.cxx                            |    
3 
 oox/source/export/chartexport.cxx                                         |    
2 
 sc/source/filter/excel/xichart.cxx                                        |    
2 
 xmloff/source/chart/PropertyMap.hxx                                       |    
2 
 xmloff/source/chart/PropertyMaps.cxx                                      |   
14 +++
 xmloff/source/core/xmltoken.cxx                                           |    
1 
 xmloff/source/token/tokens.txt                                            |    
1 
 27 files changed, 194 insertions(+), 43 deletions(-)

New commits:
commit b99f310d3b24dc45e3d84751e810c0bbff1d991b
Author:     Samuel Mehrbrodt <samuel.mehrbr...@allotropia.de>
AuthorDate: Wed Feb 3 08:01:55 2021 +0100
Commit:     Samuel Mehrbrodt <samuel.mehrbr...@allotropia.de>
CommitDate: Mon Feb 8 07:52:27 2021 +0100

    tdf#94235 Add support for series name in data series labels
    
    including ODF/OOXML import/export (and test)
    
    Change-Id: Id5a5194630a67476f7c5390294400a00ea3ad42d
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110338
    Tested-by: Jenkins
    Reviewed-by: Samuel Mehrbrodt <samuel.mehrbr...@allotropia.de>

diff --git a/chart2/qa/extras/chart2export.cxx 
b/chart2/qa/extras/chart2export.cxx
index a702d5113b13..c8b4c03755e7 100644
--- a/chart2/qa/extras/chart2export.cxx
+++ b/chart2/qa/extras/chart2export.cxx
@@ -140,6 +140,7 @@ public:
     void testAxisCrossBetweenDOCX();
     void testPieChartDataPointExplosionXLSX();
     void testCustomDataLabel();
+    void testDataSeriesName();
     void testCustomPositionofDataLabel();
     void testCustomDataLabelMultipleSeries();
     void testLeaderLines();
@@ -288,6 +289,7 @@ public:
     CPPUNIT_TEST(testAxisCrossBetweenDOCX);
     CPPUNIT_TEST(testPieChartDataPointExplosionXLSX);
     CPPUNIT_TEST(testCustomDataLabel);
+    CPPUNIT_TEST(testDataSeriesName);
     CPPUNIT_TEST(testCustomPositionofDataLabel);
     CPPUNIT_TEST(testCustomDataLabelMultipleSeries);
     CPPUNIT_TEST(testLeaderLines);
@@ -2310,6 +2312,38 @@ void Chart2ExportTest::testCustomDataLabel()
     CPPUNIT_ASSERT_EQUAL(OUString(" <CELLREF"), aFields[1]->getString());
 }
 
+/// Test for tdf#94235
+void Chart2ExportTest::testDataSeriesName()
+{
+    // ODF
+    {
+        load(u"/chart2/qa/extras/data/ods/", "ser_labels.ods");
+        reload("calc8");
+        uno::Reference<chart2::XChartDocument> xChartDoc = 
getChartDocFromSheet(0, mxComponent);
+        uno::Reference<chart2::XDataSeries> 
xDataSeries(getDataSeriesFromDoc(xChartDoc, 0));
+        CPPUNIT_ASSERT(xDataSeries.is());
+        uno::Reference<beans::XPropertySet> xPropertySet;
+        chart2::DataPointLabel aDataPointLabel;
+        xPropertySet.set(xDataSeries->getDataPointByIndex(0), 
uno::UNO_SET_THROW);
+        xPropertySet->getPropertyValue("Label") >>= aDataPointLabel;
+        CPPUNIT_ASSERT_EQUAL(sal_True, aDataPointLabel.ShowSeriesName);
+    }
+
+    // OOXML
+    {
+        load(u"/chart2/qa/extras/data/xlsx/", "ser_labels.xlsx");
+        reload("Calc Office Open XML");
+        uno::Reference<chart2::XChartDocument> xChartDoc = 
getChartDocFromSheet(0, mxComponent);
+        uno::Reference<chart2::XDataSeries> 
xDataSeries(getDataSeriesFromDoc(xChartDoc, 0));
+        CPPUNIT_ASSERT(xDataSeries.is());
+        uno::Reference<beans::XPropertySet> xPropertySet;
+        chart2::DataPointLabel aDataPointLabel;
+        xPropertySet.set(xDataSeries->getDataPointByIndex(0), 
uno::UNO_SET_THROW);
+        xPropertySet->getPropertyValue("Label") >>= aDataPointLabel;
+        CPPUNIT_ASSERT_EQUAL(sal_True, aDataPointLabel.ShowSeriesName);
+    }
+}
+
 void Chart2ExportTest::testCustomPositionofDataLabel()
 {
     load(u"/chart2/qa/extras/data/xlsx/", "testCustomPosDataLabels.xlsx");
diff --git a/chart2/qa/extras/data/ods/ser_labels.ods 
b/chart2/qa/extras/data/ods/ser_labels.ods
new file mode 100644
index 000000000000..c7bd96638268
Binary files /dev/null and b/chart2/qa/extras/data/ods/ser_labels.ods differ
diff --git a/chart2/qa/extras/data/xlsx/ser_labels.xlsx 
b/chart2/qa/extras/data/xlsx/ser_labels.xlsx
new file mode 100644
index 000000000000..ba2315666eda
Binary files /dev/null and b/chart2/qa/extras/data/xlsx/ser_labels.xlsx differ
diff --git 
a/chart2/source/controller/chartapiwrapper/WrappedDataCaptionProperties.cxx 
b/chart2/source/controller/chartapiwrapper/WrappedDataCaptionProperties.cxx
index c786c1b3913c..d317210c3608 100644
--- a/chart2/source/controller/chartapiwrapper/WrappedDataCaptionProperties.cxx
+++ b/chart2/source/controller/chartapiwrapper/WrappedDataCaptionProperties.cxx
@@ -65,13 +65,15 @@ sal_Int32 lcl_LabelToCaption( const chart2::DataPointLabel& 
rLabel )
         nCaption |= css::chart::ChartDataCaption::TEXT;
     if( rLabel.ShowLegendSymbol )
         nCaption |= css::chart::ChartDataCaption::SYMBOL;
+    if (rLabel.ShowSeriesName)
+        nCaption |= css::chart::ChartDataCaption::DATA_SERIES;
 
     return nCaption;
 }
 
 chart2::DataPointLabel lcl_CaptionToLabel( sal_Int32 nCaption )
 {
-    chart2::DataPointLabel aLabel(false,false,false,false,false);
+    chart2::DataPointLabel aLabel(false,false,false,false,false,false);
 
     if( nCaption & css::chart::ChartDataCaption::VALUE )
         aLabel.ShowNumber = true;
@@ -83,6 +85,8 @@ chart2::DataPointLabel lcl_CaptionToLabel( sal_Int32 nCaption 
)
         aLabel.ShowLegendSymbol = true;
     if( nCaption & css::chart::ChartDataCaption::CUSTOM )
         aLabel.ShowCustomLabel = true;
+    if( nCaption & css::chart::ChartDataCaption::DATA_SERIES )
+        aLabel.ShowSeriesName = true;
 
     return aLabel;
 }
diff --git a/chart2/source/controller/dialogs/res_DataLabel.cxx 
b/chart2/source/controller/dialogs/res_DataLabel.cxx
index 7934e90871dc..57a0d3c9565a 100644
--- a/chart2/source/controller/dialogs/res_DataLabel.cxx
+++ b/chart2/source/controller/dialogs/res_DataLabel.cxx
@@ -104,6 +104,7 @@ DataLabelResources::DataLabelResources(weld::Builder* 
pBuilder, weld::Window* pP
     , 
m_xFT_NumberFormatForPercent(pBuilder->weld_label("STR_DLG_NUMBERFORMAT_FOR_PERCENTAGE_VALUE"))
     , m_xCBCategory(pBuilder->weld_check_button("CB_CATEGORY"))
     , m_xCBSymbol(pBuilder->weld_check_button("CB_SYMBOL"))
+    , m_xCBDataSeries(pBuilder->weld_check_button("CB_DATA_SERIES_NAME"))
     , m_xCBWrapText(pBuilder->weld_check_button("CB_WRAP_TEXT"))
     , m_xSeparatorResources(pBuilder->weld_widget("boxSEPARATOR"))
     , m_xLB_Separator(pBuilder->weld_combo_box("LB_TEXT_SEPARATOR"))
@@ -148,6 +149,7 @@ DataLabelResources::DataLabelResources(weld::Builder* 
pBuilder, weld::Window* pP
     m_xCBPercent->connect_toggled( LINK( this, DataLabelResources, CheckHdl ));
     m_xCBCategory->connect_toggled(  LINK( this, DataLabelResources, CheckHdl 
));
     m_xCBSymbol->connect_toggled(  LINK( this, DataLabelResources, CheckHdl ));
+    m_xCBDataSeries->connect_toggled(  LINK( this, DataLabelResources, 
CheckHdl ));
     m_xCBWrapText->connect_toggled(  LINK( this, DataLabelResources, CheckHdl 
));
     m_xCBCustomLeaderLines->connect_toggled( LINK( this, DataLabelResources, 
CheckHdl ));
 
@@ -229,10 +231,10 @@ IMPL_LINK_NOARG(DataLabelResources, CheckHdl, 
weld::ToggleButton&, void)
 void DataLabelResources::EnableControls()
 {
     m_xCBSymbol->set_sensitive( m_xCBNumber->get_active() || 
(m_xCBPercent->get_active() && m_xCBPercent->get_sensitive())
-    || m_xCBCategory->get_active() );
+    || m_xCBCategory->get_active() || m_xCBDataSeries->get_active());
 
     m_xCBWrapText->set_sensitive( m_xCBNumber->get_active() || 
(m_xCBPercent->get_active() && m_xCBPercent->get_sensitive())
-    || m_xCBCategory->get_active() );
+    || m_xCBCategory->get_active() || m_xCBDataSeries->get_active() );
 
     // Enable or disable separator, placement and direction based on the check
     // box states. Note that the check boxes are tri-state.
@@ -244,6 +246,8 @@ void DataLabelResources::EnableControls()
             ++nNumberOfCheckedLabelParts;
         if (m_xCBCategory->get_state() != TRISTATE_FALSE)
             ++nNumberOfCheckedLabelParts;
+        if (m_xCBDataSeries->get_state() != TRISTATE_FALSE)
+            ++nNumberOfCheckedLabelParts;
 
         m_xSeparatorResources->set_sensitive( nNumberOfCheckedLabelParts > 1 );
 
@@ -256,8 +260,9 @@ void DataLabelResources::EnableControls()
     m_xPB_NumberFormatForValue->set_sensitive( m_pNumberFormatter && 
m_xCBNumber->get_active() );
     m_xPB_NumberFormatForPercent->set_sensitive( m_pNumberFormatter && 
m_xCBPercent->get_active() && m_xCBPercent->get_sensitive() );
 
-    bool bEnableRotation = ( m_xCBNumber->get_active() || 
m_xCBPercent->get_active() || m_xCBCategory->get_active() );
-    m_xBxOrientation->set_sensitive( bEnableRotation );
+    bool bEnableRotation = (m_xCBNumber->get_active() || 
m_xCBPercent->get_active()
+                            || m_xCBCategory->get_active() || 
m_xCBDataSeries->get_active());
+    m_xBxOrientation->set_sensitive(bEnableRotation);
 }
 
 void DataLabelResources::FillItemSet( SfxItemSet* rOutAttrs ) const
@@ -285,6 +290,8 @@ void DataLabelResources::FillItemSet( SfxItemSet* rOutAttrs 
) const
         rOutAttrs->Put( SfxBoolItem( SCHATTR_DATADESCR_SHOW_CATEGORY, 
m_xCBCategory->get_active() ) );
     if( m_xCBSymbol->get_state()!= TRISTATE_INDET )
         rOutAttrs->Put( SfxBoolItem( SCHATTR_DATADESCR_SHOW_SYMBOL, 
m_xCBSymbol->get_active()) );
+    if( m_xCBDataSeries->get_state()!= TRISTATE_INDET )
+        rOutAttrs->Put( SfxBoolItem( SCHATTR_DATADESCR_SHOW_DATA_SERIES_NAME, 
m_xCBDataSeries->get_active()) );
     if( m_xCBWrapText->get_state()!= TRISTATE_INDET )
         rOutAttrs->Put( SfxBoolItem( SCHATTR_DATADESCR_WRAP_TEXT, 
m_xCBWrapText->get_active()) );
     if( m_xCBCustomLeaderLines->get_state() != TRISTATE_INDET )
@@ -319,6 +326,7 @@ void DataLabelResources::Reset(const SfxItemSet& rInAttrs)
     lcl_setBoolItemToCheckBox( rInAttrs, SCHATTR_DATADESCR_SHOW_PERCENTAGE, 
*m_xCBPercent );
     lcl_setBoolItemToCheckBox( rInAttrs, SCHATTR_DATADESCR_SHOW_CATEGORY, 
*m_xCBCategory );
     lcl_setBoolItemToCheckBox( rInAttrs, SCHATTR_DATADESCR_SHOW_SYMBOL, 
*m_xCBSymbol );
+    lcl_setBoolItemToCheckBox( rInAttrs, 
SCHATTR_DATADESCR_SHOW_DATA_SERIES_NAME, *m_xCBDataSeries );
     lcl_setBoolItemToCheckBox( rInAttrs, SCHATTR_DATADESCR_WRAP_TEXT, 
*m_xCBWrapText );
     lcl_setBoolItemToCheckBox( rInAttrs, 
SCHATTR_DATADESCR_CUSTOM_LEADER_LINES, *m_xCBCustomLeaderLines );
 
diff --git a/chart2/source/controller/dialogs/res_DataLabel.hxx 
b/chart2/source/controller/dialogs/res_DataLabel.hxx
index 5358c0345495..1f832a4881a3 100644
--- a/chart2/source/controller/dialogs/res_DataLabel.hxx
+++ b/chart2/source/controller/dialogs/res_DataLabel.hxx
@@ -65,6 +65,7 @@ private:
     std::unique_ptr<weld::Label> m_xFT_NumberFormatForPercent;
     std::unique_ptr<weld::CheckButton> m_xCBCategory;
     std::unique_ptr<weld::CheckButton> m_xCBSymbol;
+    std::unique_ptr<weld::CheckButton> m_xCBDataSeries;
     std::unique_ptr<weld::CheckButton> m_xCBWrapText;
 
     std::unique_ptr<weld::Widget> m_xSeparatorResources;
diff --git a/chart2/source/controller/itemsetwrapper/DataPointItemConverter.cxx 
b/chart2/source/controller/itemsetwrapper/DataPointItemConverter.cxx
index 2c27b6ae7dc1..589972740e86 100644
--- a/chart2/source/controller/itemsetwrapper/DataPointItemConverter.cxx
+++ b/chart2/source/controller/itemsetwrapper/DataPointItemConverter.cxx
@@ -319,6 +319,7 @@ bool DataPointItemConverter::ApplySpecialItem(
         case SCHATTR_DATADESCR_SHOW_NUMBER:
         case SCHATTR_DATADESCR_SHOW_PERCENTAGE:
         case SCHATTR_DATADESCR_SHOW_CATEGORY:
+        case SCHATTR_DATADESCR_SHOW_DATA_SERIES_NAME:
         case SCHATTR_DATADESCR_SHOW_SYMBOL:
         {
             const SfxBoolItem & rItem = static_cast< const SfxBoolItem & >( 
rItemSet.Get( nWhichId ));
@@ -329,7 +330,8 @@ bool DataPointItemConverter::ApplySpecialItem(
             {
                 sal_Bool& rValue = (nWhichId==SCHATTR_DATADESCR_SHOW_NUMBER) ? 
aLabel.ShowNumber : (
                     (nWhichId==SCHATTR_DATADESCR_SHOW_PERCENTAGE) ? 
aLabel.ShowNumberInPercent : (
-                    (nWhichId==SCHATTR_DATADESCR_SHOW_CATEGORY) ? 
aLabel.ShowCategoryName : aLabel.ShowLegendSymbol ));
+                    (nWhichId==SCHATTR_DATADESCR_SHOW_CATEGORY) ? 
aLabel.ShowCategoryName : (
+                    (nWhichId==SCHATTR_DATADESCR_SHOW_DATA_SERIES_NAME) ? 
aLabel.ShowSeriesName : aLabel.ShowLegendSymbol )));
                 bool bOldValue = rValue;
                 rValue = rItem.GetValue();
                 if( m_bOverwriteLabelsForAttributedDataPointsAlso )
@@ -616,6 +618,7 @@ void DataPointItemConverter::FillSpecialItem(
         case SCHATTR_DATADESCR_SHOW_NUMBER:
         case SCHATTR_DATADESCR_SHOW_PERCENTAGE:
         case SCHATTR_DATADESCR_SHOW_CATEGORY:
+        case SCHATTR_DATADESCR_SHOW_DATA_SERIES_NAME:
         case SCHATTR_DATADESCR_SHOW_SYMBOL:
         {
             chart2::DataPointLabel aLabel;
@@ -623,7 +626,8 @@ void DataPointItemConverter::FillSpecialItem(
             {
                 bool bValue = (nWhichId==SCHATTR_DATADESCR_SHOW_NUMBER) ? 
aLabel.ShowNumber : (
                     (nWhichId==SCHATTR_DATADESCR_SHOW_PERCENTAGE) ? 
aLabel.ShowNumberInPercent : (
-                    (nWhichId==SCHATTR_DATADESCR_SHOW_CATEGORY) ? 
aLabel.ShowCategoryName : aLabel.ShowLegendSymbol ));
+                    (nWhichId==SCHATTR_DATADESCR_SHOW_CATEGORY) ? 
aLabel.ShowCategoryName : (
+                    (nWhichId==SCHATTR_DATADESCR_SHOW_DATA_SERIES_NAME) ? 
aLabel.ShowSeriesName : aLabel.ShowLegendSymbol )));
 
                 rOutItemSet.Put( SfxBoolItem( nWhichId, bValue ));
 
diff --git a/chart2/source/controller/itemsetwrapper/TextLabelItemConverter.cxx 
b/chart2/source/controller/itemsetwrapper/TextLabelItemConverter.cxx
index adc0b849414b..f7849456d401 100644
--- a/chart2/source/controller/itemsetwrapper/TextLabelItemConverter.cxx
+++ b/chart2/source/controller/itemsetwrapper/TextLabelItemConverter.cxx
@@ -268,6 +268,7 @@ bool TextLabelItemConverter::ApplySpecialItem( sal_uInt16 
nWhichId, const SfxIte
         case SCHATTR_DATADESCR_SHOW_NUMBER:
         case SCHATTR_DATADESCR_SHOW_PERCENTAGE:
         case SCHATTR_DATADESCR_SHOW_CATEGORY:
+        case SCHATTR_DATADESCR_SHOW_DATA_SERIES_NAME:
         case SCHATTR_DATADESCR_SHOW_SYMBOL:
         {
             const SfxBoolItem& rItem = static_cast<const 
SfxBoolItem&>(rItemSet.Get(nWhichId));
@@ -278,7 +279,8 @@ bool TextLabelItemConverter::ApplySpecialItem( sal_uInt16 
nWhichId, const SfxIte
             {
                 sal_Bool& rValue = (nWhichId == SCHATTR_DATADESCR_SHOW_NUMBER) 
? aLabel.ShowNumber : (
                     (nWhichId == SCHATTR_DATADESCR_SHOW_PERCENTAGE) ? 
aLabel.ShowNumberInPercent : (
-                        (nWhichId == SCHATTR_DATADESCR_SHOW_CATEGORY) ? 
aLabel.ShowCategoryName : aLabel.ShowLegendSymbol));
+                    (nWhichId == SCHATTR_DATADESCR_SHOW_CATEGORY) ? 
aLabel.ShowCategoryName :
+                    (nWhichId == SCHATTR_DATADESCR_SHOW_DATA_SERIES_NAME) ? 
aLabel.ShowSeriesName : aLabel.ShowLegendSymbol));
                 bool bOldValue = rValue;
                 rValue = rItem.GetValue();
                 if (mbDataSeries)
@@ -532,6 +534,7 @@ void TextLabelItemConverter::FillSpecialItem( sal_uInt16 
nWhichId, SfxItemSet& r
         case SCHATTR_DATADESCR_SHOW_NUMBER:
         case SCHATTR_DATADESCR_SHOW_PERCENTAGE:
         case SCHATTR_DATADESCR_SHOW_CATEGORY:
+        case SCHATTR_DATADESCR_SHOW_DATA_SERIES_NAME:
         case SCHATTR_DATADESCR_SHOW_SYMBOL:
         {
             chart2::DataPointLabel aLabel;
@@ -539,7 +542,8 @@ void TextLabelItemConverter::FillSpecialItem( sal_uInt16 
nWhichId, SfxItemSet& r
             {
                 bool bValue = (nWhichId == SCHATTR_DATADESCR_SHOW_NUMBER) ? 
aLabel.ShowNumber : (
                     (nWhichId == SCHATTR_DATADESCR_SHOW_PERCENTAGE) ? 
aLabel.ShowNumberInPercent : (
-                        (nWhichId == SCHATTR_DATADESCR_SHOW_CATEGORY) ? 
aLabel.ShowCategoryName : aLabel.ShowLegendSymbol));
+                    (nWhichId == SCHATTR_DATADESCR_SHOW_CATEGORY) ? 
aLabel.ShowCategoryName : (
+                    (nWhichId == SCHATTR_DATADESCR_SHOW_DATA_SERIES_NAME) ? 
aLabel.ShowSeriesName :  aLabel.ShowLegendSymbol)));
 
                 rOutItemSet.Put(SfxBoolItem(nWhichId, bValue));
 
diff --git a/chart2/source/controller/main/ChartController_Tools.cxx 
b/chart2/source/controller/main/ChartController_Tools.cxx
index 55b4bed88ab6..093cbcdaeac8 100644
--- a/chart2/source/controller/main/ChartController_Tools.cxx
+++ b/chart2/source/controller/main/ChartController_Tools.cxx
@@ -770,6 +770,7 @@ bool ChartController::executeDispatch_Delete()
                     aLabel.ShowCategoryName = false;
                     aLabel.ShowLegendSymbol = false;
                     aLabel.ShowCustomLabel = false;
+                    aLabel.ShowSeriesName = false;
                     if( aObjectType == OBJECTTYPE_DATA_LABELS )
                     {
                         uno::Reference< chart2::XDataSeries > xSeries( 
ObjectIdentifier::getDataSeriesForCID( aCID, getModel() ));
diff --git a/chart2/source/inc/chartview/ChartSfxItemIds.hxx 
b/chart2/source/inc/chartview/ChartSfxItemIds.hxx
index 76f9e702d85b..7ed412ce4500 100644
--- a/chart2/source/inc/chartview/ChartSfxItemIds.hxx
+++ b/chart2/source/inc/chartview/ChartSfxItemIds.hxx
@@ -52,7 +52,8 @@ constexpr TypedWhichId<SfxBoolItem>        
SCHATTR_DATADESCR_NO_PERCENTVALUE
 constexpr TypedWhichId<SfxBoolItem>        
SCHATTR_DATADESCR_CUSTOM_LEADER_LINES  (SCHATTR_DATADESCR_START + 9);
 constexpr TypedWhichId<SfxUInt32Item>      SCHATTR_PERCENT_NUMBERFORMAT_VALUE  
   (SCHATTR_DATADESCR_START + 10);
 constexpr TypedWhichId<SfxBoolItem>        SCHATTR_PERCENT_NUMBERFORMAT_SOURCE 
   (SCHATTR_DATADESCR_START + 11);
-constexpr sal_uInt16                       SCHATTR_DATADESCR_END               
   (SCHATTR_PERCENT_NUMBERFORMAT_SOURCE);
+constexpr TypedWhichId<SfxBoolItem>        
SCHATTR_DATADESCR_SHOW_DATA_SERIES_NAME (SCHATTR_DATADESCR_START + 12);
+constexpr sal_uInt16                       SCHATTR_DATADESCR_END               
   (SCHATTR_DATADESCR_SHOW_DATA_SERIES_NAME);
 
 //legend
 constexpr sal_uInt16                 SCHATTR_LEGEND_START      
(SCHATTR_DATADESCR_END + 1);
diff --git a/chart2/source/model/main/DataPointProperties.cxx 
b/chart2/source/model/main/DataPointProperties.cxx
index dcc343002ffb..267bf9014dca 100644
--- a/chart2/source/model/main/DataPointProperties.cxx
+++ b/chart2/source/model/main/DataPointProperties.cxx
@@ -516,7 +516,8 @@ void DataPointProperties::AddDefaultsToMap(
             false, // ShowNumberInPercent
             false, // ShowCategoryName
             false, // ShowLegendSymbol
-            false  // ShowCustomLabel
+            false, // ShowCustomLabel
+            false // ShowSeriesName
             ));
 
     PropertyHelper::setPropertyValueDefault( rOutMap, 
PROP_DATAPOINT_TEXT_WORD_WRAP, false );
diff --git a/chart2/source/tools/DataSeriesHelper.cxx 
b/chart2/source/tools/DataSeriesHelper.cxx
index c7dabaf1d4da..9f17273c1607 100644
--- a/chart2/source/tools/DataSeriesHelper.cxx
+++ b/chart2/source/tools/DataSeriesHelper.cxx
@@ -171,6 +171,7 @@ void lcl_insertOrDeleteDataLabelsToSeriesAndAllPoints( 
const Reference< chart2::
                             aLabel.ShowNumberInPercent = false;
                             aLabel.ShowCategoryName = false;
                             aLabel.ShowCustomLabel = false;
+                            aLabel.ShowSeriesName = false;
                         }
                         xPointProp->setPropertyValue(CHART_UNONAME_LABEL, 
uno::Any(aLabel));
                         
xPointProp->setPropertyValue(CHART_UNONAME_CUSTOM_LABEL_FIELDS, uno::Any());
@@ -720,7 +721,8 @@ bool hasDataLabelsAtSeries( const Reference< 
chart2::XDataSeries >& xSeries )
         {
             DataPointLabel aLabel;
             if( xProp->getPropertyValue(CHART_UNONAME_LABEL) >>= aLabel )
-                bRet = aLabel.ShowNumber || aLabel.ShowNumberInPercent || 
aLabel.ShowCategoryName;
+                bRet = aLabel.ShowNumber || aLabel.ShowNumberInPercent || 
aLabel.ShowCategoryName
+                       || aLabel.ShowSeriesName;
         }
     }
     catch(const uno::Exception &)
@@ -748,7 +750,9 @@ bool hasDataLabelsAtPoints( const Reference< 
chart2::XDataSeries >& xSeries )
                     {
                         DataPointLabel aLabel;
                         if( xPointProp->getPropertyValue(CHART_UNONAME_LABEL) 
>>= aLabel )
-                            bRet = aLabel.ShowNumber || 
aLabel.ShowNumberInPercent || aLabel.ShowCategoryName || aLabel.ShowCustomLabel;
+                            bRet = aLabel.ShowNumber || 
aLabel.ShowNumberInPercent
+                                   || aLabel.ShowCategoryName || 
aLabel.ShowCustomLabel
+                                   || aLabel.ShowSeriesName;
                         if( bRet )
                             break;
                     }
@@ -786,7 +790,9 @@ bool hasDataLabelAtPoint( const Reference< 
chart2::XDataSeries >& xSeries, sal_I
             {
                 DataPointLabel aLabel;
                 if( xProp->getPropertyValue(CHART_UNONAME_LABEL) >>= aLabel )
-                    bRet = aLabel.ShowNumber || aLabel.ShowNumberInPercent || 
aLabel.ShowCategoryName || aLabel.ShowCustomLabel;
+                    bRet = aLabel.ShowNumber || aLabel.ShowNumberInPercent
+                           || aLabel.ShowCategoryName || aLabel.ShowCustomLabel
+                           || aLabel.ShowSeriesName;
             }
         }
     }
@@ -837,6 +843,7 @@ void deleteDataLabelsFromPoint( const Reference< 
beans::XPropertySet >& xPointPr
             aLabel.ShowNumberInPercent = false;
             aLabel.ShowCategoryName = false;
             aLabel.ShowCustomLabel = false;
+            aLabel.ShowSeriesName = false;
             xPointProp->setPropertyValue(CHART_UNONAME_LABEL, 
uno::Any(aLabel));
             xPointProp->setPropertyValue(CHART_UNONAME_CUSTOM_LABEL_FIELDS, 
uno::Any());
         }
diff --git a/chart2/source/view/charttypes/VSeriesPlotter.cxx 
b/chart2/source/view/charttypes/VSeriesPlotter.cxx
index 92cb3786d594..c235148a2045 100644
--- a/chart2/source/view/charttypes/VSeriesPlotter.cxx
+++ b/chart2/source/view/charttypes/VSeriesPlotter.cxx
@@ -497,7 +497,7 @@ uno::Reference< drawing::XShape > 
VSeriesPlotter::createDataLabel( const uno::Re
         }
 
         sal_Int32 nLineCountForSymbolsize = 0;
-        sal_uInt32 nTextListLength = 3;
+        sal_uInt32 nTextListLength = 4;
         sal_uInt32 nCustomLabelsCount = aCustomLabels.getLength();
         Sequence< OUString > aTextList( nTextListLength );
 
@@ -571,9 +571,18 @@ uno::Reference< drawing::XShape > 
VSeriesPlotter::createDataLabel( const uno::Re
                 aTextList[0] = getCategoryName( nPointIndex );
             }
 
+            if( pLabel->ShowSeriesName )
+            {
+                OUString aRole;
+                if ( m_xChartTypeModel )
+                    aRole = 
m_xChartTypeModel->getRoleOfSequenceForSeriesLabel();
+                const uno::Reference< XDataSeries >& xSeries( 
rDataSeries.getModel() );
+                aTextList[1] = DataSeriesHelper::getDataSeriesLabel( xSeries, 
aRole );
+            }
+
             if( pLabel->ShowNumber )
             {
-                aTextList[1] = getLabelTextForValue(rDataSeries, nPointIndex, 
fValue, false);
+                aTextList[2] = getLabelTextForValue(rDataSeries, nPointIndex, 
fValue, false);
             }
 
             if( pLabel->ShowNumberInPercent )
@@ -584,7 +593,7 @@ uno::Reference< drawing::XShape > 
VSeriesPlotter::createDataLabel( const uno::Re
                 if( fValue < 0 )
                     fValue*=-1.0;
 
-                aTextList[2] = getLabelTextForValue(rDataSeries, nPointIndex, 
fValue, true);
+                aTextList[3] = getLabelTextForValue(rDataSeries, nPointIndex, 
fValue, true);
             }
         }
 
diff --git a/chart2/source/view/main/ChartItemPool.cxx 
b/chart2/source/view/main/ChartItemPool.cxx
index 6af1c34c6ef6..7f67cdde45ca 100644
--- a/chart2/source/view/main/ChartItemPool.cxx
+++ b/chart2/source/view/main/ChartItemPool.cxx
@@ -48,6 +48,7 @@ ChartItemPool::ChartItemPool():
     rPoolDefaults[SCHATTR_DATADESCR_SHOW_PERCENTAGE- SCHATTR_START] = new 
SfxBoolItem(SCHATTR_DATADESCR_SHOW_PERCENTAGE);
     rPoolDefaults[SCHATTR_DATADESCR_SHOW_CATEGORY  - SCHATTR_START] = new 
SfxBoolItem(SCHATTR_DATADESCR_SHOW_CATEGORY);
     rPoolDefaults[SCHATTR_DATADESCR_SHOW_SYMBOL    - SCHATTR_START] = new 
SfxBoolItem(SCHATTR_DATADESCR_SHOW_SYMBOL);
+    rPoolDefaults[SCHATTR_DATADESCR_SHOW_DATA_SERIES_NAME - SCHATTR_START] = 
new SfxBoolItem(SCHATTR_DATADESCR_SHOW_DATA_SERIES_NAME);
     rPoolDefaults[SCHATTR_DATADESCR_WRAP_TEXT      - SCHATTR_START] = new 
SfxBoolItem(SCHATTR_DATADESCR_WRAP_TEXT);
     rPoolDefaults[SCHATTR_DATADESCR_SEPARATOR      - SCHATTR_START] = new 
SfxStringItem(SCHATTR_DATADESCR_SEPARATOR," ");
     rPoolDefaults[SCHATTR_DATADESCR_PLACEMENT      - SCHATTR_START] = new 
SfxInt32Item(SCHATTR_DATADESCR_PLACEMENT,0);
diff --git a/chart2/source/view/main/VDataSeries.cxx 
b/chart2/source/view/main/VDataSeries.cxx
index 35606be26fa0..545254ecfccc 100644
--- a/chart2/source/view/main/VDataSeries.cxx
+++ b/chart2/source/view/main/VDataSeries.cxx
@@ -995,7 +995,7 @@ DataPointLabel* VDataSeries::getDataPointLabelIfLabel( 
sal_Int32 index ) const
 {
     DataPointLabel* pLabel = getDataPointLabel( index );
     if( !pLabel || (!pLabel->ShowNumber && !pLabel->ShowNumberInPercent
-        && !pLabel->ShowCategoryName && !pLabel->ShowCustomLabel ) )
+        && !pLabel->ShowCategoryName && !pLabel->ShowCustomLabel && 
!pLabel->ShowSeriesName ) )
         return nullptr;
     return pLabel;
 }
diff --git a/chart2/uiconfig/ui/dlg_DataLabel.ui 
b/chart2/uiconfig/ui/dlg_DataLabel.ui
index 17b6e70899be..1851a4f9c7d7 100644
--- a/chart2/uiconfig/ui/dlg_DataLabel.ui
+++ b/chart2/uiconfig/ui/dlg_DataLabel.ui
@@ -88,15 +88,14 @@
                 <property name="label_xalign">0</property>
                 <property name="shadow_type">none</property>
                 <child>
-                  <!-- n-columns=1 n-rows=1 -->
                   <object class="GtkGrid" id="grid1">
                     <property name="visible">True</property>
                     <property name="can_focus">False</property>
+                    <property name="margin_start">12</property>
+                    <property name="margin_top">6</property>
                     <property name="row_spacing">6</property>
                     <property name="column_spacing">12</property>
                     <property name="row_homogeneous">True</property>
-                    <property name="margin-start">12</property>
-                    <property name="margin-top">6</property>
                     <child>
                       <object class="GtkCheckButton" id="CB_VALUE_AS_NUMBER">
                         <property name="label" translatable="yes" 
context="dlg_DataLabel|CB_VALUE_AS_NUMBER">Show value as _number</property>
@@ -170,7 +169,7 @@
                       </object>
                       <packing>
                         <property name="left_attach">0</property>
-                        <property name="top_attach">3</property>
+                        <property name="top_attach">4</property>
                       </packing>
                     </child>
                     <child>
@@ -184,7 +183,7 @@
                       </object>
                       <packing>
                         <property name="left_attach">0</property>
-                        <property name="top_attach">4</property>
+                        <property name="top_attach">5</property>
                       </packing>
                     </child>
                     <child>
@@ -286,7 +285,7 @@
                       </object>
                       <packing>
                         <property name="left_attach">0</property>
-                        <property name="top_attach">5</property>
+                        <property name="top_attach">6</property>
                         <property name="width">2</property>
                       </packing>
                     </child>
@@ -345,7 +344,7 @@
                       </object>
                       <packing>
                         <property name="left_attach">0</property>
-                        <property name="top_attach">6</property>
+                        <property name="top_attach">7</property>
                         <property name="width">2</property>
                       </packing>
                     </child>
@@ -359,6 +358,29 @@
                         <property name="top_attach">2</property>
                       </packing>
                     </child>
+                    <child>
+                      <object class="GtkCheckButton" id="CB_DATA_SERIES_NAME">
+                        <property name="label" translatable="yes" 
context="dlg_DataLabel|CB_DATA_SERIES_NAME">Show data _series name</property>
+                        <property name="visible">True</property>
+                        <property name="can_focus">True</property>
+                        <property name="receives_default">False</property>
+                        <property name="use_underline">True</property>
+                        <property name="xalign">0</property>
+                        <property name="draw_indicator">True</property>
+                        <child internal-child="accessible">
+                          <object class="AtkObject" 
id="CB_DATA_SERIES_NAME-atkobject">
+                            <property name="AtkObject::accessible-description" 
translatable="yes" 
context="dlg_DataLabel|extended_tip|CB_DATA_SERIES_NAME">Shows the data series 
name in the label.</property>
+                          </object>
+                        </child>
+                      </object>
+                      <packing>
+                        <property name="left_attach">0</property>
+                        <property name="top_attach">3</property>
+                      </packing>
+                    </child>
+                    <child>
+                      <placeholder/>
+                    </child>
                     <child>
                       <placeholder/>
                     </child>
@@ -392,10 +414,10 @@
                   <object class="GtkBox" id="box5">
                     <property name="visible">True</property>
                     <property name="can_focus">False</property>
+                    <property name="margin_start">12</property>
+                    <property name="margin_top">6</property>
                     <property name="orientation">vertical</property>
                     <property name="spacing">6</property>
-                    <property name="margin-start">12</property>
-                    <property name="margin-top">6</property>
                     <child>
                       <object class="GtkBox" id="boxORIENTATION">
                         <property name="visible">True</property>
@@ -532,9 +554,9 @@
                   <object class="GtkBox" id="box6">
                     <property name="visible">True</property>
                     <property name="can_focus">False</property>
+                    <property name="margin_start">12</property>
+                    <property name="margin_top">6</property>
                     <property name="orientation">vertical</property>
-                    <property name="margin-start">12</property>
-                    <property name="margin-top">6</property>
                     <child>
                       <object class="GtkCheckButton" 
id="CB_CUSTOM_LEADER_LINES">
                         <property name="label" translatable="yes" 
context="dlg_DataLabel|CB_CUSTOM_LEADER_LINES">_Connect displaced data labels 
to data points</property>
diff --git a/chart2/uiconfig/ui/tp_DataLabel.ui 
b/chart2/uiconfig/ui/tp_DataLabel.ui
index 86965db829b4..f02c8499d96a 100644
--- a/chart2/uiconfig/ui/tp_DataLabel.ui
+++ b/chart2/uiconfig/ui/tp_DataLabel.ui
@@ -20,15 +20,14 @@
         <property name="label_xalign">0</property>
         <property name="shadow_type">none</property>
         <child>
-          <!-- n-columns=1 n-rows=1 -->
           <object class="GtkGrid" id="grid1">
             <property name="visible">True</property>
             <property name="can_focus">False</property>
+            <property name="margin_start">12</property>
+            <property name="margin_top">6</property>
             <property name="row_spacing">6</property>
             <property name="column_spacing">12</property>
             <property name="row_homogeneous">True</property>
-            <property name="margin-start">12</property>
-            <property name="margin-top">6</property>
             <child>
               <object class="GtkCheckButton" id="CB_VALUE_AS_NUMBER">
                 <property name="label" translatable="yes" 
context="tp_DataLabel|CB_VALUE_AS_NUMBER">Show value as _number</property>
@@ -102,7 +101,7 @@
               </object>
               <packing>
                 <property name="left_attach">0</property>
-                <property name="top_attach">3</property>
+                <property name="top_attach">4</property>
               </packing>
             </child>
             <child>
@@ -116,7 +115,7 @@
               </object>
               <packing>
                 <property name="left_attach">0</property>
-                <property name="top_attach">4</property>
+                <property name="top_attach">5</property>
               </packing>
             </child>
             <child>
@@ -218,7 +217,7 @@
               </object>
               <packing>
                 <property name="left_attach">0</property>
-                <property name="top_attach">5</property>
+                <property name="top_attach">6</property>
                 <property name="width">2</property>
               </packing>
             </child>
@@ -277,7 +276,7 @@
               </object>
               <packing>
                 <property name="left_attach">0</property>
-                <property name="top_attach">6</property>
+                <property name="top_attach">7</property>
                 <property name="width">2</property>
               </packing>
             </child>
@@ -291,6 +290,29 @@
                 <property name="top_attach">2</property>
               </packing>
             </child>
+            <child>
+              <object class="GtkCheckButton" id="CB_DATA_SERIES_NAME">
+                <property name="label" translatable="yes" 
context="tp_DataLabel|CB_DATA_SERIES_NAME">Show data _series name</property>
+                <property name="visible">True</property>
+                <property name="can_focus">True</property>
+                <property name="receives_default">False</property>
+                <property name="use_underline">True</property>
+                <property name="xalign">0</property>
+                <property name="draw_indicator">True</property>
+                <child internal-child="accessible">
+                  <object class="AtkObject" id="CB_DATA_SERIES_NAME-atkobject">
+                    <property name="AtkObject::accessible-description" 
translatable="yes" 
context="tp_DataLabel|extended_tip|CB_DATA_SERIES_NAME">Shows the data series 
name in the label.</property>
+                  </object>
+                </child>
+              </object>
+              <packing>
+                <property name="left_attach">0</property>
+                <property name="top_attach">3</property>
+              </packing>
+            </child>
+            <child>
+              <placeholder/>
+            </child>
             <child>
               <placeholder/>
             </child>
@@ -324,10 +346,10 @@
           <object class="GtkBox" id="box5">
             <property name="visible">True</property>
             <property name="can_focus">False</property>
+            <property name="margin_start">12</property>
+            <property name="margin_top">6</property>
             <property name="orientation">vertical</property>
             <property name="spacing">6</property>
-            <property name="margin-start">12</property>
-            <property name="margin-top">6</property>
             <child>
               <object class="GtkBox" id="boxORIENTATION">
                 <property name="visible">True</property>
@@ -464,9 +486,9 @@
           <object class="GtkBox" id="box6">
             <property name="visible">True</property>
             <property name="can_focus">False</property>
+            <property name="margin_start">12</property>
+            <property name="margin_top">6</property>
             <property name="orientation">vertical</property>
-            <property name="margin-start">12</property>
-            <property name="margin-top">6</property>
             <child>
               <object class="GtkCheckButton" id="CB_CUSTOM_LEADER_LINES">
                 <property name="label" translatable="yes" 
context="tp_DataLabel|CB_CUSTOM_LEADER_LINES">_Connect displaced data labels to 
data points</property>
diff --git a/include/xmloff/xmltoken.hxx b/include/xmloff/xmltoken.hxx
index 96bff94874dd..88515ae67e9d 100644
--- a/include/xmloff/xmltoken.hxx
+++ b/include/xmloff/xmltoken.hxx
@@ -564,6 +564,7 @@ namespace xmloff::token {
         XML_DATA_LABEL_NUMBER,
         XML_DATA_LABEL_SYMBOL,
         XML_DATA_LABEL_TEXT,
+        XML_DATA_LABEL_SERIES,
         XML_DATA_PILOT_SOURCE,
         XML_DATA_PILOT_FIELD,
         XML_DATA_PILOT_GRAND_TOTAL,
diff --git a/offapi/com/sun/star/chart/ChartDataCaption.idl 
b/offapi/com/sun/star/chart/ChartDataCaption.idl
index fb5da8034961..e61251549196 100644
--- a/offapi/com/sun/star/chart/ChartDataCaption.idl
+++ b/offapi/com/sun/star/chart/ChartDataCaption.idl
@@ -76,6 +76,12 @@ published constants ChartDataCaption
         @since LibreOffice 7.1
      */
     const long CUSTOM = 32;
+
+    /** The name of the data series is additionally displayed in the caption.
+
+        @since LibreOffice 7.2
+     */
+    const long DATA_SERIES = 64;
 };
 
 
diff --git a/offapi/com/sun/star/chart2/DataPointLabel.idl 
b/offapi/com/sun/star/chart2/DataPointLabel.idl
index f16245c8797a..4b7f27c20836 100644
--- a/offapi/com/sun/star/chart2/DataPointLabel.idl
+++ b/offapi/com/sun/star/chart2/DataPointLabel.idl
@@ -64,6 +64,12 @@ struct DataPointLabel
         @since LibreOffice 7.1
      */
     boolean                     ShowCustomLabel;
+
+    /** The name of the data series is additionally displayed in the caption.
+
+        @since LibreOffice 7.2
+     */
+    boolean ShowSeriesName;
 };
 
 
diff --git a/oox/source/drawingml/chart/seriesconverter.cxx 
b/oox/source/drawingml/chart/seriesconverter.cxx
index 6e0b21071553..2c3341a30e1a 100644
--- a/oox/source/drawingml/chart/seriesconverter.cxx
+++ b/oox/source/drawingml/chart/seriesconverter.cxx
@@ -132,6 +132,7 @@ void lclConvertLabelFormatting( PropertySet& rPropSet, 
ObjectFormatter& rFormatt
     bool bShowValue   = !rDataLabel.mbDeleted && rDataLabel.mobShowVal.get( 
!bMSO2007Doc );
     bool bShowPercent = !rDataLabel.mbDeleted && 
rDataLabel.mobShowPercent.get( !bMSO2007Doc ) && (rTypeInfo.meTypeCategory == 
TYPECATEGORY_PIE);
     bool bShowCateg   = !rDataLabel.mbDeleted && 
rDataLabel.mobShowCatName.get( !bMSO2007Doc );
+    bool bShowSerName = !rDataLabel.mbDeleted && 
rDataLabel.mobShowSerName.get( !bMSO2007Doc );
     bool bShowSymbol  = !rDataLabel.mbDeleted && 
rDataLabel.mobShowLegendKey.get( !bMSO2007Doc );
 
     // tdf#132174, tdf#136650: the inner data table has no own cell number 
format.
@@ -141,7 +142,7 @@ void lclConvertLabelFormatting( PropertySet& rPropSet, 
ObjectFormatter& rFormatt
     // type of attached label
     if( bHasAnyElement || rDataLabel.mbDeleted )
     {
-        DataPointLabel aPointLabel( bShowValue, bShowPercent, bShowCateg, 
bShowSymbol, bCustomLabelField );
+        DataPointLabel aPointLabel( bShowValue, bShowPercent, bShowCateg, 
bShowSymbol, bCustomLabelField, bShowSerName );
         rPropSet.setProperty( PROP_Label, aPointLabel );
     }
 
diff --git a/oox/source/export/chartexport.cxx 
b/oox/source/export/chartexport.cxx
index 177660e42f85..e15e58a4f3ff 100644
--- a/oox/source/export/chartexport.cxx
+++ b/oox/source/export/chartexport.cxx
@@ -3663,7 +3663,7 @@ void writeLabelProperties( const FSHelperPtr& pFS, 
ChartExport* pChartExport,
     pFS->singleElement(FSNS(XML_c, XML_showLegendKey), XML_val, 
ToPsz10(aLabel.ShowLegendSymbol));
     pFS->singleElement(FSNS(XML_c, XML_showVal), XML_val, 
ToPsz10(aLabel.ShowNumber));
     pFS->singleElement(FSNS(XML_c, XML_showCatName), XML_val, 
ToPsz10(aLabel.ShowCategoryName));
-    pFS->singleElement(FSNS(XML_c, XML_showSerName), XML_val, ToPsz10(false));
+    pFS->singleElement(FSNS(XML_c, XML_showSerName), XML_val, 
ToPsz10(aLabel.ShowSeriesName));
     pFS->singleElement(FSNS(XML_c, XML_showPercent), XML_val, 
ToPsz10(aLabel.ShowNumberInPercent));
 
     // Export the text "separator" if exists
diff --git a/sc/source/filter/excel/xichart.cxx 
b/sc/source/filter/excel/xichart.cxx
index 81cee0d9df63..55c13e592cd4 100644
--- a/sc/source/filter/excel/xichart.cxx
+++ b/sc/source/filter/excel/xichart.cxx
@@ -1102,7 +1102,7 @@ void XclImpChText::ConvertDataLabel( ScfPropertySet& 
rPropSet, const XclChTypeIn
     bool bShowSymbol = bShowAny && ::get_flag( maData.mnFlags, 
EXC_CHTEXT_SHOWSYMBOL );
 
     // create API struct for label values, set API label separator
-    cssc2::DataPointLabel aPointLabel( bShowValue, bShowPercent, bShowCateg, 
bShowSymbol, false );
+    cssc2::DataPointLabel aPointLabel( bShowValue, bShowPercent, bShowCateg, 
bShowSymbol, false, false );
     rPropSet.SetProperty( EXC_CHPROP_LABEL, aPointLabel );
     OUString aSep = mxLabelProps ? mxLabelProps->maSeparator : OUString('\n');
     if( aSep.isEmpty() )
diff --git a/xmloff/source/chart/PropertyMap.hxx 
b/xmloff/source/chart/PropertyMap.hxx
index d98fa98e8912..00a6ed7ea6f3 100644
--- a/xmloff/source/chart/PropertyMap.hxx
+++ b/xmloff/source/chart/PropertyMap.hxx
@@ -83,6 +83,7 @@
 #define XML_SCH_CONTEXT_SPECIAL_LABEL_SEPARATOR     ( XML_SCH_CTF_START + 24 )
 #define XML_SCH_CONTEXT_SPECIAL_ERRORBAR_RANGE      ( XML_SCH_CTF_START + 25 )
 #define XML_SCH_CONTEXT_SPECIAL_REGRESSION_TYPE     ( XML_SCH_CTF_START + 26 )
+#define XML_SCH_CONTEXT_SPECIAL_DATA_LABEL_SERIES   ( XML_SCH_CTF_START + 27 )
 
 #define MAP_FULL( ApiName, NameSpace, XMLTokenName, XMLType, ContextId, 
EarliestODFVersionForExport ) { ApiName, sizeof(ApiName)-1, 
XML_NAMESPACE_##NameSpace, xmloff::token::XMLTokenName, 
XMLType|XML_TYPE_PROP_CHART, ContextId, EarliestODFVersionForExport, false }
 #define MAP_ENTRY( a, ns, nm, t )            { a, sizeof(a)-1, 
XML_NAMESPACE_##ns, xmloff::token::nm, t|XML_TYPE_PROP_CHART, 0, 
SvtSaveOptions::ODFSVER_010, false }
@@ -248,6 +249,7 @@ const XMLPropertyMapEntry aXMLChartPropMap[] =
     MAP_SPECIAL( "DataCaption", CHART, XML_DATA_LABEL_NUMBER, XML_TYPE_NUMBER 
| MID_FLAG_MERGE_PROPERTY, XML_SCH_CONTEXT_SPECIAL_DATA_LABEL_NUMBER ),   // 
convert one constant
     MAP_SPECIAL( "DataCaption", CHART, XML_DATA_LABEL_TEXT, XML_TYPE_NUMBER | 
MID_FLAG_MERGE_PROPERTY, XML_SCH_CONTEXT_SPECIAL_DATA_LABEL_TEXT ),       // to 
'tristate' and two bools
     MAP_SPECIAL( "DataCaption", CHART, XML_DATA_LABEL_SYMBOL, XML_TYPE_NUMBER 
| MID_FLAG_MERGE_PROPERTY, XML_SCH_CONTEXT_SPECIAL_DATA_LABEL_SYMBOL ),
+    MAP_SPECIAL( "DataCaption", CHART, XML_DATA_LABEL_SERIES, XML_TYPE_NUMBER 
| MID_FLAG_MERGE_PROPERTY, XML_SCH_CONTEXT_SPECIAL_DATA_LABEL_SERIES ),
     MAP_SPECIAL_ODF12( "LabelSeparator", CHART, XML_LABEL_SEPARATOR, 
XML_TYPE_STRING | MID_FLAG_ELEMENT_ITEM, 
XML_SCH_CONTEXT_SPECIAL_LABEL_SEPARATOR ),
     MAP_ENTRY_ODF12( "LabelPlacement", CHART, XML_LABEL_POSITION, 
XML_SCH_TYPE_LABEL_PLACEMENT_TYPE ),
     MAP_ENTRY( "SegmentOffset", CHART, XML_PIE_OFFSET, XML_TYPE_NUMBER ),
diff --git a/xmloff/source/chart/PropertyMaps.cxx 
b/xmloff/source/chart/PropertyMaps.cxx
index 6ce23fb54c68..f93747b93794 100644
--- a/xmloff/source/chart/PropertyMaps.cxx
+++ b/xmloff/source/chart/PropertyMaps.cxx
@@ -461,6 +461,11 @@ void XMLChartExportPropertyMapper::handleSpecialItem(
                 bValue = (( nValue & chart::ChartDataCaption::SYMBOL ) == 
chart::ChartDataCaption::SYMBOL );
                 ::sax::Converter::convertBool( sValueBuffer, bValue );
                 break;
+            case XML_SCH_CONTEXT_SPECIAL_DATA_LABEL_SERIES:
+                rProperty.maValue >>= nValue;
+                bValue = (( nValue & chart::ChartDataCaption::DATA_SERIES ) == 
chart::ChartDataCaption::DATA_SERIES );
+                ::sax::Converter::convertBool( sValueBuffer, bValue );
+                break;
             case XML_SCH_CONTEXT_SPECIAL_SYMBOL_WIDTH:
             case XML_SCH_CONTEXT_SPECIAL_SYMBOL_HEIGHT:
                 {
@@ -642,6 +647,15 @@ bool XMLChartImportPropertyMapper::handleSpecialItem(
                     SCH_XML_UNSETFLAG( nValue, chart::ChartDataCaption::SYMBOL 
);
                 rProperty.maValue <<= nValue;
                 break;
+            case XML_SCH_CONTEXT_SPECIAL_DATA_LABEL_SERIES:
+                rProperty.maValue >>= nValue;
+                (void)::sax::Converter::convertBool( bValue, rValue );
+                if( bValue )
+                    SCH_XML_SETFLAG( nValue, 
chart::ChartDataCaption::DATA_SERIES );
+                else
+                    SCH_XML_UNSETFLAG( nValue, 
chart::ChartDataCaption::DATA_SERIES );
+                rProperty.maValue <<= nValue;
+                break;
             case XML_SCH_CONTEXT_SPECIAL_SYMBOL_WIDTH:
             case XML_SCH_CONTEXT_SPECIAL_SYMBOL_HEIGHT:
                 {
diff --git a/xmloff/source/core/xmltoken.cxx b/xmloff/source/core/xmltoken.cxx
index a75b152fb23b..d46ec76fb7fa 100644
--- a/xmloff/source/core/xmltoken.cxx
+++ b/xmloff/source/core/xmltoken.cxx
@@ -569,6 +569,7 @@ namespace xmloff::token {
         TOKEN( "data-label-number",               XML_DATA_LABEL_NUMBER ),
         TOKEN( "data-label-symbol",               XML_DATA_LABEL_SYMBOL ),
         TOKEN( "data-label-text",                 XML_DATA_LABEL_TEXT ),
+        TOKEN( "data-label-series",               XML_DATA_LABEL_SERIES ),
         TOKEN( "data-pilot-source",               XML_DATA_PILOT_SOURCE ),
         TOKEN( "data-pilot-field",                XML_DATA_PILOT_FIELD ),
         TOKEN( "data-pilot-grand-total",          XML_DATA_PILOT_GRAND_TOTAL ),
diff --git a/xmloff/source/token/tokens.txt b/xmloff/source/token/tokens.txt
index 930046909201..dcf905ba40e6 100644
--- a/xmloff/source/token/tokens.txt
+++ b/xmloff/source/token/tokens.txt
@@ -484,6 +484,7 @@ data-label
 data-label-number
 data-label-symbol
 data-label-text
+data-label-series
 data-pilot-source
 data-pilot-field
 data-pilot-grand-total
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to