gpt4 book ai didi

javascript - jqplot 中具有多个 y 轴的多个系列

转载 作者:行者123 更新时间:2023-11-30 08:49:08 24 4
gpt4 key购买 nike

我正在使用 jqplot 作为我的图形模型。在这里我想要绘制 2 y 轴,时间作为 x 轴。我得到了一个用单参数折线图绘制 2 y 轴的例子。

让我解释一下我的情况,我使用的是 y1、y2 轴和带有时间戳的公共(public) x 轴。对于 y1 轴让我有 s1、s3 系列值和 y2 轴让我有 s2、s4 系列值。我想在这里绘制图表。

但在我的例子中,s1、s3、s4 引用 x 和 y1 轴绘制,s2 单独绘制 x 和 y2 轴,如何传递 y1 的系列 s1、s3,即收入和 y2 轴的 s2、s4即页面浏览量。

以这个 jsfiddle.net/yRLJF/94/为例

最佳答案

您必须为每个系列指定相关的轴:

series: [
{
lineWidth: 2,
yaxis: 'yaxis',
highlighter: { show: true}
},
{
yaxis: 'y2axis',
highlighter: { show: true}
},
{
yaxis: 'yaxis',
},
{
yaxis: 'y2axis',
}
]

请参阅工作示例 here

关于javascript - jqplot 中具有多个 y 轴的多个系列,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19378250/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com