jquery,jqplot更改选项值 [英] jquery, jqplot change option value

查看:88
本文介绍了jquery,jqplot更改选项值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

即时通讯使用jquery: http://www.jqplot.com/ 我制作了一张漂亮的图表。
我得到的唯一问题是:
当我超过300像素的图表时,我希望荧光笔工具提升为'nw',如果它的'ne'更小。

im using jquery: http://www.jqplot.com/ and i made a nice chart. the only problem i got is this: when im over 300 pixels of the chart, i want the highlighter tooltiplocation go's to 'nw' if its smaller its 'ne'.

当前选项:

  highlighter: {
       tooltipLocation: 'ne',
       useAxesFormatters: true,
   },

有人知道如何更改te位置它被渲染了吗?

does anybody know how to change te location after its rendered?

推荐答案

我认为你必须在一个变量中保存jQPlot函数的返回值:

I think you have to save the return value of jQPlot function in a variable:

targetPlot = $.jqplot(...your diagram...)

然后可以这样设置不同的选项并重新设定:

and can then set different options this way and replot:

targetPlot['legend']['location'] = "ne";
targetPlot.replot();

这篇关于jquery,jqplot更改选项值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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