From 1168b6926d53eecc76f61fd4048ce1050aff306f Mon Sep 17 00:00:00 2001 From: vladsu Date: Sat, 28 Mar 2015 00:57:40 +0100 Subject: [PATCH] Set the X axis in subchart to visible or invisible I'm totally new in the github and all this stuff. Sorry if I do something wrong. I came across c3 for two days and found it suitable for me. Thanks for that! But there are some points which I would like to improve. Here I have added two lines to the c3.js and with following options the X axis could be set to hide ``` ... axis: { x: { show: false } } ... ``` http://jsfiddle.net/vladsu/89szjf3r/3/ Best wishes, Vlad --- c3.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/c3.js b/c3.js index 233d1b5..aa2885a 100644 --- a/c3.js +++ b/c3.js @@ -1077,6 +1077,7 @@ subchart_show: false, subchart_size_height: 60, subchart_onbrush: function () {}, + subchart_axis_x_show: true, // color color_pattern: [], color_threshold: {}, @@ -5264,7 +5265,8 @@ $$.axes.subx = context.append("g") .attr("class", CLASS.axisX) .attr("transform", $$.getTranslate('subx')) - .attr("clip-path", config.axis_rotated ? "" : $$.clipPathForXAxis); + .attr("clip-path", config.axis_rotated ? "" : $$.clipPathForXAxis) + .style("visibility", config.subchart_axis_x_show ? 'visible' : 'hidden'); }; c3_chart_internal_fn.updateTargetsForSubchart = function (targets) { var $$ = this, context = $$.context, config = $$.config,