Stacked Bar Chart Lines appearing between each line of bars

Hi


Please could you help me - I have set up a stacked bar chart in aspose.slides

And I get little comparison lines inbetween the stacked bars

In PowerPoint (*.pptx) I can only remove them by right clicking on them and selecting:

Format Series Lines…

And changing from Automatic to Solid Line and Transparency to 100%

I don’t seem to be able to replicate this process in Aspose

series.Format.Line.FillFormat.FillType = FillTypeEx.Solid
series.Format.Line.FillFormat.SolidFillColor.Color = Color.White

This doesn’t work

How do I remove them?

Hi Mary,


Thanks for inquiring Aspose.Slides.

I have tried to completely understand your requirements but unfortunately have not been able to completely understand them. However, in order to remove the line please use following code snippet.

series.Format.Line.FillFormat.FillType = FillTypeEx.NOFILL

If there is still an issue then please share the sample code snippet and sample presentation with stacked column and exhibiting your requirement from Aspose.Slides.

Many Thanks,

Yeh that didn't remove the lines. The function I use to create the stacked chart is as follows - I have highlighted in red your line

Private Sub AddAVCBarStackedChart(ByRef sld As SlideEx, ByRef strSQL As String, ByRef strBars As Int16, ByRef strTitle As String, _
ByRef XCoord As Int16, ByRef YCoord As Int16, ByRef Width As Int16, ByRef Height As Int16, ByRef ChartTitle As String, _
ByRef MinValue As Int16, ByRef MaxValue As Int16, ByRef AxisVisible As Boolean, ByRef ShowLegend As String)

' Labels & Colours
' ----------------
Dim strLabel01 As String = Request.QueryString("Lbl01"), ToChartColor01 As String = "#" & Request.QueryString("Col01")
Dim strLabel02 As String = Request.QueryString("Lbl02"), ToChartColor02 As String = "#" & Request.QueryString("Col02")
Dim strLabel03 As String = Request.QueryString("Lbl03"), ToChartColor03 As String = "#" & Request.QueryString("Col03")
Dim strLabel04 As String = Request.QueryString("Lbl04"), ToChartColor04 As String = "#" & Request.QueryString("Col04")
Dim strLabel05 As String = Request.QueryString("Lbl05"), ToChartColor05 As String = "#" & Request.QueryString("Col05")
Dim strLabel06 As String = Request.QueryString("Lbl06"), ToChartColor06 As String = "#" & Request.QueryString("Col06")
Dim strLabel07 As String = Request.QueryString("Lbl07"), ToChartColor07 As String = "#" & Request.QueryString("Col07")
Dim FromChartColor01 As String = PickGradientFromColor(ToChartColor01)
Dim FromChartColor02 As String = PickGradientFromColor(ToChartColor02)
Dim FromChartColor03 As String = PickGradientFromColor(ToChartColor03)
Dim FromChartColor04 As String = PickGradientFromColor(ToChartColor04)
Dim FromChartColor05 As String = PickGradientFromColor(ToChartColor05)
Dim FromChartColor06 As String = PickGradientFromColor(ToChartColor06)
Dim FromChartColor07 As String = PickGradientFromColor(ToChartColor07)

' Sort out Labels
' ---------------
strLabel01 = Replace(strLabel01, "||", "'")
strLabel02 = Replace(strLabel02, "||", "'")
strLabel03 = Replace(strLabel03, "||", "'")
strLabel04 = Replace(strLabel04, "||", "'")
strLabel05 = Replace(strLabel05, "||", "'")
strLabel06 = Replace(strLabel06, "||", "'")
strLabel07 = Replace(strLabel07, "||", "'")


' Create DataSet
' --------------
Dim cf As New CommonFunctions
Dim DS As New DataSet
Dim strRowCount As Int32 = 0
DS = cf.GetDataList(strSQL, "")
strRowCount = DS.Tables(0).Rows.Count

' Add chart with default data
' ----------------------------
Dim chart As ChartEx = sld.Shapes.AddChart(ChartTypeEx.StackedBar, XCoord, YCoord, Width, Height)

' Vertical Axis Controls
' ----------------------
chart.ValueAxis.IsAutomaticMinValue = False
chart.ValueAxis.IsAutomaticMaxValue = False
chart.ValueAxis.MinValue = MinValue
chart.ValueAxis.MaxValue = MaxValue
chart.ValueAxis.IsVisible = AxisVisible

' Setting chart Title = None
' -------------------------
If strTitle = "" Then
chart.ChartTitle.Text.Text = ""
Else
Dim strNewTitle As String = DS.Tables(0).AsEnumerable().Max(Function(a) a("Group"))
chart.ChartTitle.Text.Text = strNewTitle

End If
chart.ChartTitle.Text.CenterText = True
chart.HasTitle = True
chart.ValueAxis.MajorTickMark = TickMarkType.None
chart.CategoryAxis.MajorTickMark = TickMarkType.None
chart.CategoryAxis.IsPlotOrderReversed = True
chart.GapWidth = 35

' Chart Legend
' -------------
chart.HasLegend = False
If Not ShowLegend = "" Then
chart.HasLegend = True
Select Case ShowLegend
Case "Right"
chart.Legend.Position = LegendPositionTypeEx.Right
Case "Bottom"
chart.Legend.Position = LegendPositionTypeEx.Bottom
Case Else
chart.Legend.Position = LegendPositionTypeEx.Bottom
End Select

Dim leg As TextFrameEx = chart.Legend.TextProperties
leg.Paragraphs(0).ParagraphFormat.DefaultPortionFormat.FontHeight = 12

End If

' Format Chart Labels
' -------------------
Dim tfC As TextFrameEx = chart.CategoryAxis.TextProperties
Dim portC As PortionFormatEx = tfC.Paragraphs(0).ParagraphFormat.DefaultPortionFormat
portC.FontHeight = 12

Dim tfV As TextFrameEx = chart.ValueAxis.TextProperties
Dim portV As PortionFormatEx = tfV.Paragraphs(0).ParagraphFormat.DefaultPortionFormat
portV.FontHeight = 12

'Setting the index of chart data sheet
Dim defaultWorksheetIndex As Integer = 0

'Getting the chart data worksheet
Dim fact As ChartDataCellFactory = chart.ChartData.ChartDataCellFactory

'Delete default generated series and categories
chart.ChartData.Series.Clear()
chart.ChartData.Categories.Clear()

'Adding new series
chart.ChartData.Series.Add(fact.GetCell(defaultWorksheetIndex, 0, 1, strLabel01), chart.Type)
chart.ChartData.Series.Add(fact.GetCell(defaultWorksheetIndex, 0, 2, strLabel02), chart.Type)
If strBars >= 3 Then chart.ChartData.Series.Add(fact.GetCell(defaultWorksheetIndex, 0, 3, strLabel03), chart.Type)
If strBars >= 4 Then chart.ChartData.Series.Add(fact.GetCell(defaultWorksheetIndex, 0, 4, strLabel04), chart.Type)
If strBars >= 5 Then chart.ChartData.Series.Add(fact.GetCell(defaultWorksheetIndex, 0, 5, strLabel05), chart.Type)
If strBars >= 6 Then chart.ChartData.Series.Add(fact.GetCell(defaultWorksheetIndex, 0, 6, strLabel06), chart.Type)
If strBars >= 7 Then chart.ChartData.Series.Add(fact.GetCell(defaultWorksheetIndex, 0, 7, strLabel07), chart.Type)

'Take first chart series
Dim series As ChartSeriesEx = chart.ChartData.Series(0)
'Now populating series data
Dim lbl As New DataLabelEx(series)

Try


For seriesNumber As Int16 = 0 To strBars - 1
series = chart.ChartData.Series(seriesNumber)

' Sort out Colours
' ----------------
Dim ToChartColor As String = ""
Dim FromChartColor As String = ""
Select Case seriesNumber
Case 0
ToChartColor = ToChartColor01
FromChartColor = ToChartColor01
Case 1
ToChartColor = ToChartColor02
FromChartColor = ToChartColor02
Case 2
ToChartColor = ToChartColor03
FromChartColor = ToChartColor03
Case 3
ToChartColor = ToChartColor04
FromChartColor = ToChartColor04
Case 4
ToChartColor = ToChartColor05
FromChartColor = ToChartColor05
Case 5
ToChartColor = ToChartColor06
FromChartColor = ToChartColor06
Case 6
ToChartColor = ToChartColor07
FromChartColor = ToChartColor07
End Select


For PointIndex As Int16 = 0 To strRowCount - 1

chart.ChartData.Categories.Add(fact.GetCell(defaultWorksheetIndex, PointIndex + 1, 0, DS.Tables(0).Rows(PointIndex).Item("DataDescription")))

Dim strRowValue As Double = FormatNumber(DS.Tables(0).Rows(PointIndex).Item("Score0" & seriesNumber + 1), 1)
Dim strBaseValue As Double = DS.Tables(0).Rows(PointIndex).Item("UnweightedBase")
If strBaseValue < minBase Then
series.Values.Add(fact.GetCell(defaultWorksheetIndex, PointIndex + 1, seriesNumber + 1, 0))
Else
series.Values.Add(fact.GetCell(defaultWorksheetIndex, PointIndex + 1, seriesNumber + 1, strRowValue))

End If
series.Format.Fill.FillType = FillTypeEx.Gradient
series.Format.Fill.GradientFormat.GradientShape = GradientShapeEx.Linear
series.Format.Fill.GradientFormat.GradientDirection = GradientDirectionEx.FromCenter
series.Format.Fill.GradientFormat.GradientStops.Add(CSng(1.0), ColorTranslator.FromHtml(ToChartColor))
series.Format.Fill.GradientFormat.GradientStops.Add(CSng(0), ColorTranslator.FromHtml(ToChartColor))

' Doesn't do anything???
series.Format.Line.FillFormat.FillType = FillTypeEx.NoFill

' Format Data Labels
' ------------------
lbl = New DataLabelEx(series)
lbl.ShowValue = True
lbl.ShowCategoryName = False
lbl.Id = PointIndex

Dim LabelPortion As New PortionEx()
LabelPortion.PortionFormat.FontHeight = 10

If strBaseValue < minBase Then LabelPortion.Text = strBaseTooLow Else LabelPortion.Text = strRowValue & "%"
lbl.TextFrame.Text = " "
lbl.TextFrame.Paragraphs(0).Portions.Clear()
lbl.TextFrame.Paragraphs(0).Portions.Add(LabelPortion)
lbl.TextFrame.Paragraphs(0).Portions(0).PortionFormat.FillFormat.FillType = FillTypeEx.Solid
lbl.TextFrame.Paragraphs(0).Portions(0).PortionFormat.FillFormat.SolidFillColor.Color = ColorTranslator.FromHtml(TextColour(ToChartColor))


If strRowValue < 0 Then
lbl.Position = LegendDataLabelPositionEx.Center
lbl.Delete = True
Else
lbl.Position = LegendDataLabelPositionEx.Center
End If
series.Labels.Add(lbl)
Next
Next

Catch ex As Exception
End Try

End Sub

Hi Marry,


I have worked over the requiremetns shared by you and have generated the StackedBar chart using code snippet shared here. I have tried to hide the chart series lines as shared in the image and have not been able to hide them. The requested feature is missing in Aspose.Slides and I have created an issue with SLIDESNET-33728 in our issue tracking system to further investigate and resolve the issue. This thread has been linked with the issue so that you may be automatically notified once the issue will be resolved.

We are sorru for your inconvenience,

Hi,

Has this been resolved:

series.Format.Line.FillFormat.FillType = FillTypeEx.NoFill;

Above code is also not working for me.

Hi Pranav,


I have discussed the issue status with our development team and regret to share that it has not yet been resolved owing to already pending issues. However, we have scheduled the issue for investigation during week 49 of 2012. We will be able to share the further information with you once the investigation is completed by our development team and response is shared.

We are sorry for your inconvenience,

Hi Pranav,


I like to share that the mentioned issue has been resolved in Aspose.Slides for .NET 7.0.0. You may please use the following sample code in your application to serve the purpose. I will share the notification of product release with you shortly.

//Hiding series lines
series.HasSeriesLines = false;


Many Thanks,

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


This message was posted using Notification2Forum from Downloads module by aspose.notifier.