'javascript/jQuery'에 해당되는 글 2건

  1. 2013.07.31 jQuery moris.js(free-license)
  2. 2013.07.31 chart 관련 사이트모음 1
2013. 7. 31. 16:01


examples.zip

출처 : http://www.oesmith.co.uk/morris.js/index.html


jQuery 차트를 만드는 방법


1. 추가





2. <div>

3. <script>

var nReloads = 0;
function data(offset) {
  var ret = [];
  for (var x = 0; x <= 360; x += 10) {
    var v = (offset + x) % 360;
    ret.push({
      x: x,
      y: Math.sin(Math.PI * v / 180).toFixed(4),
      z: Math.cos(Math.PI * v / 180).toFixed(4)
    });
  }
  return ret;
}
var graph = Morris.Line({
    element: 'graph',
    data: data(0),
    xkey: 'x',
    ykeys: ['y', 'z'],
    labels: ['sin()', 'cos()'],
    parseTime: false,
    ymin: -1.0,
    ymax: 1.0,
    hideHover: true
});
function update() {
  nReloads++;
  graph.setData(data(5 * nReloads));
  $('#reloadStatus').text(nReloads + ' reloads');
}
setInterval(update, 200);


4. 실행화면



기본적인 꺽은선 그래프이다.


추가적인 그래프를 원할 경우 examples.zip의 samaple파일을 확인해보자.



'javascript > jQuery' 카테고리의 다른 글

chart 관련 사이트모음  (1) 2013.07.31
Posted by 1+1은?
2013. 7. 31. 13:16

http://codegeekz.com/best-jquery-chart-libraries-for-building-interactive-charts/


chart.Js : http://www.chartjs.org/docs/


Chart.js-master.zip


xCharts : http://tenxer.github.io/xcharts/


xcharts-master.zip


jqPlothttp://www.jqplot.com/


jquery.jqplot.1.0.8r1250.zip


wijmo javascript api : http://wijmo.com/docs/wijmo/webframe.html#Linechart.html


google : https://developers.google.com/chart/?hl=ko&csw=1


최신모음 : http://socialcompare.com/en/comparison/javascript-graphs-and-charts-libraries


'javascript > jQuery' 카테고리의 다른 글

jQuery moris.js(free-license)  (0) 2013.07.31
Posted by 1+1은?