disable approximation in chart? - Javascript highcharts

Javascript examples for highcharts:Chart Configuration

Description

disable approximation in chart?

Demo Code

ResultView the demo in separate window

<html>
   <head> 
      <meta name="viewport" content="width=device-width, initial-scale=1"> 
      <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script> 
      <script type="text/javascript">
Math.sign = function(x){/*from  w  w  w. j  a  v  a2 s  .co m*/
    if( +x === x ) {
        return (x === 0) ? x : (x > 0) ? 1 : -1;
    }
    return NaN;
}
function foo(x) {
    return -3.6*Math.exp(-3.5*Math.pow(x,2))*Math.sign(Math.cos(31*x-7));
}
$(function () {
    var leftBracket = -1,
        rightBracket = 1;
    var step = 2/500;
    var data = [];
    for(var cur = leftBracket; cur < rightBracket; cur+=step) {
        data.push([cur, foo(cur)]);
    }
    $('#container').highcharts({
        series: [{
            type: 'scatter',
            name: 'Values',
            data: data,
            marker: {
                radius: 2
            }
        }]
    });
    data.push([0.8, foo(0.8)])
});

      </script> 
   </head> 
   <body> 
      <script src="https://code.highcharts.com/highcharts.js"></script> 
      <script src="https://code.highcharts.com/modules/exporting.js"></script> 
      <div id="container" style="min-width: 400px; height: 400px; margin: 0 auto"></div>  
   </body>
</html>

Related Tutorials