Difference between revisions of "OnGraphDrawItem"
(EW19917 OnGraphClick) |
|||
Line 1: | Line 1: | ||
− | This system index is used be the local variable '''<code>info</code>''' in the [[OnGraphDraw]] | + | This system index is used be the local variable '''<code>info</code>''' in the [[OnGraphDraw]] and [[OnGraphClick]] attributes. |
The [[GraphToCanvasCoord]] function knows how to use information contained in «info». | The [[GraphToCanvasCoord]] function knows how to use information contained in «info». | ||
Line 5: | Line 5: | ||
== System Index OnGraphDrawItem == | == System Index OnGraphDrawItem == | ||
− | Index that lists the the fields of «info» in [[OnGraphDraw]]. The items (members of «info») are as follows: | + | Index that lists the the fields of «info» in [[OnGraphDraw]] and [[OnGraphClick]]. The items (members of «info») are as follows: |
* <code>"Width"</code>: The total width of the graph drawing surface in pixels. Includes the plot area, areas for axis titles, labels, and for keys. | * <code>"Width"</code>: The total width of the graph drawing surface in pixels. Includes the plot area, areas for axis titles, labels, and for keys. | ||
Line 49: | Line 49: | ||
* <code>"CategoryGap"</code>: | * <code>"CategoryGap"</code>: | ||
* <code>"CategoryGapPix"</code>: The gap between bars in pixels. | * <code>"CategoryGapPix"</code>: The gap between bars in pixels. | ||
+ | |||
+ | The following fields are filled in only when the [[OnGraphClick]] attribute is evaluated. They are always [[Null]] when [[OnGraphDraw]] is evaluating. The information in these fields is available in [[OnGraphClick]] in special local variables, but is also added to <code>info</code> redundantly, which can simplify parameter lists to [[User-Defined Functions]]. | ||
+ | * <code>"Click_where"</code>: The part of the graph that was clicked on, the same as the local <code>where</code>. It contains one of the values: <code>"plotArea"</code>, <code>"point"</code> (on a single point or bar in the plot area), <code>"segment"</code> (on a line segment or filled area), <code>"key"</code>, <code>"axisTitle"</code>, <code>"axisLabels"</code> and <code>"background"</code>. | ||
+ | * <code>"Click_x"</code> and <code>"Click_y"</code>: The pixel location of the mouse click. Same as locals <code>click_x</code> and <code>click_y</code>. | ||
+ | * <code>"Click_coord"</code>: The same as the local <code>coord</code>, containing the index coordinates of the data point clicked on. | ||
+ | * <code>"Click_coordPos"</code>:The same as the local <code>coordPos</code> containing the 1-based index positions for the data point clicked on. | ||
+ | * <code>"Click_isInRole"</code>: The same as the local <code>isInRole</code>. A 1-D boolean array indexed by [[GraphingRole]] indicating which role(s) was clicked. | ||
== Uses == | == Uses == | ||
Line 61: | Line 68: | ||
* [[OnGraphDraw]] | * [[OnGraphDraw]] | ||
+ | * [[OnGraphClick]] | ||
* [[GraphToCanvasCoord]] | * [[GraphToCanvasCoord]] | ||
* [[GraphingRole]], [[GraphFillerInfo]] | * [[GraphingRole]], [[GraphFillerInfo]] |
Revision as of 20:12, 25 September 2020
This system index is used be the local variable info
in the OnGraphDraw and OnGraphClick attributes.
The GraphToCanvasCoord function knows how to use information contained in «info».
System Index OnGraphDrawItem
Index that lists the the fields of «info» in OnGraphDraw and OnGraphClick. The items (members of «info») are as follows:
"Width"
: The total width of the graph drawing surface in pixels. Includes the plot area, areas for axis titles, labels, and for keys."Height"
: The total height of the graph drawing surface in pixels."PlotAreaLeft"
,"PlotAreaTop"
,"PlotAreaWidth"
,"PlotAreaHeight"
: The rectangle inside the axes where data is plotted.
"ChartType"
: The line type selected in graph setup. One of:"Line"
"Symbol"
"Dot"
"LineSymbol"
"Step"
"Bar"
"ViewMode"
: Which uncertainty view is being depicted. One of the following values:"Mid"
"Mean"
"Sample"
"PDF"
"CDF"
"Statistics"
"Bands"
"Result"
: A Handle to the variable whose result is being depicted. (revisit: This might not be correct.)
"Phase"
: Same as the local Phase variable.- 1 = before layout (opportunity to suppress default graph)
- 2 = before drawing (opportunity to rescale axes)
- 4 = after axes, before data (opportunity to replace plot using same axis scaling)
- 8 = after fully drawn (opportunity to annotate over a graph)
"DepictedIndexes"
: A reference to a list of handles to the indexes that vary on the graph. This includes indexes assigned to graphing roles and slicers set to All."SlicerPositions"
: A reference to a 1-D array. The index of the array is a local index named Slicer, whose elements are handles to the indexes that are slicers for the graph and are set to a specific value (i.e., those set to «Totals» or «All» are not in this list). The value in the array is the 1-based integer position of the selected value. The index might have length zero."SlicersAtTotal"
: A reference to a list of handles to the slicer indexes that are set to «Totals»."SlicersAtAll"
: A reference to a list of handles to the slicer indexes that are set to «All».
"SwapXY"
: Boolean, true when the vertical axis in the independent axis (i.e., X)."BarOverlap"
: The bar overlap (specified in Graph Setup). 0% is usual, Tornados often use 100% overlap, and stacked bar charts have 100% overlap.
The following bar graph metrics are only available in «info» after the bars have rendered -- i.e., only in phase=8. Before that they are null.
"BarWidth"
:"BarWidthPix"
: Bar width in pixels"CategoryGap"
:"CategoryGapPix"
: The gap between bars in pixels.
The following fields are filled in only when the OnGraphClick attribute is evaluated. They are always Null when OnGraphDraw is evaluating. The information in these fields is available in OnGraphClick in special local variables, but is also added to info
redundantly, which can simplify parameter lists to User-Defined Functions.
"Click_where"
: The part of the graph that was clicked on, the same as the localwhere
. It contains one of the values:"plotArea"
,"point"
(on a single point or bar in the plot area),"segment"
(on a line segment or filled area),"key"
,"axisTitle"
,"axisLabels"
and"background"
."Click_x"
and"Click_y"
: The pixel location of the mouse click. Same as localsclick_x
andclick_y
."Click_coord"
: The same as the localcoord
, containing the index coordinates of the data point clicked on."Click_coordPos"
:The same as the localcoordPos
containing the 1-based index positions for the data point clicked on."Click_isInRole"
: The same as the localisInRole
. A 1-D boolean array indexed by GraphingRole indicating which role(s) was clicked.
Uses
You might want your custom OnGraphDraw to run when viewing a Bands graph. Then your OnGraphDraw expression might have this:
where DoMyDrawing is your UDF that draws something.
Enable comment auto-refresher