Chart formatting ASeries.LeaderLines

Below is a snippet of code where I am trying to apply formatting to the data labels on a chart worksheet that is being added to a workbook. The formatting of the labels is working as expected. But the formatting of the LeaderLines has no effect. The resulting Excel 2007 .xlsx workbook has LeaderLines connecting the labels to the pie chart slices but the line color is “Automatic”, weight is 0.75 points, and dash type is solid.



Dim i As Int16
For i = 0 To chart.NSeries.Count - 1
Dim series As ASeries = chart.NSeries(i)
series.DataLabels.IsCategoryNameShown = True ’ OK
series.DataLabels.IsPercentageShown = True ’ OK
series.DataLabels.TextFont.Name = “Arial” ’ OK
series.DataLabels.TextFont.Size = 12 ’ OK
series.DataLabels.TextFont.IsBold = True ’ OK
series.HasLeaderLines = True ’ OK
series.LeaderLines.IsAuto = False ’ No effect
series.LeaderLines.Style = LineType.Dot ’ No effect
series.LeaderLines.WeightPt = 0.25 ’ No effect
series.LeaderLines.Color = Drawing.Color.LightCyan ’ No effect
Next

This code executes without error and the .xlsx file is saved. But
those last four properties are not effected. Am I doing something
wrong here?

Thanks,
Jeff

Hi Jeff,

We found the issue after an initial test, we will figure it out soon.

Your issue has been logged into our issue tracking system with an issue id: CELLSNET-14619.

Thank you.

Hi,


Please
try the attached version. We have fixed the “Chart formatting regarding ASeries.LeaderLines” issue.

Thank you


The update seems to have no effect. If I do not explicitly set any
properties, the leader lines appear with all the default settings
(weight 0.75 pt, color “automatic”). But if I try to set any of the
properties, the leader lines do not appear at all on the resulting
chart.

Dim i As Int16
For i = 0 To chart.NSeries.Count - 1
Dim series As ASeries = chart.NSeries(i)
series.DataLabels.IsCategoryNameShown = True
series.DataLabels.IsPercentageShown = True
series.DataLabels.TextFont.Name = “Arial”

'series.DataLabels.TextFont.Size = 12 ’ DO NOT USE: Allow auto font
sizing to prevent label overlapping.
series.DataLabels.TextFont.IsBold = True
series.DataLabels.Position = LabelPositionType.BestFit
'series.HasLeaderLines = True


'The following properties cause the leader lines to disappear
series.LeaderLines.IsAuto = False
series.LeaderLines.Style = LineType.Dot
series.LeaderLines.WeightPt = 0.25
series.LeaderLines.Color = Drawing.Color.LightCyan
Next

I noticed that Cell.Style() property had been obsoleted in this version. I updated several other regions of my code to use the GetStyle() and SetStyle() methods by adding new style objects. Is there a similar method to be used with charts?

Thank you.

Hi,

Well, I tested your code and it works fine. We think, since you are using LightCyan color and also the weight is less (0.25 according to your code), so you need to have sharp eyes to see it :). I need to use contact lenses to find out the leader lines on the chart.

I think you may try to use some other color or extend the weight of the leader line to make it more prominent on the chart.

If you still find the issue, kindly post your complete sample code with input+output files. We will check it soon.



Thank you.

I cannot find leader lines on the resulting chart when using Lightcyan color in any weight. Could be a display issue on my end. Tried to click around on the zoomed in view in Excel and could not find any lines at all.

I removed all the other LeaderLines properties except

series.LeaderLines.Color = Drawing.Color.Gray
and this work OK for my needs. The darker colored lines were crossing through some labels and making the text difficult to read.

Thank you again for your help.

The issues you have found earlier (filed as CELLSNET-14619) have been fixed in this update.


This message was posted using Notification2Forum from Downloads module by Aspose Notifier.