Commit c94899cf authored by Evgeny's avatar Evgeny

Partly fix bug with sub-charts in nodejs

parent eab844af
......@@ -4750,8 +4750,8 @@
if(sync){
apply();
} else {
$$.buffer.onlastfinish("tune-axis", apply);
$$.buffer.onlastfinish("cached-redraw", function(){});
$$.buffer.onlastfinish("tune-axis" + $$.config.isSub, apply);
$$.buffer.onlastfinish("cached-redraw" + $$.config.isSub, function(){});
}
};
......@@ -4806,7 +4806,7 @@
axis = $$.getAxisData(min, max, true);
break;
default:
throw new Error("Unsupported type for axis");
throw new Error("Unsupported type for axis " + type);
}
return axis;
};
......@@ -5401,7 +5401,7 @@
.style("opacity", $$.hasType('donut') || $$.hasType('gauge') ? 1 : 0);
if($$.config.hasSubs || $$.config.isSub){
$$.buffer.onlastfinish("draw-lines", function(){
$$.buffer.onlastfinish("draw-lines"+$$.config.isSub, function(){
$$.ed3Internal.redrawLinesOnBoth();
$$.ed3Internal.redrawLinesOnBoth();
});
......@@ -6143,8 +6143,8 @@
$$.pushCallback(callback);
if($$.config.shouldCache){
if(!$$.buffer.has("tune-axis")){
$$.buffer.onlastfinish("cached-redraw",
if(!$$.buffer.has("tune-axis" + $$.config.isSub)){
$$.buffer.onlastfinish("cached-redraw" + $$.config.isSub,
function(){
$$.resolveDraw(options);
}
......@@ -6492,7 +6492,7 @@
$$.ed3Config.subBox = $$.getBox($$.main.selectAll(".sub-chart .c3-chart-bars"));
if(!$$.ed3Config.coords[order]) return;
if(isUndefined($$.ed3Config.coords[order])) return;
var coords = $$.ed3Config.coords[order];
......@@ -6526,10 +6526,6 @@
y1 = center.y + $$.radius * (small ? Math.cos($$.config.angle) : 1);
}
if(!$$.ed3Config.coords){
$$.ed3Config.coords = {};
}
if(!$$.ed3Config.subBox) return;
x2 = $$.ed3Config.subBox.x + $$.getCurrentWidth();
......@@ -6564,7 +6560,7 @@
if(isSub($$.config.ed3Type)){
if(!$$.ed3Config.coords) return;
if(!$$.ed3Config.coords[order]) return;
var coords = $$.ed3Config.coords[order];
......@@ -6600,10 +6596,6 @@
y2 = center.y + $$.radius;
}
if(!$$.ed3Config.coords){
$$.ed3Config.coords = {};
}
if(small){
var subCenter = {
x: center.x + $$.getCurrentWidth(),
......
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -305,7 +305,7 @@ c3_chart_internal_fn.redrawArc = function (duration, durationForExit, withTransf
.style("opacity", $$.hasType('donut') || $$.hasType('gauge') ? 1 : 0);
if($$.config.hasSubs || $$.config.isSub){
$$.buffer.onlastfinish("draw-lines", function(){
$$.buffer.onlastfinish("draw-lines"+$$.config.isSub, function(){
$$.ed3Internal.redrawLinesOnBoth();
$$.ed3Internal.redrawLinesOnBoth();
});
......
......@@ -411,8 +411,8 @@ c3_chart_internal_fn.tuneAxis = function(sync, callback){
if(sync){
apply();
} else {
$$.buffer.onlastfinish("tune-axis", apply);
$$.buffer.onlastfinish("cached-redraw", function(){});
$$.buffer.onlastfinish("tune-axis" + $$.config.isSub, apply);
$$.buffer.onlastfinish("cached-redraw" + $$.config.isSub, function(){});
}
};
......@@ -467,7 +467,7 @@ c3_chart_internal_fn.getAbscissa = function(type, min, max) {
axis = $$.getAxisData(min, max, true);
break;
default:
throw new Error("Unsupported type for axis");
throw new Error("Unsupported type for axis " + type);
}
return axis;
};
......
......@@ -39,8 +39,8 @@ c3.chart.internal.fn.cachedRedraw = function(options, callback){
$$.pushCallback(callback);
if($$.config.shouldCache){
if(!$$.buffer.has("tune-axis")){
$$.buffer.onlastfinish("cached-redraw",
if(!$$.buffer.has("tune-axis" + $$.config.isSub)){
$$.buffer.onlastfinish("cached-redraw" + $$.config.isSub,
function(){
$$.resolveDraw(options);
}
......
......@@ -35,7 +35,7 @@ c3.chart.internal.fn.getLineCoordsForBar = function(center, order){
$$.ed3Config.subBox = $$.getBox($$.main.selectAll(".sub-chart .c3-chart-bars"));
if(!$$.ed3Config.coords[order]) return;
if(isUndefined($$.ed3Config.coords[order])) return;
var coords = $$.ed3Config.coords[order];
......@@ -69,10 +69,6 @@ c3.chart.internal.fn.getLineCoordsForBar = function(center, order){
y1 = center.y + $$.radius * (small ? Math.cos($$.config.angle) : 1);
}
if(!$$.ed3Config.coords){
$$.ed3Config.coords = {};
}
if(!$$.ed3Config.subBox) return;
x2 = $$.ed3Config.subBox.x + $$.getCurrentWidth();
......@@ -107,7 +103,7 @@ c3.chart.internal.fn.getLineCoordsForPie = function(center, order){
if(isSub($$.config.ed3Type)){
if(!$$.ed3Config.coords) return;
if(!$$.ed3Config.coords[order]) return;
var coords = $$.ed3Config.coords[order];
......@@ -143,10 +139,6 @@ c3.chart.internal.fn.getLineCoordsForPie = function(center, order){
y2 = center.y + $$.radius;
}
if(!$$.ed3Config.coords){
$$.ed3Config.coords = {};
}
if(small){
var subCenter = {
x: center.x + $$.getCurrentWidth(),
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment