@referrer_limit
@cache_page(60 * 15)
def graph_artist(request, username, artist, width=800, height=300):
    
    ready_or_update(username)
    
    width = int(width)
    height = int(height)
    
    if not width:
        width=800
    
    if not height:
        width=300
    
    uh = UserHistory(username)
    uh.load_if_possible()
    
    series_set = SeriesSet()
    series_set.add_series(Series(
        artist,
        uh.artist_plays(artist),
        "#369f",
        {0:4},
    ))
    
    # Create the output
    output = FileOutput(padding=0, style=artist_detail_white_css)
    
    try:
        scale = AutoWeekDateScale(series_set, short_labels=True, month_gap=2)
    except __HOLE__:
        raise Http404("Bad data (ValueError)")
    
    # OK, render that.
    wg = WaveGraph(series_set, scale, artist_detail_white_css, False, vertical_scale=True)
    output.add_item(wg, x=0, y=0, width=width, height=height)
    
    # Save the images
    return stream_graph(output)
dataset/ETHPy150Open andrewgodwin/lastgraph/lastgui/views.py/graph_artist