วันพุธที่ 28 มกราคม พ.ศ. 2558

Exercise 2

Try  web-based tools


สำหรับ web-based tools ที่ทดลองใช้คือ Plotly 
มีขั้นตอนในการใช้งานอย่างง่าย ดังนี้
     1. สร้างตารางข้อมูลใน Google sheets



     2. ใช้ฟังก์ชันที่มีอยู่ในเว็บ plotly คือ สามารถ import ไฟล์ จาก Google Drive หรือ Dropbox ได้จากในเว็บ plotly ทันที



     3. ข้อมูลที่สร้างจาก Google sheets ก็จะมาปรากฏใน plotly ทันที


     4.เมื่อกด Line plot  ก็จะได้รูปกราฟ ดังนี้


Refer from : https://plot.ly/
                    
---------------------------------------------------------------------------------------------------------

Try google chart
     
     ตัวอย่างโค้ด

 <script type="text/javascript" src="https://www.google.com/jsapi?autoload={'modules':[{'name':'visualization','version':'1','packages':['corechart']}]}"></script>
    
          <div id="ex0"></div>
            google.load('visualization', '1', {packages: ['corechart']});
    google.setOnLoadCallback(drawChart);

    function drawChart() {

      var data = new google.visualization.DataTable();
      data.addColumn('number', 'X');
      data.addColumn('number', 'Horse power');

      data.addRows([
        [0, 0],   [2000, 60],  [2500, 90],
        [3000,110],  [3500,140],  [4000,170],
        [4500,190],  [5000,220],  [5500,240],
        [6000,270],  [6500,280],  [7000,300],
        [7500,290]
      ]);

      var options = {
        width: 600,
        height: 563,
        hAxis: {
          title: 'RPM'
        },
        vAxis: {
          title: 'Horse power'
        }
      };

      var chart = new google.visualization.LineChart(
        document.getElementById('ex0'));

      chart.draw(data, options);

    }




ไม่มีความคิดเห็น:

แสดงความคิดเห็น