Advertisement
cherurg

Untitled

Feb 11th, 2015
187
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. var container = new PlotContainer("plot");
  2.  
  3. var controls = new app.Controls(container.addEmptyDiv());
  4.  
  5. var plot = container.addPlot();
  6.  
  7. var func = plot.addFunc(function (x) {
  8.     return x;
  9. });
  10.  
  11.  
  12. function changeRange (value) {
  13.     range.setText(text + value);
  14.     plot.remove(func);
  15.     func = plot.addFunc(function (x) {
  16.         return value*x;
  17.     });
  18.  
  19. }
  20.  
  21. var text = "Коэффициент a: ";
  22. var range = controls.addRange(changeRange, text + "1", -1, 1, 0.01, 1);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement