I must remove the elements for the axis because I don't want to have empty space. I have to fit the graph in a panel.
I'm trying something like:
d3.select("g.c3-axis .c3-axis-y").remove();
d3.select("g.c3-axis-x").remove();
I printed this following selection in my console and it's all right but the remove doesn't work:
d3.select("svg").select(".c3-axis-x").selectAll("*").remove();
No results! What's the mistake ? I think that when I launch the function the chart is not completely generated, but I can't find a good solution to achieve the style desiderated.
I achieved the result in a different way, I fixed the padding for the axis in the chart.
axis:
{
x:
{
type: 'timeseries',
tick:
{
format : "%d-%m-%y"
},
show: false,
padding :
{
bottom : 0,
left: 0,
right: 0
}
},
y:
{
min: 0,
padding :
{
bottom : 0,
left: 0,
right: 0
},
tick:
{
values: [[0], [maxs]],
format: function (d) { return d3.format(',f')(d) +' kWh/h' }
},
show: false
}
},