如何在ZingChart为集装箱制作边框

时间:2015-08-07 21:31:59

标签: php html css charts zingchart

如何在ZingChart中围绕图表和标题栏创建边框。我尝试使用plotarea边框,但这是在图表周围而不是完整的图表。我想要黑色边框和标题,但我只能像这张图片一样制作红色边框。

enter image description here

这是代码

array = [1, 2, 3, 4]
array.map! do |number|
    number == 3 ? "blue" : number
end

}

1 个答案:

答案 0 :(得分:4)

通过使用不同对象的特定的边界属性,可以实现这种外观。在这种情况下,设置图表右侧和左侧的边框以及标题的底部。

这是一个示例,展示了这种方法的实际应用,以及您在自己的代码中使用的关键部分。



var myConfig = {
 	type: "bar",
 	borderRight: "6px solid #000",
 	borderLeft: "6px solid #000",
 	borderBottom: "6px solid #000",
 	title: {
 	  text: "My Title",
 	  height: 40,
 	  borderBottom: "6px solid #000" //needs to be added to title or will be hidden underneath
 	},
	series : [
		{
			values : [35,42,67,89,25,34,67,85]
		}
	]
};
 
zingchart.render({ 
	id : 'myChart', 
	data : myConfig, 
	height: 400, 
	width: 600 
});

<html>
	<head>
		<script src= 'https://cdn.zingchart.com/zingchart.min.js'></script>
		<script> zingchart.MODULESDIR = 'https://cdn.zingchart.com/modules/';
		ZC.LICENSE = ['569d52cefae586f634c54f86dc99e6a9','ee6b7db5b51705a13dc2339db3edaf6d'];</script>
	</head>
	<body>
		<div id='myChart'></div>
	</body>
</html>
&#13;
&#13;
&#13;

我是ZingChart团队的成员,所以如果您需要进一步澄清,或者这不是您想要的,请告诉我。

相关问题