當前位置:首頁 » 股票漲停 » d3js適合做股票軟體

d3js適合做股票軟體

發布時間: 2021-04-19 08:51:06

1. c#winform中能做出類似於d3js的效果的動態風向圖嗎

可以http://blog.csdn.net/xianfajushi/article/details/9469353

2. 數據可視化前端(D3.js)有前途嗎

前途肯定有的,但是得看公司,不是每個公司都會大范圍用到這些圖形圖表庫

3. 如何使用d3.js製作可視化圖表

D3是目前最流行的JavaScript可視化圖表庫之一,D3的圖表類型非常豐富,並且支持SVG格式,因此應用十分廣泛,也有很多圖表插件基於D3開發,比如MetricsGraphics.js,在D3上構建的數據圖表非常強大。


D3的特點

允許綁定任意數據到DOM,將數據驅動轉換應用到Document中。

不僅可以創建精美的HTML表格,而且可以繪制折線圖、柱形圖和餅圖等數據圖表。

支持SVG,在Web頁面上渲染毫無壓力。

回到頂部

D3的使用方法

關於D3的具體用法,可以看D3圖形庫API參考這篇文章。本文主要對介紹一些經典圖表的實現效果及代碼。



<!DOCTYPEhtml>
<metacharset="utf-8">
<style>

svg{
font:10pxsans-serif;
}

.y.axispath{
display:none;
}

.y.axisline{
stroke:#fff;
stroke-opacity:.2;
shape-rendering:crispEdges;
}

.y.axis.zeroline{
stroke:#000;
stroke-opacity:1;
}

.title{
font:30078pxHelveticaNeue;
fill:#666;
}

.birthyear,
.age{
text-anchor:middle;
}

.birthyear{
fill:#fff;
}

rect{
fill-opacity:.6;
fill:#e377c2;
}

rect:first-child{
fill:#1f77b4;
}

</style>
<body>
<scriptsrc="http://d3js.org/d3.v3.min.js"></script>
<script>

varmargin={top:20,right:40,bottom:30,left:20},
width=960-margin.left-margin.right,
height=500-margin.top-margin.bottom,
barWidth=Math.floor(width/19)-1;

varx=d3.scale.linear()
.range([barWidth/2,width-barWidth/2]);

vary=d3.scale.linear()
.range([height,0]);

varyAxis=d3.svg.axis()
.scale(y)
.orient("right")
.tickSize(-width)
.tickFormat(function(d){returnMath.round(d/1e6)+"M";});

//AnSVGelementwithabottom-rightorigin.
varsvg=d3.select("body").append("svg")
.attr("width",width+margin.left+margin.right)
.attr("height",height+margin.top+margin.bottom)
.append("g")
.attr("transform","translate("+margin.left+","+margin.top+")");

//.
varbirthyears=svg.append("g")
.attr("class","birthyears");

//Alabelforthecurrentyear.
vartitle=svg.append("text")
.attr("class","title")
.attr("dy",".71em")
.text(2000);

d3.csv("population.csv",function(error,data){

//Convertstringstonumbers.
data.forEach(function(d){
d.people=+d.people;
d.year=+d.year;
d.age=+d.age;
});

//.
varage1=d3.max(data,function(d){returnd.age;}),
year0=d3.min(data,function(d){returnd.year;}),
year1=d3.max(data,function(d){returnd.year;}),
year=year1;

//Updatethescaledomains.
x.domain([year1-age1,year1]);
y.domain([0,d3.max(data,function(d){returnd.people;})]);

//[male,female].
data=d3.nest()
.key(function(d){returnd.year;})
.key(function(d){returnd.year-d.age;})
.rollup(function(v){returnv.map(function(d){returnd.people;});})
.map(data);

//.
svg.append("g")
.attr("class","yaxis")
.attr("transform","translate("+width+",0)")
.call(yAxis)
.selectAll("g")
.filter(function(value){return!value;})
.classed("zero",true);

//(sothatnoenterorexitisrequired).
varbirthyear=birthyears.selectAll(".birthyear")
.data(d3.range(year0-age1,year1+1,5))
.enter().append("g")
.attr("class","birthyear")
.attr("transform",function(birthyear){return"translate("+x(birthyear)+",0)";});

birthyear.selectAll("rect")
.data(function(birthyear){returndata[year][birthyear]||[0,0];})
.enter().append("rect")
.attr("x",-barWidth/2)
.attr("width",barWidth)
.attr("y",y)
.attr("height",function(value){returnheight-y(value);});

//Addlabelstoshowbirthyear.
birthyear.append("text")
.attr("y",height-4)
.text(function(birthyear){returnbirthyear;});

//Addlabelstoshowage(separate;notanimated).
svg.selectAll(".age")
.data(d3.range(0,age1+1,5))
.enter().append("text")
.attr("class","age")
.attr("x",function(age){returnx(year-age);})
.attr("y",height+4)
.attr("dy",".71em")
.text(function(age){returnage;});

//.
window.focus();
d3.select(window).on("keydown",function(){
switch(d3.event.keyCode){
case37:year=Math.max(year0,year-10);break;
case39:year=Math.min(year1,year+10);break;
}
update();
});

functionupdate(){
if(!(yearindata))return;
title.text(year);

birthyears.transition()
.ration(750)
.attr("transform","translate("+(x(year1)-x(year))+",0)");

birthyear.selectAll("rect")
.data(function(birthyear){returndata[year][birthyear]||[0,0];})
.transition()
.ration(750)
.attr("y",y)
.attr("height",function(value){returnheight-y(value);});
}
});

4. cytoscape.js 和d3.js哪個好用

d3.js 好用
cytoscape.js
只是網路圖

5. 用作數據可視化,echarts 和 D3.js哪個好

這兩個都沒用過,我一般都是用finebi來分析我的數據,最後在Dashboard裡面查看可視化的圖表結果,而且可以很方便地切換維度,聯動鑽取等

6. webgl、three.js、D3.js這三者是什麼關系

webgl、three.js、D3.js這三者的關系是:

1、D3.js是一個數據可視化的庫,看看他們的DEMO就可以知道,技術基礎是SVG。兼容性是IE9+。

2、webgl是HTML5中提出的新技術,是一種3D繪圖標准,這種繪圖技術標准允許把JavaScript和OpenGL ES 2.0結合在一起,關於它的教程可以看看hiwebgl。目前兼容性堪憂

3、three.js是以webgl為基礎的庫,封裝了一些3D渲染需求中重要的工具方法與渲染循環。它的教程同樣可以在hiwebgl裡面找到。

4、three.js之於webgl,類似於windows版本的虛幻引擎之於D3D。當然,虛幻引擎的能力范圍比three.js大得多。d3.js跟上面兩者沒有關系。

7. 怎麼用d3.js 製作3d效果

1,建立一個擴展名為js的文件,比如myjs.js
2,復制和中間的js代碼到這個文件中,然後保存!
3,在你的html頁面中加入js引用代碼:
注意:在引用js一定要注意路徑問題,你可以在你的網站根目錄中建一個文件夾,比如:js然後把js文件復制進行

8. 如何使用d3.js 看到用D3做的酷圖,很想學,有沒有高手教一下

去官網安裝個攝像頭的驅動 活著直接網路暗轉個萬能驅動啊 ...1、 確認驅動安裝正確 2、 在 我的電腦 裡面有沒有視頻或者照相機的標志,能否使用 3、 ...

9. d3.js可以做什麼

d3js能夠將資料製作成各種圖表,將資料視覺化,有興趣的話可以去github上d3js的repository看更多範例demo.
舉例來說,你如果想在地圖上隨著人口分布,變換地圖區塊顏色,d3js就可以辦到.

熱點內容
權益金融是什麼 發布:2025-03-10 20:50:10 瀏覽:116
基金虧損怎麼算 發布:2025-03-10 20:48:28 瀏覽:417
中國銀行股票中長線投資 發布:2025-03-10 20:47:13 瀏覽:240
融炎上海金融信息有限公司怎麼樣 發布:2025-03-10 20:46:59 瀏覽:562
新華壹諾基金怎麼看 發布:2025-03-10 20:39:39 瀏覽:335
華泰如何查詢股票歷史成交 發布:2025-03-10 20:38:04 瀏覽:175
長城汽車股票歷史最低價 發布:2025-03-10 20:06:34 瀏覽:853
如何更改基金的風險承受力 發布:2025-03-10 19:29:39 瀏覽:966
天加環境科技有限公司股票代碼 發布:2025-03-10 19:25:40 瀏覽:972
600807股票歷史數據 發布:2025-03-10 19:08:07 瀏覽:498