Value 就可以
外观
定义图表的外观使用 Presentation 元素。这个元素可以包含一些用于定义图表子组件视觉外观的其它元素。
<Presentation Type=`column`>
<Legend Visible=`true`/>
<Axes>
<ValueAxis Visible=`true`
ShowMajorTicks=`true`
ShowMinorTicks=`false`>
</ValueAxis>
<CategoryAxis Visible=`true`
ShowMajorTicks=`true`
ShowMinorTicks=`false`>
</CategoryAxis>
</Axes>
<GridLines>
<MajorValue Visible=`true`>
<Stroke Color="#cfe0f2"/>
</MajorValue>
<MinorValue Visible=`false`/>
<MajorCategory Visible=`false`/>
<MinorCategory Visible=`false`/>
</GridLines>
<ChartArea>
<Stroke Color="transparent"/>
<Fill Color="#e3edf9" Color2="white" Type="Gradient"/>
</ChartArea>
<Points/>
<Charts>
<Chart Series="s0">
<Fill Color="#6e6cab"/>
</Chart>
<Chart Series="s1">
<Fill Color="#ffd58f"/>
</Chart>
<Chart Series="s2">
<Fill Color="#fc7373"/>
</Chart>
</Charts>
</Presentation>Presentaion 中最重要的,真正需要修改的属性是 Type,Bindows™ 中支持几种不同的图表类型:
bar
column
grid
line
pie
percentagestackedbar
percentagestackedcolum
stackedbar
stackedcolumn
Enclosing these two XML fragments inside a Graph element gives the following.
创建图表组件
现在我们可以定义一个 XML 文件创建一个新的 Bigraph。
var graph = BiGraph.fromUri(application.getAdfPath() + "chartdata.xml");这代码下载了 XML 文件,与此同时,通过 XML 中提供的数据和外观信息创建了一个图表。
还有一个更重要的事情。一旦图表创建(插入到应用程序窗口中),我们需要更新。这个方法计算了轴,并且绘制组件。这个操作是有代价的所以要小心使用。
function ChartApp() {
var win = application.getWindow();
// create graph from the XML file. This loads the XML synchronously.
var graph = BiGraph.fromUri(application.getAdfPath() + "chartdata.xml");
var leftPane = new BiComponent;