gRaphael弹出位置

时间:2012-11-14 09:04:02

标签: javascript raphael graphael

从我所看到的情况来看,gRaphael只支持4个位置来放置弹出窗口,updownleftright,通常这已经足够了,但是我的线图有限的空间,因此弹出窗口在SVG内部切断。我的问题是,如何将弹出窗口设置为up right(右上角),up left(左上角),down right(右下角)或down left(左下角)位置?

2 个答案:

答案 0 :(得分:0)

如何自定义工具提示,创建一个简单的div并将其附加到您的图表容器中,就像我在饼图中所做的那样?

Interactive Pie Chart with Tooltip,这样你可以控制一切......

答案 1 :(得分:0)

我最终使用qTip,就像这样......

//show the tooltip
showTip(column.node,column.symbols[0].node,"label",tailPos,tipPos);

function showTip(selector,target,content,tailPosition,tipPosition)
{
    $(selector).qtip({
        content: content,
        position: {
            my: tailPosition,   //tip tail position
            at: tipPosition,    //tip body position
            target: $(target)   //position the tip at this element
        },
        show: {
            ready: true //show popup
        },
        style: {
            classes: 'ui-tooltip-rounded ui-tooltip-dark'
        }

    });
}

工作得很好。 :)