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

(Created page with "需要按照以下步骤才能获得图形结果: # 选择合适的图形设置,比如:图标类型、轴范围设置、颜色、字体等等。 最简单的方法就是...")
Line 30: Line 30:
 
当你获得一个最少包含一个维度的[[CATable/zh|CATable]] 结果时,你可以以图像的方式获得该结果的图形。该用法之一就是将图形作为JPEG图像嵌入到在后端使用ADE的web页面中。
 
当你获得一个最少包含一个维度的[[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>)。
  
 
== 用法 ==
 
== 用法 ==

Revision as of 11:21, 25 October 2015

ADE User Guide > ADE Server Class Reference > CATable

Other languages:
English • ‎中文

bool GraphToStream(stream, mimeType)

描述

建立一个数据包含在CATable对象中的图像,数据使用mimeType格式化并写入到文件stream(流)中。通过表格的GraphWidthGraphHeight属性控制图形像素大小。


注意:一个IStream不可以同一个.NET System.Io.Stream对象互换(在ASP.NET中包含一个Response.OutputStream对象)。在这两者之间转化必须要一个包装器类型。Wrapper(包装器)类型和更多说明是否应该在这里讨论还有待确定。

返回值

布尔值(成功)

参 数

  • stream:字符串
  • 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")。

用法

ab.GraphWidth = 350
tab.GraphHeight = 200
dim outStream as StringConnector = _new StreamConnector(Response.OutputStream)
b = tab.GraphToStream( outStream, "image/jpeg")

另请参考

Comments


You are not allowed to post comments.