Make plot X axis start always line up (#9)

main
Chris Vickery 2018-07-19 17:15:52 -07:00 committed by GitHub
parent fab47d1d61
commit c7542bce59
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 5 deletions

View File

@ -80,8 +80,8 @@ export default class CanGraph extends Component {
this.setState({ bounds });
this.view.run();
this.view.signal("width", bounds.width);
this.view.signal("height", 0.4 * bounds.width); // 5:2 aspect ratio
this.view.signal("width", bounds.width - 70);
this.view.signal("height", 0.4 * (bounds.width - 70)); // 5:2 aspect ratio
this.view.run();
}

View File

@ -2,10 +2,14 @@ import { createClassFromSpec } from "react-vega";
export default createClassFromSpec("CanPlot", {
$schema: "https://vega.github.io/schema/vega/v3.0.json",
width: 500,
width: 400,
height: 200,
padding: "auto",
autosize: { type: "fit", resize: true },
padding: {
top: 5,
left: 30,
right: 5,
bottom: 10
},
signals: [
{
name: "tipTime",