title: Java Script Custom High Chart method
body: <p>i added a method inside my high chart function but im having trouble calling it. </p>
  
  <p>i think i might have the wrong syntax or may have placed the method in the wrong spot(relatively new to JS). the method is at the bottom of my code,i commented, and is called addPoint.its simply supposed to add a new point to the graph. </p>
  
  <p>i tried troubleshooting with putting an alert in the method but that has yet to work. </p>
  
  <p>heres a jfiddle:
  <a href="http://jsfiddle.net/fourgates/WdMrm/" rel="nofollow">http://jsfiddle.net/fourgates/WdMrm/</a></p>
  
  <p>here is my code:</p>
  
  <pre><code>NewHighCharts = function() 
      {                       
          chart = new Highcharts.Chart(
          {
              chart : 
              {
                  renderTo : 'container',
                  type : 'line',
                  marginRight : 130,
                  marginBottom : 25,
                   events: 
                   {
                      click: function(e) 
                      {
                          // find the clicked values and the series
                          var x = e.xAxis[0].value,
                              y = e.yAxis[0].value,
                              series = this.series[0];
                          // Add it
                          series.addPoint([x, y]);
                      }
                   }
              },
  
              title : 
              {
                  text : 'Body Weight',
                  x : -20 //center
              },
              xAxis : 
              {
                  categories : ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']
              },
  
              yAxis : 
              {
                  title : 
                  {
                      text : 'Weight (lbs)'
                  },
                  plotLines : [{
                      value : 0,
                      width : 1,
                      color : '#808080'
              }]
              },
              tooltip : 
              {
                  formatter : function() 
                  {
                      return '&lt;b&gt;' + this.series.name + '&lt;/b&gt;&lt;br/&gt;' + this.x + ': ' + this.y + 'lbs';
                  }
              },
              legend : 
              {
                  layout : 'vertical',
                  align : 'right',
                  verticalAlign : 'top',
                  x : -10,
                  y : 100,
                  borderWidth : 0
              },
              series : [{
                  name : 'George',
                  data : [185,190,185,180]
              }, {
                  name : 'Bindu',
                  data : [115,110,112,115]
              }]
          });//end of chart
              //this is the method i added
          addPoint = function()
          {
              alert("You Added a point!")
              series = this.series[0];
              series.addPoint([4, 190]);
          };  
      };//end of newHighCharts
      newChart = new NewHighCharts();
      newChart.addPoint();
  </code></pre>
  
  <p>Thanks in advance for any help!</p>