Chart with two Category Axis Category Labels

I have a chart that I can generate with the code (see "Chart by Code").

I want it to look like this (see Chart Example):

The code is setting the Primary Category Axis Category Labels as such:

chart.PrimaryCategoryAxis.CategoryLabels = chart.ChartData[2, 1, 25, 2];

How do I set the Primary Category Axis to have these Grades grouped by the fiscal year?


Attachment: Chart_Samples_ced4f13.zip

8 Replies

LB Lokesh Baskar Syncfusion Team October 7, 2021 10:13 AM UTC

Hi Edward,

Thank you for contacting Syncfusion support.

Currently, we are checking the feasible solution for your requirement. We will update the further details on 11th October 2021.

Please let us know if you have any other questions.

Regards,
Lokesh B
 



LB Lokesh Baskar Syncfusion Team October 11, 2021 01:36 PM UTC

Hi Edward,

Thank you for your patience.

To achieve your requirement, we suggest you to set NoMultiLevelLabel property of PrimaryCategoryAxis to “false”. Please find the code snippet given below.

Code Snippet:
 
chart.PrimaryCategoryAxis.NoMultiLevelLabel = false; 

Please go through the below XlsIO KB for an example.
https://www.syncfusion.com/kb/8580/how-to-set-multilevel-labels-for-excel-chart-axis-in-c-vb-net

If you still facing issue means, could you please share the below things at your end:
1. Simple sample or code snippet used at your end.
2. Output PPTX document.
3. Syncfusion product version which used in your application.

This will be more helpful to
analyze further on the reported problem and update you with appropriate solution at the earliest.

Please let us know if you have any other questions.

Regards,
Lokesh B
  



EW Edward Williams October 11, 2021 02:29 PM UTC

Okay, I tried this and it still does not want to work quite right. If I open the generated PPTX file and then edit the chart axis, the "Multi-level Category Labels" option isn't there initially. If I go in to edit the data and then try to edit the axis, then the option is there. Then, if I manually check it, it does what I want it to do. It just doesn't seem to want to work through the code.

I am using version 19.2.0.55 of the Presentation (Syncfusion.Presentation.Net.Core)

Code Snippet:

            IOfficeChartSerie seriesFiscalYear = chart.Series.Add("Fiscal Year");

            seriesFiscalYear.Values = chart.ChartData[2, 3, rowIndex, 3];
            seriesFiscalYear.DataPoints.DefaultDataPoint.DataLabels.IsValue = true;
            seriesFiscalYear.DataPoints.DefaultDataPoint.DataLabels.Size = 10;
            seriesFiscalYear.DataPoints.DefaultDataPoint.DataLabels.NumberFormat = "0%";
            seriesFiscalYear.DataPoints.DefaultDataPoint.DataLabels.Bold = true;


            //Set the Data Point Colors
            rowIndex = 0;
            foreach (DataRow row in MyDataTable.Rows)
            {
                if ((int)row.ItemArray[1] == 0)
                {
                    dataPointColor = YearZeroColor;
                }
                else
                {
                    dataPointColor = DataPointColor;
                }
                seriesFiscalYear.DataPoints[rowIndex].DataFormat.Fill.ForeColor = dataPointColor;
                rowIndex++;
            }


            chart.ChartType = OfficeChartType.Column_Clustered;
            chart.ChartTitle = "";
            chart.HasLegend = false;


            chart.PrimaryCategoryAxis.CategoryLabels = chart.ChartData[2, 1, totalRowCount + 1, 2];
            chart.PrimaryCategoryAxis.NoMultiLevelLabel = false;
            chart.PrimaryCategoryAxis.Border.LineColor = Syncfusion.Drawing.Color.FromArgb(217, 217, 217);


            chart.PrimaryValueAxis.NumberFormat = "0%";
            chart.PrimaryValueAxis.MajorGridLines.LineProperties.LineColor = Syncfusion.Drawing.Color.FromArgb(217, 217, 217);
            chart.PrimaryValueAxis.Border.LineColor = Syncfusion.Drawing.Color.FromArgb(255, 255, 255);



Attachment: Sample_Chart_(2)_ef0ec1f7.zip


LB Lokesh Baskar Syncfusion Team October 12, 2021 02:41 PM UTC

Hi Edward,

Thank you for sharing the details.

Currently, we are checking this problem using the provided code snippet. We will update you with the more details on 13th October 2021.

Please lets us know if you have any other queries.

Regards
Lokesh B 



LB Lokesh Baskar Syncfusion Team October 13, 2021 01:16 PM UTC

Hi Edward,

Thank you for your patience.

We have reproduced the reported issue using the given code snippet
and suspect it to be a defect from our side. Currently we are validating this issue and update you with more details on 15th October 2021.

Please lets us know if you have any other queries.

Regards
Lokesh B 
 



LB Lokesh Baskar Syncfusion Team October 15, 2021 12:54 PM UTC

Hi Edward,

We deeply regret for the inconveniences caused.

We are facing some complexities while validating the
reported issue and we need some time to analyze the behavior to check the feasibility to resolve the reported issue. Currently, we are validating on this issue and will update you with more details on 18th October 2021.

Please let us know if you have any other questions.


Regards,
Lokesh B



LB Lokesh Baskar Syncfusion Team October 18, 2021 12:44 PM UTC

Hi Edward,

Thank you for your patience.

We have confirmed that the mentioned “Multilevel category labels are not added in the chart while creating Presentation document” is issue and we have logged a defect report. We provide patch for this issue which is estimated to be available on 1st November 2021.  

The status of this bug report can be tracked through the below link: 
Note: Since you have mentioned your product version as 19.2.0.55, we will provide you the patch for this issue in this version. If you are using any other Essential Studio version then kindly let us know the currently installed version, so that we can provide patch in that version based on our SLA policy.

Please lets us know if you have any other questions.

Regards,
Lokesh B 



LB Lokesh Baskar Syncfusion Team November 1, 2021 01:18 PM UTC


Advanced approach – use only if you have specific needs and can directly replace existing assemblies for your build environment
Please find the patch assemblies alone from below location:
https://syncfusion.com/Installs/support/patch/19.2.0.55/1407864/F169474/SyncfusionPatch_19.2.0.55_1407864_11012021054112298_F169474.zip  
Installation Directions:
This patch should replace the files such as “Syncfusion.OfficeChart.Base.dll” under the following folder.
$system drive: \ Files\Syncfusion\Essential Studio\$Version # \precompiledassemblies\$Version#\4.0
Eg : $system drive:\Program Files\Syncfusion\Essential Studio\ 19.2.0.55 \precompiledassemblies\ 19.2.0.55 \4.0

To automatically run the Assembly Manager, please check the Run assembly manager checkbox option while installing the patch. If this option is unchecked, the patch will replace the assemblies in precompiled assemblies’ folder only. Then, you will have to manually copy and paste them to the preferred location or you will have to run the Syncfusion Assembly Manager application (available from the Syncfusion Dashboard, installed as a shortcut in the Application menu) to re-install assemblies.

Note:
To change how you receive bug fixes, ask your license management portal admin to change your project’s patch delivery mode.
https://www.syncfusion.com/account/license

Disclaimer:
Please note that we have created this patch for version 19.2.0.55 specifically to resolve the issue reported in the forum #169474.

If you have received other patches for the same version for other products, please apply all patches in the order received.

This fix will be included in our 2021 Volume 3 SP release which will be available at mid of November 2021 tentatively.

The status of this bug task can be tracked through the below feedback link:
https://www.syncfusion.com/feedback/29566/multilevel-category-labels-are-not-added-in-the-chart-while-creating-presentation

Please let us know if you have any other questions.

Regards,
Lokesh B
 


Loader.
Up arrow icon