Jquery jqplot&;中钢筋和Y轴的不同比例;条线图
在使用jqplot时,我必须创建带有2个系列的条形图,每个系列由3个不同的值(类别)组成。问题是第一个值约为50000,另外两个值约为(-3)-(3)。因此,当在一张图表上绘制它时,只有两个条形图可见。 我曾考虑过在y轴上使用LogRenderer,但它似乎根本不起作用。最好的选择是为每个组(类别)设置不同的y轴,但是在搜索之后,我没有找到任何方法。(重要的是必须只有2个系列-这是日期比较,因此无法更改系列中的内容) 有人知道如何做到这一点吗?或者有没有其他方法可以将所有数据显示在一张图表上(主要使用条形图) JS摆弄我的工作示例: 标题:Jquery jqplot&;中钢筋和Y轴的不同比例;条线图,jquery,jqplot,bar-chart,Jquery,Jqplot,Bar Chart,在使用jqplot时,我必须创建带有2个系列的条形图,每个系列由3个不同的值(类别)组成。问题是第一个值约为50000,另外两个值约为(-3)-(3)。因此,当在一张图表上绘制它时,只有两个条形图可见。 我曾考虑过在y轴上使用LogRenderer,但它似乎根本不起作用。最好的选择是为每个组(类别)设置不同的y轴,但是在搜索之后,我没有找到任何方法。(重要的是必须只有2个系列-这是日期比较,因此无法更改系列中的内容) 有人知道如何做到这一点吗?或者有没有其他方法可以将所有数据显示在一张图表上(主
<script type="text/javascript" src="https://bitbucket.org/armata007/jqplot/downloads/jquery.jqplot.min.js"></script>
<script type="text/javascript" src="https://bitbucket.org/armata007/jqplot/downloads/jqplot.barRenderer.min.js"></script>
<script type="text/javascript" src="https://bitbucket.org/armata007/jqplot/downloads/jqplot.canvasAxisTickRenderer.min.js"></script>
<script type="text/javascript" src="https://bitbucket.org/armata007/jqplot/downloads/jqplot.categoryAxisRenderer.min.js"></script>
<script type="text/javascript" src="https://bitbucket.org/armata007/jqplot/downloads/jqplot.enhancedLegendRenderer.min.js"></script>
<script type="text/javascript" src="https://bitbucket.org/armata007/jqplot/downloads/jqplot.logAxisRenderer.min.js"></script>
<div id="plot"></div>
结果:
谢谢我自己一直在玩这个游戏,希望这能节省一些时间 您需要为传入函数的每个序列定义一个单独的序列 (在您的案例中为s1和s2)。定义它们的顺序对应于传递它们的顺序
series: [
{
label: 'January 2012',
},
{
yaxis:'y2axis',
label: 'February 2012'
}
],
...
axes: {
xaxis: {
},
yaxis: {
label: "y axis 1"
},
y2axis: {
label: 'y axis 2',
}
}
series: [
{
label: 'January 2012',
},
{
yaxis:'y2axis',
label: 'February 2012'
}
],
...
axes: {
xaxis: {
},
yaxis: {
label: "y axis 1"
},
y2axis: {
label: 'y axis 2',
}
}