Chart axis labels are hidden seemingly at random
AleksanderGondek opened this issue · 1 comments
AleksanderGondek commented
This is the first time I am using this library, so forgive me if my question is an obvious one.
I am following the tutorial posted on plottable website and I am attempting to draw basic line plot. I have not made any modifications to the code example from tutorial (except from changing drawing container type to div).
As you may see that axis labels are hidden, however for some reason the first 3 labels of xAxis are shown. How can I fix this behaviour, to have all axis labels to be shown?
AleksanderGondek commented
To explain further - the code is exactly same as in tutorial.
ngOnInit() {
this.makeBasicChart();
}
makeBasicChart(): void {
const xScale = new Scales.Linear();
const yScale = new Scales.Linear();
const xAxis = new Axes.Numeric(xScale, "bottom");
const yAxis = new Axes.Numeric(yScale, "left");
const plot = new Plots.Line();
plot.x(function(d) { return d.x; }, xScale);
plot.y(function(d) { return d.y; }, yScale);
const dataset = new Dataset([
{ "x": 0, "y": 1 },
{ "x": 1, "y": 2 },
{ "x": 2, "y": 4 },
{ "x": 3, "y": 8 }
]);
plot.addDataset(dataset);
this.chart = new Components.Table([
[yAxis, plot],
[null, xAxis]
]);
this.chart.renderTo("div#tutorial-result");
}
<div class="row">
<div id="tutorial-result"></div>
</div>