Change Data Label Position and Convert to PDF

Technical support for Spire.XLS

Moderators: iceblue support, Flash, Manager

Change Data Label Position and Convert to PDF

Postby Msy N » Wed Apr 26, 2017 7:23 am

Hi,

I could not change the data label of chart in below sources.
I want to change 2 points.
1. label position: Move it slightly upwards
2. delimiter: Change to line break
How can I change this?

Using Lib: Spire.XLS (ver7.11.13)
source(VB.NET):
Code: Select all
Dim chart As Xls.Chart = sheet.Charts(0)    'This chart is Bar3DStacked
For i As Integer = 0 To chart.Series.Count - 1
    Dim cs As Xls.Charts.ChartSerie = chart.Series(i)
    Dim cslabel As Xls.Charts.ChartDataLabels = cs.DataPoints.DefaultDataPoint.DataLabels
    cslabel.HasValue = True
    cslabel.HasSeriesName = True
    cslabel.HasCategoryName = False
    cslabel.HasLegendKey = False
    cslabel.Delimiter = " "  'cannot use char(10), vbCrLf
    cslabel.IsYMode = True
    cslabel.IsXMode = True
    cslabel.Y = 1800  'do not move
    cslabel.X = 2000  'do not move
Next


and if I convert this Excel sheet to PDF, can I keep this data label position in PDF?

Thanks
Msy N
 
Posts: 4
Joined: Wed Apr 19, 2017 8:07 am
Location: Japan

Re: Change Data Label Position and Convert to PDF

Postby Jane.Bai » Wed Apr 26, 2017 9:42 am

Hello,

Thanks for your inquiry.
Your code works well at my end, could you please share us with your sample xls file for investigation?

Best Wishes,
Jane
E-iceblue support team
User avatar
Jane.Bai
 
Posts: 953
Joined: Tue Nov 29, 2016 1:47 am

Re: Change Data Label Position and Convert to PDF

Postby Msy N » Thu Apr 27, 2017 1:27 am

Hi, Jane.Bai
Thanks for your reply.

I send my source and sample xls (excel template(xltx))
Please show this and send advice to me.

Thanks
Attachments
sample.zip
(27.2 KiB) Downloaded 70 times
Msy N
 
Posts: 4
Joined: Wed Apr 19, 2017 8:07 am
Location: Japan

Re: Change Data Label Position and Convert to PDF

Postby Jane.Bai » Thu Apr 27, 2017 3:35 am

Hello,

Thanks for sharing the materials.
Please first upgrade your dlls to the latest version (Spire.XLS Pack Version:7.12) and use the code "cslabel.Delimiter = vbLf" to set the delimiter to be line break.
As for the second position case, I have reproduced the issue and posted it to our Dev team. Once there's any progress, we will inform you.
Sorry for the inconvenience caused.

Sincerely,
Jane
E-iceblue support team
User avatar
Jane.Bai
 
Posts: 953
Joined: Tue Nov 29, 2016 1:47 am

Re: Change Data Label Position and Convert to PDF

Postby Msy N » Thu Apr 27, 2017 4:46 am

Thank you, Jane.Bai.

I downloaded latest version Spire.XLS, and change delimiter character to "vbLf" then delimiter was worked.
I expect a good answer to the position case.

Best Regards

Msy N
Msy N
 
Posts: 4
Joined: Wed Apr 19, 2017 8:07 am
Location: Japan

Re: Change Data Label Position and Convert to PDF

Postby Jane.Bai » Thu Apr 27, 2017 8:37 am

Hello Msy N,

Thanks for your reply.
We will inform you immediately when there's any update.

Sincerely,
Jane
E-iceblue support team
User avatar
Jane.Bai
 
Posts: 953
Joined: Tue Nov 29, 2016 1:47 am

Re: Change Data Label Position and Convert to PDF

Postby Msy N » Thu Jun 15, 2017 9:38 am

Hi, Jane.Bai

I downloaded the newest Hotfix (Spire.XLS 7.12.27) and try it.
My problems were solved.

Thank you very much.

Sincerely,
Msy N
Msy N
 
Posts: 4
Joined: Wed Apr 19, 2017 8:07 am
Location: Japan

Re: Change Data Label Position and Convert to PDF

Postby Jane.Bai » Fri Jun 16, 2017 4:01 am

Hello Msy N,

Thanks for your feedback.
Please feel free to contact us if you need any assistance.

Sincerely,
Jane
E-iceblue support team
User avatar
Jane.Bai
 
Posts: 953
Joined: Tue Nov 29, 2016 1:47 am


Return to Spire.XLS

Who is online

Users browsing this forum: No registered users and 1 guest