pyOFC2 Python Open Flash Chart 2

Stepped axis

Radar Chart with stepped axis and custom tooltips for individual points.

def test_radar_charts_3():
    
    chart = open_flash_chart()
    chart.title = title(text='Radar Chart')
    
    val1 = [30,50,60,70,80,90,100,115,130,115,100,90,80,70,60,50]
    spokes = ['a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p']
    val2 = []
    
    for i in val1:                                   
        txt = "#val#<br>Spoke: %s" % i 
        tmp = dot_value(value=i,  colour='#D41E47', tip=txt)
        val2.append(tmp)
    line = line_hollow()
    line.values = val2
    line.halo_size = 0
    line.width = 2
    line.dot_size = 6
    line.colour = '#FBB829'
    line.text = 'Hearts'
    line.font_size = 10
    line.loop = True
    chart.add_element(line)
    r = radar_axis(max=150)
    r.step = 10
    r.colour = '#DAD5E0'
    r.grid_colour = '#EFEFEF'
    chart.radar_axis = r
    tip = tooltip(proximity=1)
    chart.tooltip = tip
    chart.bg_colour = '#FFFFFF'
    return chart

Data used to generate the chart — radar_charts_3.json

© 2009 Pradeep Kishore Gowda