This shows you the differences between two versions of the page.
en:pie [2016/01/01 22:41] 127.0.0.1 external edit |
en:pie [2020/02/28 10:46] |
||
---|---|---|---|
Line 1: | Line 1: | ||
- | ===== Pie (Statement) ===== | ||
- | |||
- | ==== Format ==== | ||
- | |||
- | **pie** //x_expr//, //y_expr//, // | ||
- | **pie** ( //x_expr//, //y_expr//, // | ||
- | |||
- | |||
- | ==== Description ==== | ||
- | |||
- | Draws a pie shaped slice inside the bounding rectangle defined by //x_expr//, //y_expr//, // | ||
- | |||
- | ==== Example ==== | ||
- | |||
- | < | ||
- | # pie_chart.kbs | ||
- | # 2012-12-29 j.m.reneau | ||
- | # | ||
- | # example of pie statement added on 0.9.9.25 | ||
- | |||
- | dim data(5) | ||
- | data = {1, | ||
- | dim colors(5) | ||
- | colors = {red, | ||
- | total = 0 | ||
- | for n = 0 to data[?]-1 | ||
- | total += data[n] | ||
- | next n | ||
- | |||
- | clg | ||
- | font " | ||
- | startangle = 0 | ||
- | for n = 0 to data[?]-1 | ||
- | # calculate the with of the pie slice in radians | ||
- | | ||
- | color colors[n] | ||
- | pie 50, | ||
- | # draw the value' | ||
- | text 140+sin(startangle+slicesize*.5)*120, | ||
- | | ||
- | next n</ | ||
- | draws\\ | ||
- | {{: | ||
- | |||
- | ==== See Also ==== | ||
- | {{page> | ||
- | |||
- | ==== History ==== | ||
- | |0.9.9.25|New To Version| | ||