【发布时间】:2015-06-09 08:24:57
【问题描述】:
我正在开发一个应用程序,我在其中使用 FlotJS 图表库来绘制图形,并且我已经打开了工具提示,以便用户可以将鼠标悬停在点上并可以告诉特定日期每个点的内容。
就像在this interactive graph example by flot 中一样,我们可以将鼠标悬停在这些点上以查看 sin 和 cos 的值。
我在我的项目中使用Smart Admin Responsive Theme,如果您导航到他们提供的图表演示,还有一个关于Flot Chart Demos的部分
如果您仔细查看排名第二的罪恶图,它与我正在做的类似。将鼠标悬停在这些点上会显示工具提示以查看 sin 的值。
我面临的问题是,如果您将鼠标悬停在最后几个点上,则会出现工具提示,但它会影响页面的响应能力,并且按说不可见。
如何解决这个问题?有什么方法可以让工具提示在页面末尾出现在鼠标指针的左侧?
编辑
选项对象
var layerOptions = {
xaxis : {
mode : "time"
},
legend : {
show : true,
noColumns : 1, // number of colums in legend table
labelFormatter : null, // fn: string -> string
labelBoxBorderColor : "#000", // border color for the little label boxes
container : null, // container (as jQuery object) to put legend in, null means default on top of graph
position : "ne", // position of default legend container within plot
margin : [0, 5], // distance from grid edge to default legend container within plot
backgroundColor : "#efefef", // null means auto-detect
backgroundOpacity : 0.4 // set to 0 to avoid background
},
tooltip : true,
tooltipOpts : {
content : "<b>%s</b> content on <b>%x</b> was <b>%y</b>",
dateFormat : "%y-%m-%d",
defaultTheme : false
},
grid : {
hoverable : true,
clickable : true
},
series: {
/*bars: {
show: true,
barWidth: 1000 * 60 * 60 * 24 * 30,
order: 1
}*/
}
};
【问题讨论】:
标签: javascript html css responsive-design flot