Commit c94899cf authored by Evgeny's avatar Evgeny

Partly fix bug with sub-charts in nodejs

parent eab844af
...@@ -4750,8 +4750,8 @@ ...@@ -4750,8 +4750,8 @@
if(sync){ if(sync){
apply(); apply();
} else { } else {
$$.buffer.onlastfinish("tune-axis", apply); $$.buffer.onlastfinish("tune-axis" + $$.config.isSub, apply);
$$.buffer.onlastfinish("cached-redraw", function(){}); $$.buffer.onlastfinish("cached-redraw" + $$.config.isSub, function(){});
} }
}; };
...@@ -4806,7 +4806,7 @@ ...@@ -4806,7 +4806,7 @@
axis = $$.getAxisData(min, max, true); axis = $$.getAxisData(min, max, true);
break; break;
default: default:
throw new Error("Unsupported type for axis"); throw new Error("Unsupported type for axis " + type);
} }
return axis; return axis;
}; };
...@@ -5401,7 +5401,7 @@ ...@@ -5401,7 +5401,7 @@
.style("opacity", $$.hasType('donut') || $$.hasType('gauge') ? 1 : 0); .style("opacity", $$.hasType('donut') || $$.hasType('gauge') ? 1 : 0);
if($$.config.hasSubs || $$.config.isSub){ if($$.config.hasSubs || $$.config.isSub){
$$.buffer.onlastfinish("draw-lines", function(){ $$.buffer.onlastfinish("draw-lines"+$$.config.isSub, function(){
$$.ed3Internal.redrawLinesOnBoth(); $$.ed3Internal.redrawLinesOnBoth();
$$.ed3Internal.redrawLinesOnBoth(); $$.ed3Internal.redrawLinesOnBoth();
}); });
...@@ -6143,8 +6143,8 @@ ...@@ -6143,8 +6143,8 @@
$$.pushCallback(callback); $$.pushCallback(callback);
if($$.config.shouldCache){ if($$.config.shouldCache){
if(!$$.buffer.has("tune-axis")){ if(!$$.buffer.has("tune-axis" + $$.config.isSub)){
$$.buffer.onlastfinish("cached-redraw", $$.buffer.onlastfinish("cached-redraw" + $$.config.isSub,
function(){ function(){
$$.resolveDraw(options); $$.resolveDraw(options);
} }
...@@ -6492,7 +6492,7 @@ ...@@ -6492,7 +6492,7 @@
$$.ed3Config.subBox = $$.getBox($$.main.selectAll(".sub-chart .c3-chart-bars")); $$.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]; var coords = $$.ed3Config.coords[order];
...@@ -6526,10 +6526,6 @@ ...@@ -6526,10 +6526,6 @@
y1 = center.y + $$.radius * (small ? Math.cos($$.config.angle) : 1); y1 = center.y + $$.radius * (small ? Math.cos($$.config.angle) : 1);
} }
if(!$$.ed3Config.coords){
$$.ed3Config.coords = {};
}
if(!$$.ed3Config.subBox) return; if(!$$.ed3Config.subBox) return;
x2 = $$.ed3Config.subBox.x + $$.getCurrentWidth(); x2 = $$.ed3Config.subBox.x + $$.getCurrentWidth();
...@@ -6564,7 +6560,7 @@ ...@@ -6564,7 +6560,7 @@
if(isSub($$.config.ed3Type)){ if(isSub($$.config.ed3Type)){
if(!$$.ed3Config.coords) return; if(!$$.ed3Config.coords[order]) return;
var coords = $$.ed3Config.coords[order]; var coords = $$.ed3Config.coords[order];
...@@ -6600,10 +6596,6 @@ ...@@ -6600,10 +6596,6 @@
y2 = center.y + $$.radius; y2 = center.y + $$.radius;
} }
if(!$$.ed3Config.coords){
$$.ed3Config.coords = {};
}
if(small){ if(small){
var subCenter = { var subCenter = {
x: center.x + $$.getCurrentWidth(), 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 ...@@ -305,7 +305,7 @@ c3_chart_internal_fn.redrawArc = function (duration, durationForExit, withTransf
.style("opacity", $$.hasType('donut') || $$.hasType('gauge') ? 1 : 0); .style("opacity", $$.hasType('donut') || $$.hasType('gauge') ? 1 : 0);
if($$.config.hasSubs || $$.config.isSub){ if($$.config.hasSubs || $$.config.isSub){
$$.buffer.onlastfinish("draw-lines", function(){ $$.buffer.onlastfinish("draw-lines"+$$.config.isSub, function(){
$$.ed3Internal.redrawLinesOnBoth(); $$.ed3Internal.redrawLinesOnBoth();
$$.ed3Internal.redrawLinesOnBoth(); $$.ed3Internal.redrawLinesOnBoth();
}); });
......
...@@ -411,8 +411,8 @@ c3_chart_internal_fn.tuneAxis = function(sync, callback){ ...@@ -411,8 +411,8 @@ c3_chart_internal_fn.tuneAxis = function(sync, callback){
if(sync){ if(sync){
apply(); apply();
} else { } else {
$$.buffer.onlastfinish("tune-axis", apply); $$.buffer.onlastfinish("tune-axis" + $$.config.isSub, apply);
$$.buffer.onlastfinish("cached-redraw", function(){}); $$.buffer.onlastfinish("cached-redraw" + $$.config.isSub, function(){});
} }
}; };
...@@ -467,7 +467,7 @@ c3_chart_internal_fn.getAbscissa = function(type, min, max) { ...@@ -467,7 +467,7 @@ c3_chart_internal_fn.getAbscissa = function(type, min, max) {
axis = $$.getAxisData(min, max, true); axis = $$.getAxisData(min, max, true);
break; break;
default: default:
throw new Error("Unsupported type for axis"); throw new Error("Unsupported type for axis " + type);
} }
return axis; return axis;
}; };
......
...@@ -39,8 +39,8 @@ c3.chart.internal.fn.cachedRedraw = function(options, callback){ ...@@ -39,8 +39,8 @@ c3.chart.internal.fn.cachedRedraw = function(options, callback){
$$.pushCallback(callback); $$.pushCallback(callback);
if($$.config.shouldCache){ if($$.config.shouldCache){
if(!$$.buffer.has("tune-axis")){ if(!$$.buffer.has("tune-axis" + $$.config.isSub)){
$$.buffer.onlastfinish("cached-redraw", $$.buffer.onlastfinish("cached-redraw" + $$.config.isSub,
function(){ function(){
$$.resolveDraw(options); $$.resolveDraw(options);
} }
......
...@@ -35,7 +35,7 @@ c3.chart.internal.fn.getLineCoordsForBar = function(center, order){ ...@@ -35,7 +35,7 @@ c3.chart.internal.fn.getLineCoordsForBar = function(center, order){
$$.ed3Config.subBox = $$.getBox($$.main.selectAll(".sub-chart .c3-chart-bars")); $$.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]; var coords = $$.ed3Config.coords[order];
...@@ -69,10 +69,6 @@ c3.chart.internal.fn.getLineCoordsForBar = function(center, order){ ...@@ -69,10 +69,6 @@ c3.chart.internal.fn.getLineCoordsForBar = function(center, order){
y1 = center.y + $$.radius * (small ? Math.cos($$.config.angle) : 1); y1 = center.y + $$.radius * (small ? Math.cos($$.config.angle) : 1);
} }
if(!$$.ed3Config.coords){
$$.ed3Config.coords = {};
}
if(!$$.ed3Config.subBox) return; if(!$$.ed3Config.subBox) return;
x2 = $$.ed3Config.subBox.x + $$.getCurrentWidth(); x2 = $$.ed3Config.subBox.x + $$.getCurrentWidth();
...@@ -107,7 +103,7 @@ c3.chart.internal.fn.getLineCoordsForPie = function(center, order){ ...@@ -107,7 +103,7 @@ c3.chart.internal.fn.getLineCoordsForPie = function(center, order){
if(isSub($$.config.ed3Type)){ if(isSub($$.config.ed3Type)){
if(!$$.ed3Config.coords) return; if(!$$.ed3Config.coords[order]) return;
var coords = $$.ed3Config.coords[order]; var coords = $$.ed3Config.coords[order];
...@@ -143,10 +139,6 @@ c3.chart.internal.fn.getLineCoordsForPie = function(center, order){ ...@@ -143,10 +139,6 @@ c3.chart.internal.fn.getLineCoordsForPie = function(center, order){
y2 = center.y + $$.radius; y2 = center.y + $$.radius;
} }
if(!$$.ed3Config.coords){
$$.ed3Config.coords = {};
}
if(small){ if(small){
var subCenter = { var subCenter = {
x: center.x + $$.getCurrentWidth(), 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