Ejemplo n.º 1
0
 def test_treemap():
     treemap = Treemap(style=RotateStyle('#ff5995', opacity=.6))
     treemap.title = 'Binary TreeMap'
     treemap.add('A', [2, 1, 12, 4, 2, 1, 1, 3, 12, 3, 4, None, 9])
     treemap.add('B', [4, 2, 5, 10, 3, 4, 2, 7, 4, -10, None, 8, 3, 1])
     treemap.add('C', [3, 8, 3, 3, 5, 3, 3, 5, 4, 12])
     treemap.add('D', [23, 18])
     treemap.add('E',
                 [1, 2, 1, 2, 3, 3, 1, 2, 3, 4, 3, 1, 2, 1, 1, 1, 1, 1])
     treemap.add('F', [31])
     treemap.add('G', [5, 9.3, 8.1, 12, 4, 3, 2])
     treemap.add('H', [12, 3, 3])
     return treemap.render_response()
Ejemplo n.º 2
0
 def test_treemap():
     treemap = Treemap(style=RotateStyle('#ff5995', opacity=.6,
                                         value_font_size=32,
                                         value_colors=['#ffffff']))
     treemap.title = 'Binary TreeMap'
     treemap.print_values = True
     treemap.print_labels = True
     for i in range(1, 5):
         treemap.add('', [{'label': 'Area %d' % i, 'value': i}])
     treemap.add('', [2])
     # treemap.add('A', [2, 1, 12, 4, 2, 1, 1, 3, 12, 3, 4, None, 9])
     # treemap.add('B', [4, 2, 5, 10, 3, 4, 2, 7, 4, -10, None, 8, 3, 1])
     # treemap.add('C', [3, 8, 3, 3, 5, 3, 3, 5, 4, 12])
     # treemap.add('D', [23, 18])
     # treemap.add('E', [1, 2, 1, 2, 3, 3, 1, 2, 3,
     #                   4, 3, 1, 2, 1, 1, 1, 1, 1])
     # treemap.add('F', [31])
     # treemap.add('G', [5, 9.3, 8.1, 12, 4, 3, 2])
     # treemap.add('H', [12, 3, 3])
     return treemap.render_response()