Difference between revisions of "CATable::GraphToFile/zh"
(Created page with "当你获得一个最少包含一个维度的CATable 结果时,你可以以图像的方式获得该结果的图形。该用法之一就是将图形作为JPEG...") |
(Created page with "需要按照以下步骤才能获得图形结果: # 选择合适的图形设置,比如:图标类型、轴范围设置、颜色、字体等等。 最简单的方法就是...") |
||
Line 27: | Line 27: | ||
当你获得一个最少包含一个维度的[[CATable/zh|CATable]] 结果时,你可以以图像的方式获得该结果的图形。该用法之一就是将图形作为JPEG图像嵌入到在后端使用ADE的web页面中。 | 当你获得一个最少包含一个维度的[[CATable/zh|CATable]] 结果时,你可以以图像的方式获得该结果的图形。该用法之一就是将图形作为JPEG图像嵌入到在后端使用ADE的web页面中。 | ||
− | + | 需要按照以下步骤才能获得图形结果: | |
− | # | + | # 选择合适的图形设置,比如:图标类型、轴范围设置、颜色、字体等等。 最简单的方法就是在Analytica企业版中打开模型并在Graph Setup(图形设置)对话中为每个变量选择你想要的设置。你使用图形设置对话建立的图形模板将存储在该对象的GraphSetup属性中。如果你有需要改变风格模板,你可以从现有变量复制GraphSetup属性。 |
# From ADE, obtain a [[CATable]] with the result to be graphed. | # From ADE, obtain a [[CATable]] with the result to be graphed. | ||
# Set the [[CATable::GraphWidth|GraphWidth]] and [[CATable::GraphHeight|GraphHeight]] properties of the [[CATable]] object to indicate the desired size of the graph in pixels. | # Set the [[CATable::GraphWidth|GraphWidth]] and [[CATable::GraphHeight|GraphHeight]] properties of the [[CATable]] object to indicate the desired size of the graph in pixels. |
Revision as of 09:08, 25 October 2015
ADE User Guide > ADE Server Class Reference > CATable
bool GraphToFile(fileName, mimeType)
描述
Creates a graph image of the data contained in the CATable object formatted using the «mimeType» and writes it to file «fileName». It uses attribute settings for the CAObject from which the CATable was obtained to control graph settings, uncertainty settings, and number format. The GraphWidth and GraphHeight properties control the size of the graph image in pixels.
返回值
布尔值(成功)
参 数
- fileName:字符串
- mimeType :字符串, 使用以下代码之一:
"image/png"
"image/jpeg"
"image/bmp"
"image/tiff"
详细说明
这些说明从 ADE用户指南: 使用Analytica图形引擎第四章中拷贝而来。
当你获得一个最少包含一个维度的CATable 结果时,你可以以图像的方式获得该结果的图形。该用法之一就是将图形作为JPEG图像嵌入到在后端使用ADE的web页面中。
需要按照以下步骤才能获得图形结果:
- 选择合适的图形设置,比如:图标类型、轴范围设置、颜色、字体等等。 最简单的方法就是在Analytica企业版中打开模型并在Graph Setup(图形设置)对话中为每个变量选择你想要的设置。你使用图形设置对话建立的图形模板将存储在该对象的GraphSetup属性中。如果你有需要改变风格模板,你可以从现有变量复制GraphSetup属性。
- From ADE, obtain a CATable with the result to be graphed.
- Set the GraphWidth and GraphHeight properties of the CATable object to indicate the desired size of the graph in pixels.
- If your result has more than two dimensions, call Slice or Subscript to reduce the dimensionality to the desired dimensionality for the plot (usually one dimension if there is no key or two dimensions if there is a key).
- If you have more than one dimension, call SetIndexOrder to select the desired pivot for the graph.
- If you are sending the graph to an output stream, obtain a Windows IStream interface to the stream. If you have a .NET Stream (
System.io.Stream
), you need to use a wrapper class (see below). - Call either the GraphToStream or GraphToFile methods of CATable, depending on where you want the graph written to. The graph can be created in different MIME types (e.g.,
"image/JPEG"
).
用法
tab.GraphWidth = 350 tab.GraphHeight = 200 b = tab.GraphToFile( "C:\data\trends.png","image/png" )
另请参考
Comments
Enable comment auto-refresher