开发者

Create uneven chart intervals in Birt

开发者 https://www.devze.com 2022-12-16 05:00 出处:网络
I have a pie chart in BIRT and about 80 data points. I\'m looking to group them in three catagories <17 17-20 and >20. To be more specific I\'m trying开发者_StackOverflow社区 to make a red yellow g

I have a pie chart in BIRT and about 80 data points. I'm looking to group them in three catagories <17 17-20 and >20. To be more specific I'm trying开发者_StackOverflow社区 to make a red yellow green chart.

How can I do this. I tried the grouping function, but it only allows even intervals that I can find.

Thanks, Buzkie


Use a CASE expression in your query to produce a derived column:

SELECT someval, CASE WHEN (someval < 17) THEN 'Red'
    WHEN (someval >= 17 AND someval <= 20) THEN 'Yellow'
    ELSE 'Green' END AS wedgeColor
FROM sometable

and then you can bind the pie chart in BIRT to the derived column instead of the actual data point value.

0

精彩评论

暂无评论...
验证码 换一张
取 消