달력

7

« 2019/7 »

  •  
  • 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
  •  
  •  
  •  
2016.03.25 19:24

[Chart] Morris.js Donut Chart CODE/jQuery 활용2016.03.25 19:24

소 스


<!DOCTYPE html>
<html>
<head>
<script src="http://cdnjs.cloudflare.com/ajax/libs/raphael/2.1.0/raphael-min.js"></script>
<script src="http://code.jquery.com/jquery-1.8.2.min.js"></script>
<script src="http://cdn.oesmith.co.uk/morris-0.4.1.min.js"></script>
<meta charset=utf-8 />
<title>Morris.js Donut Chart Example</title>
<script>
jQuery(document).ready(function($) {
Morris.Donut({
element: 'donut-example',
data: [
{label: "label 1", value: 42},
{label: "label 2", value: 30},
{label: "label 3", value: 20}
]
});
});
</script>
</head>
<body>
<div style="width: 300px; height: 300px; background-color: crimson" id="donut-example"></div>
</body>
</html>


실행결과





'CODE > jQuery 활용' 카테고리의 다른 글

[Chart] Morris.js Donut Chart  (0) 2016.03.25
[Chart] Easy Pie Chart  (0) 2016.03.25
[Chart] Morris.js Bar Chart  (0) 2016.03.25
[Chart] Morris.js Area Chart  (0) 2016.03.25
[Chart] Morris.js Line Chart  (0) 2016.03.25
[jQuery] jqGrid Multiple Footer 테이블  (0) 2014.05.09
Posted by 레이칸트
2016.03.25 19:23

[Chart] Easy Pie Chart CODE/jQuery 활용2016.03.25 19:23

소 스


<!DOCTYPE html>
<html>
<head>
<script src="http://code.jquery.com/jquery-2.0.3.min.js"></script>
<script src="http://cdnjs.cloudflare.com/ajax/libs/jquery-easing/1.3/jquery.easing.min.js"></script>
<script type="text/javascript" src="js/jquery.easypiechart.js"></script>
<meta charset=utf-8 />
<title>Easy Pie Chart</title>
<style>
.chart {
position: relative;
display: inline-block;
width: 110px;
height: 110px;
margin-top: 20px;
margin-bottom: 20px;
text-align: center;
}
.chart.chart-widget-pie {
margin-top: 5px;
margin-bottom: 5px;
}
.chart canvas {
position: absolute;
top: 0;
left: 0;
}
.percent {
display: inline-block;
line-height: 110px;
z-index: 2;
}
.percent:after {
content: '%';
margin-left: 0.1em;
font-size: .8em;
}
</style>
<script>
jQuery(document).ready(function($) {
$('.easy-pie-chart-1').easyPieChart({
easing: 'easeOutBounce',
barColor : '#8CC152',
lineWidth: 3,
onStep: function(from, to, percent) {
$(this.el).find('.percent').text(Math.round(percent));
}
});
$('.easy-pie-chart-2').easyPieChart({
easing: 'easeOutBounce',
barColor : '#F6BB42',
lineWidth: 3,
trackColor : false,
lineCap : 'butt',
onStep: function(from, to, percent) {
$(this.el).find('.percent').text(Math.round(percent));
}
});
$('.easy-pie-chart-3').easyPieChart({
easing: 'easeOutBounce',
barColor : '#E9573F',
lineWidth: 10,
lineCap : 'square',
onStep: function(from, to, percent) {
$(this.el).find('.percent').text(Math.round(percent));
}
});
$('.easy-pie-chart-4').easyPieChart({
easing: 'easeOutBounce',
barColor : '#3BAFDA',
lineWidth: 20,
onStep: function(from, to, percent) {
$(this.el).find('.percent').text(Math.round(percent));
}
});
});
</script>
</head>
<body>
<div class="chart easy-pie-chart-1" data-percent="86">
<span class="percent"></span>
</div>
<div class="chart easy-pie-chart-2" data-percent="86">
<span class="percent"></span>
</div>
<div class="chart easy-pie-chart-3" data-percent="86">
<span class="percent"></span>
</div>
<div class="chart easy-pie-chart-4" data-percent="56">
<span class="percent"></span>
</div>
</body>
</html>


실행결과

Easy Pie Chart

링크

https://github.com/rendro/easy-pie-chart











'CODE > jQuery 활용' 카테고리의 다른 글

[Chart] Morris.js Donut Chart  (0) 2016.03.25
[Chart] Easy Pie Chart  (0) 2016.03.25
[Chart] Morris.js Bar Chart  (0) 2016.03.25
[Chart] Morris.js Area Chart  (0) 2016.03.25
[Chart] Morris.js Line Chart  (0) 2016.03.25
[jQuery] jqGrid Multiple Footer 테이블  (0) 2014.05.09
Posted by 레이칸트
2016.03.25 19:21

[Chart] Morris.js Bar Chart CODE/jQuery 활용2016.03.25 19:21

소 스


[Chart] Morris.js
Bar Chart

<!DOCTYPE html>
<html>
<head>
<script src="http://cdnjs.cloudflare.com/ajax/libs/raphael/2.1.0/raphael-min.js"></script>
<script src="http://code.jquery.com/jquery-1.8.2.min.js"></script>
<script src="http://cdn.oesmith.co.uk/morris-0.4.1.min.js"></script>
<meta charset=utf-8 />
<title>Morris.js Bar Chart Example</title>
<script>
jQuery(document).ready(function($) {
Morris.
Bar({
element: 'bar-example',
data: [
{ y: '2006', a: 100, b: 90 },
{ y: '2007', a: 75, b: 65 },
{ y: '2008', a: 50, b: 40 },
{ y: '2009', a: 75, b: 65 },
{ y: '2010', a: 50, b: 40 },
{ y: '2011', a: 75, b: 65 },
{ y: '2012', a: 100, b: 90 }
],
xkey: 'y',
ykeys: ['a', 'b'],
labels: ['Series A', 'Series B']
});
});
</script>
</head>
<body>
<div style="width: 600px; height: 300px;" id="bar-example"></div>
</body>
</html>


실행결과









'CODE > jQuery 활용' 카테고리의 다른 글

[Chart] Morris.js Donut Chart  (0) 2016.03.25
[Chart] Easy Pie Chart  (0) 2016.03.25
[Chart] Morris.js Bar Chart  (0) 2016.03.25
[Chart] Morris.js Area Chart  (0) 2016.03.25
[Chart] Morris.js Line Chart  (0) 2016.03.25
[jQuery] jqGrid Multiple Footer 테이블  (0) 2014.05.09
Posted by 레이칸트
2016.03.25 19:19

[Chart] Morris.js Area Chart CODE/jQuery 활용2016.03.25 19:19

소 스


[Chart] Morris.js
Area Chart

<!DOCTYPE html>
<html>
<head>
<script src="http://cdnjs.cloudflare.com/ajax/libs/raphael/2.1.0/raphael-min.js"></script>
<script src="http://code.jquery.com/jquery-1.8.2.min.js"></script>
<script src="http://cdn.oesmith.co.uk/morris-0.4.1.min.js"></script>
<meta charset=utf-8 />
<title>Morris.js Area Chart Example</title>
<script>
jQuery(document).ready(function($) {
Morris.
Area({
element: 'Area-example',
data: [
{ y: '2006', a: 100, b: 90 },
{ y: '2007', a: 75, b: 65 },
{ y: '2008', a: 50, b: 40 },
{ y: '2009', a: 75, b: 65 },
{ y: '2010', a: 50, b: 40 },
{ y: '2011', a: 75, b: 65 },
{ y: '2012', a: 100, b: 90 }
],
xkey: 'y',
ykeys: ['a', 'b'],
labels: ['Series A', 'Series B']
});
});
</script>
</head>
<body>
<div style="width: 600px; height: 300px;" id="Area-example"></div>
</body>
</html>


실행결과









'CODE > jQuery 활용' 카테고리의 다른 글

[Chart] Easy Pie Chart  (0) 2016.03.25
[Chart] Morris.js Bar Chart  (0) 2016.03.25
[Chart] Morris.js Area Chart  (0) 2016.03.25
[Chart] Morris.js Line Chart  (0) 2016.03.25
[jQuery] jqGrid Multiple Footer 테이블  (0) 2014.05.09
[jQuery] jqGrid array 테이블  (0) 2014.05.08
Posted by 레이칸트
2016.03.25 19:17

[Chart] Morris.js Line Chart CODE/jQuery 활용2016.03.25 19:17

소 스


[Chart] Morris.js Line Chart

<!DOCTYPE html>
<html>
<head>
<script src="http://cdnjs.cloudflare.com/ajax/libs/raphael/2.1.0/raphael-min.js"></script>
<script src="http://code.jquery.com/jquery-1.8.2.min.js"></script>
<script src="http://cdn.oesmith.co.uk/morris-0.4.1.min.js"></script>
<meta charset=utf-8 />
<title>Morris.js Line Chart Example</title>
<script>
jQuery(document).ready(function($) {
Morris.Line({
element: 'line-example',
data: [
{ y: '2006', a: 100, b: 90 },
{ y: '2007', a: 75, b: 65 },
{ y: '2008', a: 50, b: 40 },
{ y: '2009', a: 75, b: 65 },
{ y: '2010', a: 50, b: 40 },
{ y: '2011', a: 75, b: 65 },
{ y: '2012', a: 100, b: 90 }
],
xkey: 'y',
ykeys: ['a', 'b'],
labels: ['Series A', 'Series B']
});
});
</script>
</head>
<body>
<div style="width: 600px; height: 300px;" id="line-example"></div>
</body>
</html>


실행결과













'CODE > jQuery 활용' 카테고리의 다른 글

[Chart] Morris.js Bar Chart  (0) 2016.03.25
[Chart] Morris.js Area Chart  (0) 2016.03.25
[Chart] Morris.js Line Chart  (0) 2016.03.25
[jQuery] jqGrid Multiple Footer 테이블  (0) 2014.05.09
[jQuery] jqGrid array 테이블  (0) 2014.05.08
구글 지도 예제소스  (0) 2014.04.01
Posted by 레이칸트
2015.05.19 08:58

[JAVA] Ex010 로또번호 출력하기 CODE/JAVA 기초2015.05.19 08:58


public class LottoMain {

public static void main(String[] args) {

Lotto lotto = new Lotto();

lotto.make();

print(lotto.getBall());

}

public static void print(int [] a){

int count=a.length;

System.out.print("로토 번호는 : ["+a[0]+", ");

for(int i=1;i<count-1;i++){

System.out.print(a[i]+", ");

}

System.out.println(a[count-1]+"]");

}

}


class  Lotto {

private int[] ball;

public Lotto(){

ball=new int[6];

}

public int[] getBall(){

return ball;

}

private boolean isSame(int [] a, int b){

boolean isS=false;

for(int i=0;i<a.length;i++){

if(a[i]==b){

isS=true;

break;

}

}

return isS;

}

//원하는 수의 배열 만들기 

public  void make(){

int count=0;

while(true){

// Math.random()  0<=n<1까지 실수

int b=(int)(Math.random()*45)+1; 

if(! isSame(ball,b)){

ball[count++]=b;

}

if(count==6){break;}

}

}

}

'CODE > JAVA 기초' 카테고리의 다른 글

[JAVA] Ex010 로또번호 출력하기  (0) 2015.05.19
[JAVA] Ex009 ReverseArray - 정렬  (0) 2015.05.19
[JAVA] Ex008 BubbleSort - 정렬  (0) 2015.05.19
[JAVA] Ex007 Calendar, Date 정보출력  (0) 2015.05.19
[JAVA] Ex006 다중for문, if 예제  (0) 2015.05.19
[JAVA] Ex005 Math method  (0) 2015.05.19
Posted by 레이칸트
2015.05.19 08:47

[JAVA] Ex009 ReverseArray - 정렬 CODE/JAVA 기초2015.05.19 08:47

public class ReverseArrayMain {

public static void main(String[] args) {

int [] a={5,6,3,7,4,8,2,9};

ReverseArray ra=new ReverseArray();

BubbleSort bsort=new BubbleSort();

BubbleSort.print(a);//a출력

int [] c=bsort.bbsortinc(a);

int [] b=ra.reverse(a);

BubbleSort.print(c);//a bubble 출력

BubbleSort.print(b);//b reverse

ra.reverseb(c);//c reverse 

BubbleSort.print(c);

}

}

class ReverseArray {

public int[] reverse(int [] arr){

int count=arr.length;

int[] a=new int[count];

for(int i=0;i<count;i++){

a[count-i-1]=arr[i];

}

return a;

}

public void reverseb(int [] arr){

int count=arr.length;

for(int i=0;i<=count/2;i++){

int temp=arr[i];

arr[i]=arr[count-i-1];

arr[count-i-1]=temp;

}

}

}

'CODE > JAVA 기초' 카테고리의 다른 글

[JAVA] Ex010 로또번호 출력하기  (0) 2015.05.19
[JAVA] Ex009 ReverseArray - 정렬  (0) 2015.05.19
[JAVA] Ex008 BubbleSort - 정렬  (0) 2015.05.19
[JAVA] Ex007 Calendar, Date 정보출력  (0) 2015.05.19
[JAVA] Ex006 다중for문, if 예제  (0) 2015.05.19
[JAVA] Ex005 Math method  (0) 2015.05.19
Posted by 레이칸트
2015.05.19 08:46

[JAVA] Ex008 BubbleSort - 정렬 CODE/JAVA 기초2015.05.19 08:46

public class  BubbleSortMain

{

public static void main(String[] args

{

int [] a={5,6,3,7,4,8,2,9};

BubbleSort.print(a);

BubbleSort bubble=new BubbleSort();

int [] b=bubble.bbsortinc(a);

BubbleSort.print(b);

}

}

class  BubbleSort{

public  int[] bbsortinc(int [] a){

int n=a.length;

if(n<=0){

return new int[0];

}

for(int i=0;i<n-1;i++){

for(int j=0;j<n-1-i;j++){

if(a[j]>a[j+1]){  

int temp=a[j+1];  //스왑

a[j+1]=a[j];

a[j]=temp;

}

}

}

return a;

}

public static void print(int [] a){

int count=a.length;

System.out.print("["+a[0]+", ");

for(int i=1;i<count-1;i++){

System.out.print(a[i]+", ");

}

System.out.println(a[count-1]+"]");

}

public  int[] bbsortdec(int [] a){

int n=a.length;

if(n<=0){

return new int[0];

}

for(int i=0;i<n-1;i++){

for(int j=0;j<n-1-i;j++){

if(a[j]<a[j+1]){  

int temp=a[j+1];  //스왑

a[j+1]=a[j];

a[j]=temp;

}

}

}

return a;

}

}



'CODE > JAVA 기초' 카테고리의 다른 글

[JAVA] Ex010 로또번호 출력하기  (0) 2015.05.19
[JAVA] Ex009 ReverseArray - 정렬  (0) 2015.05.19
[JAVA] Ex008 BubbleSort - 정렬  (0) 2015.05.19
[JAVA] Ex007 Calendar, Date 정보출력  (0) 2015.05.19
[JAVA] Ex006 다중for문, if 예제  (0) 2015.05.19
[JAVA] Ex005 Math method  (0) 2015.05.19
Posted by 레이칸트

public static void main(String[] args) {

Date d1=new Date();//오늘

System.out.println(d1.toString());

Date d2=new Date(System.currentTimeMillis());//오늘

System.out.println(d2.toString());

System.out.println(d1.compareTo(d2));//d1과 d2 비교 

System.out.println(d1.after(d2));// is d1 afterday?

System.out.println(d1.before(d2));// is d2 beforeday?

long longDays=d1.getTime();//1970.1.1~

Date d3=(Date)d1.clone();

d3.setTime(longDays+1000*60*60*24*3);//3일후

System.out.println(d3);//d3에 대한 deep copy 형식

System.out.println(d1);//

Calendar cal=Calendar.getInstance();//오늘

System.out.println(cal.toString());

System.out.println(cal.getTime());//Date 리턴

System.out.println(cal.getTime().getTime());//1970.1.1~

System.out.println(cal.get(Calendar.YEAR));//현재시간

System.out.println(cal.get(Calendar.MONTH));//현재월

System.out.println(cal.get(Calendar.DATE)+1);//현재날짜

System.out.println(cal.get(Calendar.HOUR));//현재시간

System.out.println(new Date(cal.getTime().getTime()));//오늘

}

Posted by 레이칸트
2015.05.19 08:12

[JAVA] Ex006 다중for문, if 예제 CODE/JAVA 기초2015.05.19 08:12

/*

* 2g, 3g, 5g의 돌이 각각 10개씩 있다. 

* 이 돌들의 조합으로 71g을 만들려고 한다. 

*/

public class Dol2g3g5g {

public static void main(String[] args) {

for(int five=0;five<11;five++){

for(int three=0;three<11;three++){

for(int two=0;two<11;two++){

if(5*five+3*three+2*two==71){

String str=String.format("5g: %d개, 3g: %d개, 2g: %d개%n",five,three,two);

System.out.printf(str);

}

}

}

}

}

}

Posted by 레이칸트