Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Chart axis labels are hidden seemingly at random #3366

Closed
AleksanderGondek opened this issue Jun 11, 2017 · 1 comment
Closed

Chart axis labels are hidden seemingly at random #3366

AleksanderGondek opened this issue Jun 11, 2017 · 1 comment

Comments

@AleksanderGondek
Copy link

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).

This is the outcome

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
Copy link
Author

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>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant