We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Chart with secondary axis

I am creating a Column_clustered chart that looks like this:

When looking at the Series Options, it says Plot Series on Secondary Axis, as expected:

When selecting Primary Axis, then again Secondary Axis, the graph in Word now looks like


With the series tick marks displayed on the secondary axis as expected. How can I get this using DocIo?

Below the code I used:
 // Creates a new chart series with the name “Norm" and format serie.
                    IOfficeChartSerie barNorm = chart.Series.Add("Norm", OfficeChartType.Line);
                    barNorm.Values = chart.ChartData[1, 3, scoreRetestResults.Count + 1, 3];
                    barNorm.SerieFormat.LineProperties.LineColor = Color.FromArgb(102, 153, 204);
                    barNorm.SerieFormat.LineProperties.LineWeight = OfficeChartLineWeight.Medium;

                    barNorm.UsePrimaryAxis = false;

                    chart.SecondaryValueAxis.TickLabelPosition = OfficeTickLabelPosition.TickLabelPosition_High;
                    chart.SecondaryValueAxis.MaximumValue = normTxts[normTxts.Count - 1].NormId ;
                    chart.SecondaryValueAxis.MajorTickMark = OfficeTickMark.TickMark_Outside;

                    chart.SecondaryValueAxis.MinimumValue = 1;
                    chart.PrimaryValueAxis.MinimumValue = 0;

Thanks for any help,
Pieter


8 Replies

RH Ramanan  Hariharasubramanian Syncfusion Team August 7, 2017 02:23 PM UTC

Hi Pieter,

Thank you for contacting Syncfusion support.

By using
MaximumValue  and MinimumValue property of SecondaryValueAxis in chart, you can achieve your requirement. Please find the code example to display the serie ticks mark as expected. 
// Sets MaximumValue of SecondaryValueAxis
chart.SecondaryValueAxis.MaximumValue = 10;
// Sets MinimumValue of SecondaryValueAxis
chart.SecondaryValueAxis.MinimumValue = 0;
// Sets MajorUnit of SecondaryValueAxis
chart.SecondaryValueAxis.MajorUnit = 2; 
           
Please let us know if you have any concerns.

Regards,
Ramanan H.




PV Pieter van Kampen August 7, 2017 07:51 PM UTC

Thanks Ramanan,

unfortunately that does not change it. I have attached a sample app (the same from the date issue). It produces this result:


Can it be a bug in the Portable package?


Attachment: Generate_DocDates_c2c38e.zip


RH Ramanan  Hariharasubramanian Syncfusion Team August 8, 2017 09:26 AM UTC

Hi Pieter,

Thank you for your update.

On analyzing the given sample, we found that suggested code changes in our previous update was not available. So, we request you to apply the following code changes in your application to resolve this issue.
 
// Sets MaximumValue of SecondaryValueAxis
chart.SecondaryValueAxis.MaximumValue = 10;
// Sets MinimumValue of SecondaryValueAxis
chart.SecondaryValueAxis.MinimumValue = 0;
// Sets MajorUnit of SecondaryValueAxis
chart.SecondaryValueAxis.MajorUnit = 2; 

Can it be a bug in the Portable package?
No, it is not a bug. We have tried your requirement with Portable package and share the sample for your reference which can be downloaded from the following location.

Sample link:
 http://www.syncfusion.com/downloads/support/forum/131969/ze/ChartProject-1182619306

Please let us know if you have any concerns.

Regards,
Ramanan H.



PV Pieter van Kampen August 8, 2017 09:57 AM UTC

Thank you for your patience.

I have this in my sample:

           // Sets MaximumValue of SecondaryValueAxis.
            chart.SecondaryValueAxis.MaximumValue = 9;
            // Sets MinimumValue of SecondaryValueAxis.
            chart.SecondaryValueAxis.MinimumValue = 1;
            // Sets MajorUnit of SecondaryValueAxis.
            chart.SecondaryValueAxis.MajorUnit = 2;

Which is pretty much the same. But also with your indicated code values 10 and 0  I get the same result.

Unfortunately there is an issue with your uploaded sample, it is not complete, their is no code included. Can you have a look please and provide another link, so I can try it?



PV Pieter van Kampen August 8, 2017 03:34 PM UTC

Here is a screenshot with the suggest code and the result

Regards

Pieter




RH Ramanan  Hariharasubramanian Syncfusion Team August 9, 2017 10:40 AM UTC

Hi Pieter,

Thank you for your update.

On further analyzing with the given screen shot, we suspect your requirement is met with the suggested codes mentioned earlier. Please find the screenshot comparison from below table.
 
Screenshot provided on 8/6/2017 (Expected) 
Screenshot provided on 8/8/2017 (Output) 
 
 

Please refer the below UG link to know more about working with charts.
https://help.syncfusion.com/file-formats/docio/working-with-charts

If we misunderstand your requirement then, kindly update us requirement with clear description along with code snippet/sample used (if any) and screenshot/output Word document of the expected result which will helpful to provide you the appropriate solution at the earliest.

Please let us know if you have any concerns.

Regards,
Ramanan H.




PV Pieter van Kampen August 9, 2017 12:36 PM UTC

Hi Ramanan,

Your understanding of the requirement is perfect.

As I said before, and can be seen in the last screenshot, I have implemented the suggested code, but this does not provide the result as expected. 

I assume it normally does provide the result. In Word, when I make a change to the display of the secondary Axis, and then change it back to what it was before, the result is as expected. That is why I suspect there is a bug in the Portable version.

Attached a sample that generates the faulty output, including the code that you have provided.

Thanks

Pieter


Attachment: Generate_DocDates_ba1dacde.zip


RH Ramanan  Hariharasubramanian Syncfusion Team August 10, 2017 09:59 AM UTC

Hi Pieter,

Thank you for contacting Syncfusion support.

A support incident to track the status of your query has been already created under your account. Please log on to our support website to check for further updates,

https://www.syncfusion.com/account/login

Please let us know if you have any other questions.

Regards,
Ramanan H.
 


Loader.
Live Chat Icon For mobile
Up arrow icon