首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >flotr2 -在折线图中悬停

flotr2 -在折线图中悬停
EN

Stack Overflow用户
提问于 2013-06-20 20:19:48
回答 1查看 1.3K关注 0票数 0

我正在使用插件"flotr2“在我的应用程序中显示折线图。

当我悬停在点上时,我必须显示一个工具提示,当我悬停在线上时,我必须显示另一个工具提示。

我在选项中的“鼠标”字段使用了“跟踪”参数。我看到还有一个叫做"trackAll“的参数。这对我不好,因为它总是显示工具提示,而不仅仅是当我在线上的时候。

下面是我的代码:

代码语言:javascript
复制
dataArray.push({
        data: createDataObject(data),
        lines: {
            fill: true,
            show: true,
            fillOpacity: 0.1
        },
        points: {
            show: true,
            fillOpacity: '0',
            radius: 2,
            lineWidth: 2
        },
        mouse: {
            data: data,
            track: true,
            position: 'n',
            relative: true,
            trackFormatter: function (obj) {                    
                return setTooltipData(data, obj);                    
            }, // => formats the values in the value box
            margin: 7, // => margin in pixels of the valuebox
            lineColor: '#FFFFFFFF', // => line color of points that are drawn when mouse comes near a value of a series
            trackDecimals: 1, // => decimals for the track values
            sensibility: 3, // => the lower this number, the more precise you have to aim to show a value //hover area 
            trackY: true, // => whether or not to track the mouse in the y axis
            radius: 2, // => radius of the track point
            lineWidth: 2,
            fillColor: null, // => color to fill our select bar with only applies to bar and similar graphs (only bars for now)
            fillOpacity: 1 // => opacity of the fill color, set to 1 for a solid fill, 0 hides the fill 
        }
    });
EN

回答 1

Stack Overflow用户

发布于 2013-12-12 12:32:11

尝试将"track:!0,trackAll:!1“设置为鼠标。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/17213501

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档