【问题标题】:Line graph with markers plotting a zero starting value rather than actual value带有标记的折线图绘制零起始值而不是实际值
【发布时间】:2020-11-30 09:59:32
【问题描述】:

我正在做一个带有四列标记和 x 轴上的日期的折线图。

C 列是我要绘制的值。
其他列(E 到 G)是表示下限和上限(质量控制)的恒定线。

我在 C 列中的第一个值是 16.72,但图表从 0 开始。

为什么包含一个 0 值,如何删除它?

Dim RegChart As ChartObject

Set RegChart = Sheets("Regen Quality").ChartObjects.Add(Left:=180, Width:=800, Top:=7, Height:=300)
RegChart.Chart.SetSourceData Source:=Sheets("RegenQuality").Range("A3:A80,C3:C80,E3:G80")
RegChart.Chart.ChartType = xlLineMarkers
RegChart.Chart.HasTitle = True
RegChart.Chart.ChartTitle.Characters.Text = "%Regen"
'X axis name
RegChart.Chart.Axes(xlCategory, xlPrimary).HasTitle = True
RegChart.Chart.Axes(xlCategory, xlPrimary).AxisTitle.Characters.Text = "Sample dates"
'y-axis name
RegChart.Chart.Axes(xlValue, xlPrimary).HasTitle = True
RegChart.Chart.Axes(xlValue, xlPrimary).AxisTitle.Characters.Text = "%"

【问题讨论】:

    标签: excel vba linegraph


    【解决方案1】:

    我有过这样做的经验。您可以编辑轴选项,使其不以 0 开头,例如:

    ActiveChart.Axes(xlValue).MinimumScale = 16.72
    

    您实际上可以在图表中手动编辑轴选项并记录宏以查看您喜欢的输出及其相应的代码。希望这能给你一个想法。

    【讨论】:

    • 感谢您的帮助!
    猜你喜欢
    • 2019-02-18
    • 2017-11-25
    • 1970-01-01
    • 1970-01-01
    • 2016-05-26
    • 2012-02-09
    • 2011-03-06
    • 1970-01-01
    相关资源
    最近更新 更多