score:6

Accepted answer

I don't quite upderstand how you want your calculation to work, but I can help with how to update the chart. Basically, you need to create a new aray of datapoints, and then call setData on the appropriate chart series.

I tried this on your example. The calcuation (ui.value * i) needs to be changed, but it ilustrates how to update the chart. It uses the valueof the second slider to update the first series points:

slide: function(event, ui) {
    $('#slider2_value').html('$' + ui.value);
    var newdata = [];
    for (var i=0 ; i<6 ; i++) {
        newdata.push(ui.value * i);
    }
    chart.series[0].setData (newdata);
},

http://jsfiddle.net/BLKQf/


Related Query

More Query from same tag