차트 g.bar.js는 축을 그릴 수있는 옵션이 없습니다. 당신이 내부 g.line.js를 보면, 그러나, 축립니다 98-117 (현재) 라인 주위에 코드 블록이있다 :
var allx = Array.prototype.concat.apply([], valuesx),
ally = Array.prototype.concat.apply([], valuesy),
xdim = chartinst.snapEnds(Math.min.apply(Math, allx), Math.max.apply(Math, allx), valuesx[0].length - 1),
minx = xdim.from,
maxx = xdim.to,
ydim = chartinst.snapEnds(Math.min.apply(Math, ally), Math.max.apply(Math, ally), valuesy[0].length - 1),
miny = ydim.from,
maxy = ydim.to,
kx = (width - gutter * 2)/((maxx - minx) || 1),
ky = (height - gutter * 2)/((maxy - miny) || 1);
var axis = paper.set();
if (opts.axis) {
var ax = (opts.axis + "").split(/[,\s]+/);
+ax[0] && axis.push(chartinst.axis(x + gutter, y + gutter, width - 2 * gutter, minx, maxx, opts.axisxstep || Math.floor((width - 2 * gutter)/20), 2, paper));
+ax[1] && axis.push(chartinst.axis(x + width - gutter, y + height - gutter, height - 2 * gutter, miny, maxy, opts.axisystep || Math.floor((height - 2 * gutter)/20), 3, paper));
+ax[2] && axis.push(chartinst.axis(x + gutter, y + height - gutter, width - 2 * gutter, minx, maxx, opts.axisxstep || Math.floor((width - 2 * gutter)/20), 0, paper));
+ax[3] && axis.push(chartinst.axis(x + gutter, y + height - gutter, height - 2 * gutter, miny, maxy, opts.axisystep || Math.floor((height - 2 * gutter)/20), 1, paper));
}
이 효과적으로 g에 VBarchart을 복사 함수에 붙여 넣을 수 있습니다 .bar.js를 사용하여 축 옵션을 제공합니다. x와 y 위치에 대한 약간의 조정이 필요하며, maxy는 스케일링을 올바르게하기 위해 opts.total로 설정해야합니다. 그렇습니다. 약간 그렇습니다.하지만 제대로 작동합니다.
팁 stephband 주셔서 감사! 그것 또는 정보의 부족에 의해 의아해하고 대신 highcharts를 사용하여 전환했다, 너무 잘 작동합니다! – jamen
@stephband : 조금 조정 해 주시겠습니까? 언급 한 파일에서 복사하려고했습니다. 하지만 일하고 있지 않습니다 .. 도와주세요. 감사합니다 –
@stephband : 또는 어떤 데모하시기 바랍니다? –