Excel VB.NET如何更改气泡图中单个气泡的边界?

时间:2012-10-16 21:32:13

标签: vb.net excel vba excel-vba bubble-chart

我在VB.NET中生成气泡图,我认为让气泡的边框变粗更好,所以更容易看出是否有重叠,但我无法理清如何做到这一点。要手动完成,只需右键单击气泡,转到边框样式并输入您的值。

我用以下方法解决了如何改变气泡的颜色:

.chart.SeriesCollection(i).interior.color = RGB

我花了很多时间在周围寻找类似的东西,这样我可以将边框重量提高一点左右,但我没有运气。

任何人都知道该怎么做?一如既往地谢谢你!

更新:我做了什么:

            With oChart

            With CType(.SeriesCollection, Excel.SeriesCollection)
                .NewSeries()
                With CType(.Item(counterVal - 43), Excel.Series)
                    .Name = mainSheet.Range("a" & counterVal).Value
                    .XValues = mainSheet.Range("b" & counterVal).Value
                    .Values = mainSheet.Range("d" & counterVal).Value
                    .BubbleSizes = mainSheet.Range("c" & counterVal).Value
                    .HasDataLabels = True
                    .DataLabels.Position = XlDataLabelPosition.xlLabelPositionAbove
                    'DL.ShowSeriesName = True
                    .Has3DEffect = True
                    .Format.ThreeD.SetThreeDFormat(Microsoft.Office.Core.MsoPresetThreeDFormat.msoThreeD1)
                    '.Format.Line.Weight = 1.5
                End With
            End With
        End With

我最后只使用了3D效果而不是线宽,但我把它们都留在了。

1 个答案:

答案 0 :(得分:1)

e.g。

Dim ws As Worksheet
Dim co As ChartObject
Dim ch As Chart
Dim sr As Series
Dim pt As Point

Set ws = ActiveSheet
Set co = ws.ChartObjects(1)
Set ch = co.Chart
Set sr = ch.SeriesCollection(1)
Set pt = sr.Points(19)

pt.Select

With Selection.Format.Fill
    .Visible = msoTrue
    .ForeColor.ObjectThemeColor = msoThemeColorAccent2
    .ForeColor.TintAndShade = 0
    .ForeColor.Brightness = 0
    .Transparency = 0
    .Solid
End With
With Selection.Format.Line
    .Visible = msoTrue
    .ForeColor.RGB = RGB(0, 176, 80)
    .Transparency = 0
End With