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.
Unfortunately, activation email could not send to your email. Please try again.

Chart with secondary axis

Thread ID:

Created:

Updated:

Platform:

Replies:

131969 Aug 6,2017 06:03 AM Aug 10,2017 05:59 AM ASP.NET Core 8
loading
Tags: DocIO
Pieter van Kampen
Asked On August 6, 2017 06:03 AM

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


Ramanan  Hariharasubramanian [Syncfusion]
Replied On August 7, 2017 10:23 AM

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.



Pieter van Kampen
Replied On August 7, 2017 03:51 PM

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

Ramanan  Hariharasubramanian [Syncfusion]
Replied On August 8, 2017 05:26 AM

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.


Pieter van Kampen
Replied On August 8, 2017 05:57 AM

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?


Pieter van Kampen
Replied On August 8, 2017 11:34 AM

Here is a screenshot with the suggest code and the result

Regards

Pieter



Ramanan  Hariharasubramanian [Syncfusion]
Replied On August 9, 2017 06:40 AM

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.



Pieter van Kampen
Replied On August 9, 2017 08:36 AM

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

Ramanan  Hariharasubramanian [Syncfusion]
Replied On August 10, 2017 05:59 AM

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.
 


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;