You do realise that the functionality described requires server-side processing?
I don't think you're going to find a script with such graphing routines built-in, however any decent rating script will allow you to run your own function when a rating is selected.
Such a function could send the rating to the server via an AJAX request, then read the returned average and use it to generate a chart.
Where used, return should be executed unconditionally and always as the last statement in the function.
That's my signature, it's not part of the damn post!