十年網(wǎng)站開發(fā)經(jīng)驗(yàn) + 多家企業(yè)客戶 + 靠譜的建站團(tuán)隊(duì)
量身定制 + 運(yùn)營維護(hù)+專業(yè)推廣+無憂售后,網(wǎng)站問題一站解決
你好~~
成都創(chuàng)新互聯(lián)專注于隆陽網(wǎng)站建設(shè)服務(wù)及定制,我們擁有豐富的企業(yè)做網(wǎng)站經(jīng)驗(yàn)。 熱誠為您提供隆陽營銷型網(wǎng)站建設(shè),隆陽網(wǎng)站制作、隆陽網(wǎng)頁設(shè)計(jì)、隆陽網(wǎng)站官網(wǎng)定制、微信小程序開發(fā)服務(wù),打造隆陽網(wǎng)絡(luò)公司原創(chuàng)品牌,更為您提供隆陽網(wǎng)站排名全網(wǎng)營銷落地服務(wù)。
將?xFormat?=?d3.time.format('%A'),
改為:
xFormat?=?d3.time.format('%d'),
應(yīng)該就可以了~~
js轉(zhuǎn)換百分?jǐn)?shù)為int或者浮點(diǎn)類型;
var?str='12%';
var?num=str.replace(/([0-9.]+)%/,?function?(a,?b)?{return?+b?/?100;});
window.alert(num);
當(dāng)我們使用highcharts做這樣的圖是不是很老火,其實(shí)開始我感覺很麻煩。但是官網(wǎng)上有demo,雖然只有很小一部分?;景俣纫幌戮涂梢哉业郊尤肭€。其實(shí)就是
serese
的數(shù)據(jù),只是加入type屬性就更改成你想要的。下面那個(gè)table你可以使用table加入jquery實(shí)現(xiàn)就ok了
$(function
()
{
$('#container').highcharts({
chart:
{
type:
'column'
},
title:
{
text:
'Stacked
column
chart'
},
xAxis:
{
gridLineWidth:1,
plotOptions:
{
column:
{
pointPadding:
0.2,
pointWidth:
30
//柱子的寬度30px
}
},
//tickPixelInterval:100,
categories:
['Apples',
'Oranges',
'Pears',
'Grapes',
'Bananas']
},
yAxis:
{
tickPositions:
[0,
100,
200,
300,
400,500],//設(shè)置刻度
min:
0,
title:
{
text:
'Total
fruit
consumption'
},
stackLabels:
{
enabled:
true,
style:
{
fontWeight:
'bold',
color:
(Highcharts.theme
Highcharts.theme.textColor)
||
'gray'
}
}
},
legend:
{
align:
'right',
x:
-100,
verticalAlign:
'top',
y:
20,
floating:
true,
backgroundColor:
(Highcharts.theme
Highcharts.theme.legendBackgroundColorSolid)
||
'white',
borderColor:
'#CCC',
borderWidth:
1,
shadow:
false
},
tooltip:
{
formatter:
function()
{
return
'b'+
this.x
+'/bbr/'+
this.series.name
+':
'+
this.y
+'br/'+
'Total:
'+
this.point.stackTotal;
}
},
plotOptions:
{
column:
{
stacking:
'normal',
pointWidth:
30
,
//柱子的寬度30px
dataLabels:
{
enabled:
true,
color:
(Highcharts.theme
Highcharts.theme.dataLabelsColor)
||
'white'
}
}
},
series:
[{
color:'#F2BE20',
name:
'John',
data:
[50,
30,
40,
70,
20]
},
{
color:'#F8FB23',
name:
'Jane',
data:
[20,
20,
30,
20,
10]
},
{
color:'#E9070B',
name:
'Joe',
data:
[30,
40,
40,
20,
50]
},{type:
'line',
name:
'John',
data:[{
name:
'John',
y:
50
},
{
name:
'John',
y:
30
},
{
name:
'John',
y:
40
},{
name:
'John',
y:
70
},{
name:
'John',
y:
20
}
]},
{type:
'line',
name:
'Joe',
data:[{
name:
'Joe',
y:
30
},
{
name:
'Joe',
y:
40
},
{
name:
'Joe',
y:
40
},{
name:
'Joe',
y:
20
},{
name:
'Joe',
y:
50
}
]},
{type:
'line',
name:
'Jane',
data:[{
name:
'Jane',
y:
20
},
{
name:
'Jane',
y:
20
},
{
name:
'Jane',
y:
30
},{
name:
'Jane',
y:
20
},{
name:
'Jane',
y:
10
}
]}
]
});
});
/script
在jquery里可以直接用isNaN(),因?yàn)樗荍avaScript的類庫。是由JavaScript語言寫的。
例如:
script type="text/javascript"
$(document).ready(function(){
alert(isNaN($('#id').val()));
});
/script可以直接使用