1
jqplot을 사용하여 차트를 그리는 중입니다. 하나의 차트에서 2 개의 계열을 가지지 만 그 값은 매우 다르며 하나는 약 2000이고 다른 하나는 1,000,000을 넘을 수도 있습니다.jqplot - 하나의 차트에서 좋은 값을 얻기 위해 매우 다른 값의 2 라인을 갖는 방법?
어떻게 지정할 수 있습니까? 하나의 차트에 잘 표시 될 수있는 방식으로 2 y 축이있는 2 개의 선이 있습니까?
현재 나는 한 줄의 줄이 바닥에 단순한 줄을 보았습니까? 내 코드는 다음과 같습니다.
$.ajax({url: myurl,
success:function(json){
$.jqplot.config.enablePlugins = true;
var data = eval(json);
var ssList = data[0];
var sdList = data[1];
var dataOption = [ssList];
if(sdList.length > 0){
dataOption[1] = sdList;
}
var seriesOption = {lineWidth:2, markerOptions:{style:'square'}};
if(sdList.length > 0){
seriesOption[1] = {renderer:$.jqplot.OHLCRenderer, rendererOptions:{candleStick:true}};
}
var axisOption ={};
axisOption.xaxis = {
renderer:$.jqplot.DateAxisRenderer,
tickOptions:{formatString:'%Y-%m-%d'}
};
axisOption.yaxis = {autoscale:true,label: "time"};
if(sdList.length > 0){
axisOption.y2axis = {autoscale:true,label: "index"};
}
var plot2 = $.jqplot('chart2', dataOption, {
title:'水木社区股票版人气指数',
axes:axisOption,
series:seriesOption,
highlighter:{
showMarker:false,
tooltipAxes: 'xy',
yvalues: 1,
formatString:'<table class="jqplot-highlighter"><tr><td>日期:%s</td></tr><tr><td>人气指数:%s</td></tr></table>'
}
});
}});
대수 눈금을 사용하면 같은 그래프에서 크기 순서가 다른 숫자를 표시 할 수 있습니다. –
글쎄, 당신이 말한 방식은 숫자를 전처리하는 것과 비슷합니다 ... 내가 더 관심있는 것은 2 개의 y 축을 따로 가질 수있는 방법입니까? 고마워. – hetaoblog