Board logo

标题: 基于 Cognos 的 RAVE 个性化可视化开发(2) [打印本页]

作者: look_w    时间: 2018-6-24 15:25     标题: 基于 Cognos 的 RAVE 个性化可视化开发(2)

开发一个实例 在开发之前需要注意,VisualizationCustomizer 是 IBM Cognos RAVE 的开发环境,不同版本的 Cognos 对应的                VisualizationCustomizer 版本是一一对应的,跨版本的 VisualizationCustomizer                开发的可视化在 Cognos 中是不能运行的。 因此在开发之前应该确定 Cognos 对应的版本,                然后再配置对应的 VisualizationCustomizer 版本 。
首先,打开开发环境 VisualizationCustomizer 如下图 :
左边对开发代码,右边是效果展示。本例我们以开发一个柱状图为例,实现 RAVE 的从开发到发布的全过程。
源码如下(可将源码直接复制到 VisualizationCustomizer 中 ,点击右边的 Draw Chart 按钮 ,可以观察可视化效果 )
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
{
  "data": [
    {
      "id": "data",
      "fields": [
        {
          "id": "name",
          "label": "name",
          "categories": [
            "ALABAMA",
            "ARIZONA",
            "ARKANSAS",
            "CALIFORNIA"
          ]
        },
        {
          "id": "pop1980",
          "label": "Population End",
          "format": {"numericPattern": "#,000"}
        }
      ],
      "rows": [
        [ 0, 4838708 ],
        [ 1, 6885778 ],
        [ 2, 3079450 ],
        [ 3, 9006166 ]
      ]
    }
  ],
  "copyright": "(C) Copyright IBM Corp. 2013",
  "grammar": [
    {
      "coordinates": {
        "dimensions": [ {"axis": {}}, {"axis": {}} ],
        "style": {"fill": "white"}
      },
      "elements": [
        {
          "type": "interval",
          "position": [
            {"field": {"$ref": "pop1980"}},
            {"field": {"$ref": "name"}}
          ],
          "style": {
            "fill": "green",
            "stroke": {"width": 0.25},
            "width": "60%",
            "outline": "black"
          }
        }
      ]
    }
  ],
  "size": {"width": 300, "height": 300},
  "version": "7.1",
  "style": {"fill": "transparent"}
}




点击 按钮更新源码 后再点击                                    验证源码是否正确,如果不通过则需要对源码进行调试通过(以上源码使经过测试可以运行的)。当显示 valid 后再点击                 

将该源码打包。本例将打包后的 RAVE 包命名为 。目前为止,第一个柱状图的 RAVE 包已经打包完成。




欢迎光临 电子技术论坛_中国专业的电子工程师学习交流社区-中电网技术论坛 (http://bbs.eccn.com/) Powered by Discuz! 7.0.0