使用自定义边框绘制网格 [英] Flot Grid with Customised Borders

查看:137
本文介绍了使用自定义边框绘制网格的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Flot使我们能够自定义网格边框。 此处记录了以下内容:

Flot enables us customise grid borders. This is documented here with the following:

grid: {
    borderWidth: number or object with "top", "right", "bottom" and "left" properties with different widths
    borderColor: color or null or object with "top", "right", "bottom" and "left" properties with different colors
}

然而,我无法想出一个成功的工作示例。要创建一个带有白色顶部和左边框的自定义网格,我尝试了以下操作,但它不起作用:

However, I couldn't manage to come up with a successfully working example. To create a custom grid with top and left border with white color I tried the following, but it didn't work:

grid: {
    borderWidth: {top: 1, right: 0, bottom: 0, left: 1},
    borderColor: {top: "#FFF", left: "#FFF"}
}

任何人都可以提供一个有效的例子吗?

Can anyone provide a working example?

推荐答案

您使用的是哪个版本的flot? borderWidth属性不支持将对象作为0.8版之前的值。确保您使用的是最新版本(0.8.1)并再次拍摄。我注意到的另一件事是borderWidth值之后缺少逗号。应该是left:1} borderColor ...

Which version of flot are you using? The borderWidth property did not accommodate an object as the value until version 0.8. Make sure you are using the latest version (0.8.1) and give it another shot. The only other thing I notice is the missing comma after the borderWidth values. Should be "left: 1 }, borderColor..."

这篇关于使用自定义边框绘制网格的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆