Difference between revisions of "CATable::GraphToFile/zh"

(Created page with "这些说明从 '''ADE用户指南:''' ''使用Analytica图形引擎''第四章中拷贝而来。")
 
(4 intermediate revisions by the same user not shown)
Line 6: Line 6:
 
== 描述 ==
 
== 描述 ==
  
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 [[CATable::GraphWidth|GraphWidth]] and [[CATable::GraphHeight|GraphHeight]] properties control the size of the graph image in pixels.
+
建立一个数据包含在[[CATable/zh|CATable]]对象中的图像,数据使用«mimeType»格式化并写入到文件«fileName»中。使用的[[CAObject]][[CATable/zh|CATable]]从它获得)属性设置来控制图形设置、不确定性设置以及数字格式。[[CATable::GraphWidth/zh|GraphWidth]][[CATable::GraphHeight/zh|GraphHeight]]属性控制图形像素大小。
  
 
== 返回值 ==
 
== 返回值 ==
Line 25: Line 25:
 
这些说明从 '''ADE用户指南:''' ''使用Analytica图形引擎''第四章中拷贝而来。
 
这些说明从 '''ADE用户指南:''' ''使用Analytica图形引擎''第四章中拷贝而来。
  
When you have a [[CATable]] result with at least one dimension, you can obtain a graph of the result as an image. One use of this is to embed graphs as JPEG images in a web page that uses ADE on the back end.
+
当你获得一个最少包含一个维度的[[CATable/zh|CATable]] 结果时,你可以以图像的方式获得该结果的图形。该用法之一就是将图形作为JPEG图像嵌入到在后端使用ADE的web页面中。
  
Obtaining the graph of a result requires the following steps:
+
需要按照以下步骤才能获得图形结果:
# Select the appropriate graph settings, such as chart type, axis range settings, colors, fonts,and so on. The easiest way is to open the model in Analytica Enterprise, and select the settings you want for each variable using the Graph Setup dialog.<br>The graph template you create using the Graph Setup dialog is stored in the GraphSetup attribute of the object. You can copy the GraphSetup attribute from an existing variable if you need to change the style template.
+
# 选择合适的图形设置,比如:图标类型、轴范围设置、颜色、字体等等。 最简单的方法就是在Analytica企业版中打开模型并在Graph Setup(图形设置)对话中为每个变量选择你想要的设置。你使用图形设置对话建立的图形模板将存储在该对象的GraphSetup属性中。如果你有需要改变风格模板,你可以从现有变量复制GraphSetup属性。
# From ADE, obtain a [[CATable]] with the result to be graphed.
+
# 从ADE,获取一个结果将用图形表示的[[CATable/zh|CATable]]
# Set the [[CATable::GraphWidth|GraphWidth]] and [[CATable::GraphHeight|GraphHeight]] properties of the [[CATable]] object to indicate the desired size of the graph in pixels.
+
# 选择[[CATable/zh|CATable]]对象的[[CATable::GraphWidth/zh|GraphWidth]][[CATable::GraphHeight/zh|GraphHeight]]对象以指明想要的图形像素大小。
# If your result has more than two dimensions, call [[CATable::Slice|Slice]] or [[CATable::Subscript|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).
+
# 如果你的结果多于两个维度,调用[[CATable::Slice/zh|Slice]]或者[[CATable::Subscript/zh|Subscript]]将维度减小到绘制图形所需要的维度 (如果没有图例key的话,通常为一个维度,如有有图例的,通常为两个维度)。
# If you have more than one dimension, call [[CATable::SetIndexOrder|SetIndexOrder]] to select the desired pivot for the graph.
+
# 如果维度多于1个,调用[[CATable::SetIndexOrder/zh|SetIndexOrder]]来选择想要的图形枢轴 。
# If you are sending the graph to an output stream, obtain a Windows IStream interface to the stream. If you have a .NET Stream (<code>System.io.Stream</code>), you need to use a wrapper class (see below).
+
# 如果你将图形传送给一个输出流,将获得该流的一个Windows IStream 接口。如果有一个.NET Stream (<code>System.io.Stream</code>),你必须使用一个包裹类型(见下文)。
# Call either the [[CATable::GraphToStream|GraphToStream]] or [[CATable::GraphToFile|GraphToFile]] methods of [[CATable]], depending on where you want the graph written to. The graph can be created in different MIME types (e.g., <code>"image/JPEG"</code>).
+
# 调用[[CATable/zh|CATable]]的[[CATable::GraphToStream/zh|GraphToStream]]或者[[CATable::GraphToFile/zh|GraphToFile]]方法,取决于你想把图形写入到什么地方。图形可以以不同MIME类型建立(例如: <code>"image/JPEG"</code>)。
  
 
== 用法 ==
 
== 用法 ==

Latest revision as of 11:23, 25 October 2015

ADE User Guide > ADE Server Class Reference > CATable

Other languages:
English • ‎中文

bool GraphToFile(fileName, mimeType)

描述

建立一个数据包含在CATable对象中的图像,数据使用«mimeType»格式化并写入到文件«fileName»中。使用的CAObjectCATable从它获得)属性设置来控制图形设置、不确定性设置以及数字格式。GraphWidthGraphHeight属性控制图形像素大小。

返回值

布尔值(成功)

参 数

  • fileName:字符串
  • mimeType :字符串, 使用以下代码之一:
    • "image/png"
    • "image/jpeg"
    • "image/bmp"
    • "image/tiff"

详细说明

这些说明从 ADE用户指南: 使用Analytica图形引擎第四章中拷贝而来。

当你获得一个最少包含一个维度的CATable 结果时,你可以以图像的方式获得该结果的图形。该用法之一就是将图形作为JPEG图像嵌入到在后端使用ADE的web页面中。

需要按照以下步骤才能获得图形结果:

  1. 选择合适的图形设置,比如:图标类型、轴范围设置、颜色、字体等等。 最简单的方法就是在Analytica企业版中打开模型并在Graph Setup(图形设置)对话中为每个变量选择你想要的设置。你使用图形设置对话建立的图形模板将存储在该对象的GraphSetup属性中。如果你有需要改变风格模板,你可以从现有变量复制GraphSetup属性。
  2. 从ADE,获取一个结果将用图形表示的CATable
  3. 选择CATable对象的GraphWidthGraphHeight对象以指明想要的图形像素大小。
  4. 如果你的结果多于两个维度,调用Slice或者Subscript将维度减小到绘制图形所需要的维度 (如果没有图例key的话,通常为一个维度,如有有图例的,通常为两个维度)。
  5. 如果维度多于1个,调用SetIndexOrder来选择想要的图形枢轴 。
  6. 如果你将图形传送给一个输出流,将获得该流的一个Windows IStream 接口。如果有一个.NET Stream (System.io.Stream),你必须使用一个包裹类型(见下文)。
  7. 调用CATableGraphToStream或者GraphToFile方法,取决于你想把图形写入到什么地方。图形可以以不同MIME类型建立(例如: "image/JPEG")。

用法

tab.GraphWidth = 350
tab.GraphHeight = 200
b = tab.GraphToFile( "C:\data\trends.png","image/png" )

另请参考

Comments


You are not allowed to post comments.