WPS 基础接口 > 表格 API 参考 > Chart > 事件 > Chart.BeforeDoubleClick 事件
当双击某图表元素时发生此事件,此事件先于默认的双击操作。

语法

表达式.BeforeDoubleClick(ElementID, Arg1, Arg2, Cancel)

表达式   一个代表 Chart 对象的变量。

参数

名称 必选/可选 数据类型 说明
Cancel 必选 Boolean 事件发生时为 False。如果事件过程将此参数设为 True,则在完成此过程后,不执行默认的双击操作。
Arg1 必选 Long 其他事件信息,取决于 ElementID 的值。有关此参数的详细信息,请参阅“说明”部分。
Arg2 必选 Long 其他事件信息,取决于 ElementID 的值。有关此参数的详细信息,请参阅“说明”部分。
ElementID 必选 Long 双击的对象。此参数的值确定 Arg1Arg2 的期望值。有关此参数的详细信息,请参阅“说明”部分。

说明

使用 DoubleClick 方法并不触发此事件。

用户双击单元格的边框时不触发此事件。

Arg1Arg2 的含义取决于 ElementID 值,如下表中所示。

ElementID Arg1 Arg2
xlAxis AxisIndex AxisType
xlAxisTitle AxisIndex AxisType
xlDisplayUnitLabel AxisIndex AxisType
xlMajorGridlines AxisIndex AxisType
xlMinorGridlines AxisIndex AxisType
xlPivotChartDropZone DropZoneType
xlPivotChartFieldButton DropZoneType PivotFieldIndex
xlDownBars GroupIndex
xlDropLines GroupIndex
xlHiLoLines GroupIndex
xlRadarAxisLabels GroupIndex
xlSeriesLines GroupIndex
xlUpBars GroupIndex
xlChartArea
xlChartTitle
xlCorners
xlDataTable
xlFloor
xlLegend
xlNothing
xlPlotArea
xlWalls
xlDataLabel SeriesIndex PointIndex
xlErrorBars SeriesIndex
xlLegendEntry SeriesIndex
xlLegendKey SeriesIndex
xlSeries SeriesIndex PointIndex
xlTrendline SeriesIndex TrendLineIndex
xlXErrorBars SeriesIndex
xlYErrorBars SeriesIndex
xlShape ShapeIndex

下表对参数含义进行说明。

参数 说明
AxisIndex 指定坐标轴是主坐标轴还是次坐标轴。可为以下 XlAxisGroup 常量之一:xlPrimaryxlSecondary
AxisType 指定坐标轴类型。可为以下 XlAxisType 常量之一:xlCategoryxlSeriesAxisxlValue
DropZoneType 指定拖放区的类型:列、数据、页或行字段。可为以下 XlPivotFieldOrientation 常量之一:xlColumnFieldxlDataFieldxlPageFieldxlRowField。列和行字段常量分别指定了系列和分类字段。
GroupIndex 指定特定图表组在 ChartGroups 集合内的偏移量。
PivotFieldIndex 指定特定的列(系列)、数据、页或行(分类)字段在 PivotFields 集合中的偏移量。
PointIndex 指定某个系列中某一特定点在 Points 集合中的偏移量。值 -1 表示选择所有数据点。
SeriesIndex 指定特定系列在 Series 集合中的偏移量。
ShapeIndex 指定特定形状在 Shapes 集合中的偏移量。
TrendlineIndex 指定某个系列中特定趋势线在 Trendlines 集合中的偏移量。

示例

此示例将重写图表基底的默认双击操作。

示例代码
function Chart_BeforeDoubleClick(ElementID, Arg1, Arg2, Cancel) {
    if(ElementID == xlFloor) {
        Cancel = true
        MsgBox("Chart formatting for this item is restricted.")
	}
}


请参阅