title: Closure or prototype model for charting library
body: <p>For Developing javascript charting library, Which model is best prototype or closure??
  While developing chart library which includes more intraction and animation, Does encapsulation necessary?</p>
  
  <p>Like here,</p>
  
  <pre><code>function main(){
   var w = 100;
  
   function chart(){
    //main chart rendering
   }
   chart.width = function(){}
   chart.regenerate = function(){}
   chart.sort = function(){}
   chart.updatelegend = function(){}
   chart.startanimation = function(){}
  return chart;
  }
  </code></pre>
  
  <p>Is this a valid case to use javascript closure like this?</p>