admin/view/javascript/jquery/flot/API.md

(开头部分) 51KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

# Flot Reference #

Consider a call to the plot function:

```js
var plot = $.plot(placeholder, data, options)
```

The placeholder is a jQuery object or DOM element or jQuery expression
that the plot will be put into. This placeholder needs to have its
width and height set as explained in the [README](README.md) (go read that now if
you haven't, it's short). The plot will modify some properties of the
placeholder so it's recommended you simply pass in a div that you
don't use for anything else. Make sure you check any fancy styling
you apply to the div, e.g. background images have been reported to be a
problem on IE 7.

The plot function can also be used as a jQuery chainable property.  This form
naturally can't return the plot object directly, but you can still access it
via the 'plot' data key, like this:

```js
var plot = $("#placeholder").plot(data, options).data("plot");
```

The format of the data is documented below, as is the available
options. The plot object returned from the call has some methods you
can call. These are documented separately below.

Note that in general Flot gives no guarantees if you change any of the
objects you pass in to the plot function or get out of it since
they're not necessarily deep-copied.


## Data Format ##

The data is an array of data series:

```js
[ series1, series2, ... ]
```

A series can either be raw data or an object with properties. The raw
data format is an array of points:

```js
[ [x1, y1], [x2, y2], ... ]
```

E.g.

```js
[ [1, 3], [2, 14.01], [3.5, 3.14] ]
```

Note that to simplify the internal logic in Flot both the x and y
values must be numbers (even if specifying time series, see below for
how to do this). This is a common problem because you might retrieve
data from the database and serialize them directly to JSON without
noticing the wrong type. If you're getting mysterious errors, double
后面还有 1404 行代码,购买后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 积分/个。 规则说明

AI 解读

登录后可用,每次 10 积分,解读结果公开显示在下面。

还没有人解读过这个文件。