Commit 6bc9d974 authored by Paul Asmuth's avatar Paul Asmuth
Browse files

add axis-{x,y}-padding properties

parent 1433f5e5
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -388,7 +388,8 @@ ParserFn configure_var(
    ParserFn parser) {
  return [=] (const plist::Property& prop) -> ReturnCode {
    if (plist::is_enum(prop, "csv") ||
        plist::is_enum(prop, "var")) {
        plist::is_enum(prop, "var") ||
        plist::is_list(prop)) {
      return configure_series(prop, ctx, series);
    } else {
      return parser(prop);
+2 −0
Original line number Diff line number Diff line
@@ -296,6 +296,7 @@ ReturnCode configure_style(
          bind(&axis_configure_label_placement, _1, &config->axis_bottom.label_placement),
      })
    },
    {"axis-x-padding", bind(&configure_float, _1, &domain_x->padding)},
    {"axis-y", bind(&domain_configure, _1, domain_y)},
    {"axis-y-min", bind(&configure_float_opt, _1, &domain_y->min)},
    {"axis-y-max", bind(&configure_float_opt, _1, &domain_y->max)},
@@ -313,6 +314,7 @@ ReturnCode configure_style(
          bind(&axis_configure_label_placement, _1, &config->axis_right.label_placement),
      })
    },
    {"axis-y-padding", bind(&configure_float, _1, &domain_y->padding)},
    {"axis-top", bind(&parseAxisModeProp, _1, &config->axis_top.mode)},
    {"axis-top-format", bind(&confgure_format, _1, &config->axis_top.label_formatter)},
    {
+7 −5
Original line number Diff line number Diff line
plot {
  xdomain-padding: 0;
  ydomain-padding: 0;
  axis-x-padding: 0;
  axis-y-padding: 0;

  series {
    xs: 10,   20,   30,   40,   50,   60,    70,   80,  90,  100;
    ys: 1.23, 4.32, 3.23, 6.43, 3.45, 12.32, 8.14, 5.2, 3.5, 2.2;
  x: 10,   20,   30,   40,   50,   60,    70,   80,  90,  100;
  y: 1.23, 4.32, 3.23, 6.43, 3.45, 12.32, 8.14, 5.2, 3.5, 2.2;

  layer {
    type: lines;
    color: #06c;
  }
}
+0 −2
Original line number Diff line number Diff line
@@ -69,6 +69,4 @@
  <text x="14.666667" y="105.285688" fill="#333333" font-size="14.666667" font-family="Arial,Helvetica,'Helvetica Neue',sans-serif">10.6</text>
  <text x="14.666667" y="49.400000" fill="#333333" font-size="14.666667" font-family="Arial,Helvetica,'Helvetica Neue',sans-serif">12.3</text>
  <path stroke-width="2.666667" stroke="#005fbf" fill="none" d="M54.946875 396.543506 L176.069792 298.425974 L297.192708 333.037013 L418.315625 231.426623 L539.438542 326.051299 L660.561458 44.4 L781.684375 177.128571 L902.807292 270.483117 L1023.930208 324.463636 L1145.053125 365.742857 "/>
  <path fill="#4572a7" d="M97.646875 75.2 M87.646875 75.2 a5.0 5.0 0 1 0 10.0 0 a5.0 5.0 0 1 0 -10.0 0 "/>
  <text x="104.146875" y="75.200000" fill="#333333" font-size="14.666667" font-family="Arial,Helvetica,'Helvetica Neue',sans-serif"></text>
</svg>
 No newline at end of file
+7 −5
Original line number Diff line number Diff line
plot {
  xdomain-padding: 0.1;
  ydomain-padding: 0.3;
  axis-x-padding: 0.1;
  axis-y-padding: 0.3;

  series {
    xs: 10,   20,   30,   40,   50,   60,    70,   80,  90,  100;
    ys: 1.23, 4.32, 3.23, 6.43, 3.45, 12.32, 8.14, 5.2, 3.5, 2.2;
  x: 10,   20,   30,   40,   50,   60,    70,   80,  90,  100;
  y: 1.23, 4.32, 3.23, 6.43, 3.45, 12.32, 8.14, 5.2, 3.5, 2.2;

  layer {
    type: lines;
    color: #06c;
  }
}
Loading