Spire.XLS is a professional Excel API that enables developers to create, manage, manipulate, convert and print Excel worksheets. Get free and professional technical support for Spire.XLS for .NET, Java, Android, C++, Python.

Fri Jun 08, 2018 5:04 am

hi iceblue team,
I am trying to use the latest version of spire.xls to make a line chart,but I can't get the expected results,could you help me?

I have 35 numbers to display on the PrimaryValueAxis, and I want to customize the PrimaryCategoryAxis settings,the problems are as follows:

1.The PrimaryCategoryAxis automatically start at 1,I want it from 0 to 35, and 1 Corresponding the first value of my values,so I set the PrimaryCategoryAxis.MinValue = 0,but it report an error "This property is not supported for the current chart type",do you have any advice?

2.I set the chart.PrimaryCategoryAxis.MajorUnit = 5 and chart.PrimaryCategoryAxis.MinorUnit = 1 to set the MajorUnit and MinorUnit of PrimaryCategoryAxis,but it worked like the attachment.

3.I want to set the labels appare like 0,5,10,15....rather than 1,3,5,7,9...or 1,2,3,4...,but I can't ,it seems automatically adjusted.

4.I use chart.PrimaryCategoryAxis.TickLabelPosition = TickLabelPositionType.TickLabelPositionLow to set the label to the bottom,and I want to set the TickMark to the bottom too,but I didn't find any API relate to this.

Thank you in advance.
Attachments
捕获.PNG
line chart
捕获.PNG (19.34 KiB) Viewed 1720 times
koli.cheng

koli
 
Posts: 2
Joined: Fri Jun 01, 2018 7:32 am

Fri Jun 08, 2018 8:18 am

Dear koli,

Thanks for your inquiry.
After an initial testing, the PrimaryCategoryAxis starts at 0 on my side.
As for the issue#3, please refer to following code to set the label unit.
Code: Select all
            //at present, the property IsAutoMajor must be set as false, it is bug, and we will change it in next version. As a temporary solution, please use this.
            chart.PrimaryCategoryAxis.IsAutoMajor = false;
            //the property AutoTickLabelSpacing  must be set as false
            chart.PrimaryCategoryAxis.AutoTickLabelSpacing = false;
            chart.PrimaryCategoryAxis.TickLabelSpacing =5;

For your issue#4, sorry that I am a little confused that where you want to place the TickMark, as I didn't find the bottom setting you mentioned in MS Excel, maybe I misunderstand your requirement. In order to help us investigate your issues further, could you please share us the input document, the code you were using and the expected document(you could generate it by MS Excel). Then we will look into it and provide correspoding code for you.
Besides, we provide Chinese service :)

Sincerely,
Betsy
E-iceblue support team
User avatar

Betsy.jiang
 
Posts: 3099
Joined: Tue Sep 06, 2016 8:30 am

Fri Jun 08, 2018 9:16 am

I didn't find the bottom setting of TickMark in MS Excel,sorry for the unreasonable requirement.
I changed the charttype to ScatterLine and it worked well for the other demand.Thank you so much.
koli.cheng

koli
 
Posts: 2
Joined: Fri Jun 01, 2018 7:32 am

Fri Jun 08, 2018 9:25 am

Dear koli,

Thanks for your feedback.
Any question, just feel free to contact us.
Have a nice day.

Sincerely,
Betsy
E-iceblue support team
User avatar

Betsy.jiang
 
Posts: 3099
Joined: Tue Sep 06, 2016 8:30 am

Return to Spire.XLS