| ]project-open[ Core : Home
]project-open[ Core

# Chart

The chart libary is lacated in the file

    tcl/intranet-chart-procs.tcl

It consists mainly of the procedure called

    im_get_chart

which has the follogin API:

    im_get_chart x_axis y_axis data [ default_dim ]

    Parameters:
    x_axis [list start_val end_val display_interval unit [scale]]
    y_axis [list start_val end_val display_interval unit [scale]]
    data [list [list x_val y_val size info link (image)]*]
    default_dim [list margin_left margin_top width height arrows_p] (default "")

As described in the API the x and y-axis may be defined, a list with data may be provided and some default dimensions and configuration settings may be specified.

With the following code this nice chart is generated:

    set x_axis [list 0 1000 100 "kg"]
    set y_axis [list 0 10000 1000 "Euro"]
    set data [list [list 400 6000 30 "Test" "http://www.news.ch"]]
    set settings [list 0 30 800 400 "t"]

    set page_body [im_get_chart $x_axis $y_axis $data $settings]

0
100
200
300
400
500
600
700
800
900
kg
0
1000
2000
3000
4000
5000
6000
7000
8000
9000
Euro