javascript - jqPlot和命名系列

标签 javascript jquery jqplot

我正在试用 jqPlot,但我不知道如何设置不同系列的名称。

目前,我的代码如下所示:

$(document).ready(function () {
    $.jqplot('chartdiv', [
        [[201201, 10], [201202, 20], [201203, 30], [201204, 60], [201205, 40]], 
        [[201201, 5], [201202, 10], [201203, 7], [201204, 8], [201205, 11]]
    ], {
        axes: {
            xaxis: {
                label: "Year/month",
                pad: 0
            },
            yaxis: {
                label: "Amount (Kr)"
            }
        },
        legend: {
            show: true
        }
    });
});

它呈现图表,但系列被命名为系列 1 和系列 2。有什么方法可以控制系列的命名吗?

最佳答案

要为系列命名,您必须设置“系列”下的“标签”。 Please see here for documentation.

Example code presenting its use is available here.

关于javascript - jqPlot和命名系列,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10895957/

相关文章:

javascript - 在 dragover 上更改 div 的背景

javascript - 概述网页上的任何内容 block

jQuery | .css()多个参数 '-'错误

javascript - JQuery 顺序执行函数

jquery - 我正在尝试访问一个类(class),但我无法访问

javascript - 将随机生成的绝对 div 定位为网格的最佳方法?

javascript - 这是有效的 js 语法吗?

javascript - jqPlot:可以动态添加新系列吗?

javascript - jqPlot 从线到点

html - jqplot 图形背景在 ie8 中似乎是黑色的