gRaphael折线图:用JSON数据填充弹出标签而不是x&y坐标
gRaphael Line Chart: JSON Data to Populate Popup Tags Instead of x & y Coordinates?
var times=[["1:30pm","2:30pm"],["3:30pm","5:30am"],【"12:30pm"、"2:30ppm"】,【"9:30am"、"2:00pm"、"4:30pm"】、【"3:30pm"、"5:30pm"】、["10:30am","12:30pm"],[];我有一个拉斐尔折线图,基于其中一个滚动弹出标签的例子。当前,标记由Y轴的数据填充。X=一周中的某一天,Y="安全分数",JSON数据是每天报告的事件次数。
我似乎找不到任何关于如何调用第三个数据集来填充标记的文档,而且我似乎无法在不破坏代码的情况下使用代码。有什么建议吗?
这是我的标签代码:
//tags
for (var i = 0, ii = this.y.length; i < ii; i++) {
this.tags.push(r.tag(this.x, this.y[i], this.values[i], 90, 0).insertBefore(this).attr([{ fill: "#fff"}, { fill: this.symbols[i].attr("fill") }]));
}
}, function () {
this.tags && this.tags.remove();
//end tags
});
这是我的数据:
var times = [["1:30pm", "2:30pm"], ["3:30pm", "5:30am"], ["12:30pm", "2:30pm"], ["9:30am", "2:30pm", "4:30pm"], ["3:30pm", "5:30pm"], ["10:30am", "12:30pm"], [] ];
好吧,我想通了!给你。
var times = [["1:30pm", "2:30pm"], ["3:30pm", "5:30am"], ["12:30pm", "2:30pm"], ["9:30am", "2:30pm", "4:30pm"], ["3:30pm", "5:30pm"], ["10:30am", "12:30pm"], [] ];
//tags
for (var i = 0, ii = this.y.length; i < ii; i++) {
this.tags.push(r.tag(this.x, this.y[i]-10, times[i].join("'n"), 90, 0).insertBefore(this).attr([{ fill: "#fff"}, { fill: this.symbols[i].attr("fill") }]));
}
}, function () {
this.tags && this.tags.remove();
//end tags
});
相关文章:
- EaseJS拖放;放下(动画CC)电影剪辑的鼠标坐标
- jquery点击函数select&取消选择
- Windows8应用程序(html&Javascript):从图片库(除了文件选择器)显示图像的另一种方式
- 如何在d3.js中返回路径的y坐标
- Angular js-返回一个包含类似
- 一点javascript元编程&可链接的设置器
- 在谷歌地图上获取事件的x,y坐标
- 通过JSON&比较时间
- Jquery模板,如果xx&&如果yy
- 通过ajax将坐标传递到php服务器端,并在处理后检索到javascript
- jQuery工具验证器自定义效果-添加&消除影响
- Twitter引导程序Typeahead-Id&标签
- AngularJS&JSON-从Previous&下一个对象
- 什么是&&在没有if的行中的变量之间
- 使用平移计算画布中的绝对坐标&快速移动
- 获取基于百分比或基于像素的x&y坐标来自latlng
- gRaphael折线图:用JSON数据填充弹出标签而不是x&y坐标
- 在热图上映射鼠标点击坐标以获得不同的分辨率&JS/Jquery中的屏幕大小
- JavaScript点击X&Y坐标
- 确定经度&纬度坐标是以英里和千米为单位的半径内