문제

looks like gantt_chart() doesn't work properly for following set of data:

tg_p = [ (0, 12), (0, 5), (0,13) ]
tg_v = [ '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12', '13', '14']
tg_h = [ 'test', 'test2', 'test3' ]
tg_c = [ (1.0, 0.0, 0.0), (1.0, 0.7, 0.0), (0.0, 1.0, 0.0) ]
CairoPlot.gantt_chart('gantt-123', tg_p, 600, 300, tg_h, tg_v, tg_c)

it just renders one bar, any idea ?

thank you

도움이 되었습니까?

해결책

There is a bug report here: https://bugs.launchpad.net/cairoplot/+bug/274181

try setting the tuple in lists, according to the reporter it should work.

Passing data like:

data = [(0,3), (4,5), (8,10)]

makes Gantt Chart crash, plotting all the pieces on the same line.

This, however, works:

data = [(0,3), [(4,5)], (8,10)]

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top