วิธีออมเงิน
11 กุมภาพันธ์ 2558
10 กุมภาพันธ์ 2558
Prepare for Assignment 1
Start learning D3.js
Bar
Charts !
4
8
15
16
23
42
แบบที่ 1 Manually - text
แบบที่ 2 Automatically [D3.js] - text
แบบที่ 3 Automatically [D3.js][long form] - text
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | <body> <style> .chart div { font: 10px sans-serif; background-color: steelblue; text-align: right; padding: 3px; margin: 1px; color: white; } </style> <div class="chart"> <div style="width: 40px;">4</div> <div style="width: 80px;">8</div> <div style="width: 150px;">15</div> <div style="width: 160px;">16</div> <div style="width: 230px;">23</div> <div style="width: 420px;">42</div> </div> </body> |
แบบที่ 2 Automatically [D3.js] - text
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 | <style> .chart div { font: 10px sans-serif; background-color: steelblue; text-align: right; padding: 3px; margin: 1px; color: white; } </style> <body> <div class="chart"></div> <script src="http://d3js.org/d3.v3.min.js"></script> <script> var data = [4, 8, 15, 16, 23, 42]; d3.select(".chart") .selectAll("div") .data(data) .enter().append("div") .style("width", function(d) { return d * 10 + "px"; }) .text(function(d) { return d; }); </script> </body> |
แบบที่ 3 Automatically [D3.js][long form] - text
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 | <style> .chart div { font: 10px sans-serif; background-color: steelblue; text-align: right; padding: 3px; margin: 1px; color: white; } </style> <body> <div class="chart"></div> <script src="http://d3js.org/d3.v3.min.js"></script> <script> var data = [4, 8, 15, 16, 23, 42]; var chart = d3.select(".chart"); var bar = chart.selectAll("div"); var barUpdate = bar.data(data); var barEnter = barUpdate.enter().append("div"); barEnter.style("width", function(d) { return d * 10 + "px"; }); barEnter.text(function(d) { return d; }); </script> </body> |
แบบที่ 4 Manually - graphics
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 | <style> .chart rect { fill: steelblue; } .chart text { fill: white; font: 10px sans-serif; text-anchor: end; } </style> <svg class="chart" width="420" height="120"> <g transform="translate(0,0)"> <rect width="40" height="19"></rect> <text x="37" y="9.5" dy=".35em">4</text> </g> <g transform="translate(0,20)"> <rect width="80" height="19"></rect> <text x="77" y="9.5" dy=".35em">8</text> </g> <g transform="translate(0,40)"> <rect width="150" height="19"></rect> <text x="147" y="9.5" dy=".35em">15</text> </g> <g transform="translate(0,60)"> <rect width="160" height="19"></rect> <text x="157" y="9.5" dy=".35em">16</text> </g> <g transform="translate(0,80)"> <rect width="230" height="19"></rect> <text x="227" y="9.5" dy=".35em">23</text> </g> <g transform="translate(0,100)"> <rect width="420" height="19"></rect> <text x="417" y="9.5" dy=".35em">42</text> </g> </svg> |
แบบที่ 5 Automatically - graphics
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 | <meta charset="utf-8"> <style> .chart rect { fill: steelblue; } .chart text { fill: white; font: 10px sans-serif; text-anchor: end; } </style> <svg class="chart"></svg> <script src="http://d3js.org/d3.v3.min.js"></script> <script> var data = [4, 8, 15, 16, 23, 42]; var width = 420, barHeight = 20; var x = d3.scale.linear() .domain([0, d3.max(data)]) .range([0, width]); var chart = d3.select(".chart") .attr("width", width) .attr("height", barHeight * data.length); var bar = chart.selectAll("g") .data(data) .enter().append("g") .attr("transform", function(d, i) { return "translate(0," + i * barHeight + ")"; }); bar.append("rect") .attr("width", x) .attr("height", barHeight - 1); bar.append("text") .attr("x", function(d) { return x(d) - 3; }) .attr("y", barHeight / 2) .attr("dy", ".35em") .text(function(d) { return d; }); </script> |
แบบที่ 6 ทดลองเปลี่ยนแนวกราฟ ?
Reference : https://github.com/mbostock/d3/wiki/Tutorials
9 กุมภาพันธ์ 2558
3 กุมภาพันธ์ 2558
Find types/structures not mentioned in lecture
Disk space visualization
เป็นรูปแบบ Data Visualization ชนิดหนึ่งแสดงถึงการใช้งานพื้นที่ของดิกส์(Disk
Usage) ในรูปแบบที่คล้ายกับ pie charts
โปรแกรม
filelight
(UNIX)
โปรแกรม philesight (UNIX)
Try web-based tools
Creately เป็น web-based tools อีกหนึ่งเครื่องมือที่สามารถสร้าง
Data visualization ได้หลากหลายรูปแบบไม่ว่าจะเป็น Basic
Charts, Flowcharts, UML Diagrams, Gantt Charts, Organizational Charts และอื่นๆ อีกมากมาย
สำหรับการใช้งานสามารถใช้งานได้ทั้งแบบ
Online(มีแบบฟรี และเสียเงิน) และดาวโหลดเป็นโปรแกรมมาติดตั้งบนเครื่อง(เสียเงิน)
รูปภาพแสดงถึงคอนเซปของ Creately
รูปภาพแสดงถึงการเลือกรูปแบบที่ต้องการ
รูปภาพแสดงถึงหน้าแรกของการทำงานออนไลน์เว็ป
รูปภาพแสดงถึงวิธีการสร้าง Bar
Charts
รูปภาพแสดงถึงการทำ infographics
Reference : http://creately.com/
สมัครสมาชิก:
ความคิดเห็น (Atom)





