2015-12-08 105 views
4

是否可以在zingchart中繪製邊框線?如何設置Zingchart線條邊框?

我有一個

"type" : "line", 
"values"  : [something], 
"line-color": "#somecolor", 

但加入"border-color" : "#something""border-width" : 3px沒有做到這一點。

我試過了文檔,但是我還沒有找到任何相關的東西,除了酒吧系列類型。忘了說,我在一個混合型圖表(酒吧+行),我可以設置邊界爲「酒吧」類型的系列,但不是「線」類型。

回答

4

ZingChart的繪圖引擎模仿了很多如何繪製SVG,因此線條本身沒有邊框。然而,在真正的SVG方式中,我們有一個名爲top-state的屬性,允許用戶複製一個形狀,以放置在現有形狀的頂部。

要模擬線條邊框,我們可以使頂部線條寬度的大小比線條寬度略薄。

不要猶豫,伸手如果您需要任何進一步的幫助 - 我是ZingChart隊

var myConfig = { 
 
    \t type: "mixed", 
 
\t series : [ 
 
\t \t { 
 
\t \t type : 'bar', 
 
\t \t \t values : [35,42,67,89,25,34,67,85] 
 
\t \t }, 
 
\t \t { 
 
\t \t type : 'line', 
 
\t \t \t values : [35,42,67,89,25,34,67,85], 
 
\t \t \t lineWidth : "6px", 
 
\t \t \t topState : { 
 
\t \t \t lineWidth : "2px", 
 
\t \t \t lineColor : "pink" 
 
\t \t \t } 
 
\t \t } 
 
\t ] 
 
}; 
 

 
zingchart.render({ 
 
\t id : 'myChart', 
 
\t data : myConfig, 
 
\t height: 400, 
 
\t width: 600 
 
});
<!DOCTYPE html> 
 
<html> 
 
\t <head> 
 
\t \t <script src= "https://cdn.zingchart.com/zingchart.min.js"></script> 
 
\t </head> 
 
\t <body> 
 
\t \t <div id='myChart'></div> 
 
\t </body> 
 
</html>

的一部分