Decimal Data

Created with Raphaƫl 2.1.200.751.52.2533603403203002802602402202001801601401201009080706050403020100
360
1.5 + 1.5 sin(360): 1.5
  1. var decimal_data = [];
  2. for (var x = 0; x <= 360; x += 10) {
  3. decimal_data.push({
  4. x: x,
  5. y: 1.5 + 1.5 * Math.sin(Math.PI * x / 180).toFixed(4)
  6. });
  7. }
  8. window.m = Morris.Line({
  9. element: 'graph',
  10. data: decimal_data,
  11. xkey: 'x',
  12. ykeys: ['y'],
  13. labels: ['sin(x)'],
  14. parseTime: false,
  15. hoverCallback: function (index, options, default_content, row) {
  16. return default_content.replace("sin(x)", "1.5 + 1.5 sin(" + row.x + ")");
  17. },
  18. xLabelMargin: 10,
  19. integerYLabels: true
  20. });