Commit 8006fdb0 authored by Paul Asmuth's avatar Paul Asmuth
Browse files

improved default axis selection logic in chart/layout

parent 4a5b8d99
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -439,6 +439,10 @@ ReturnCode build(


  /* configure the auto axis elements */
  if (axes_auto.empty() && axes.empty()) {
    axes_auto = {"top", "right", "bottom", "left"};
  }

  if (axes_auto.count("top")) {
    PlotAxis a;
    a.elem_name = "chart/axis-top";
+6 −8
Original line number Diff line number Diff line
(chart/layout
    left (
      (chart/axis-left
    axis-left (
        limit (0 100)
          ticks (linear 20 10)))
    right (
      (chart/axis-right
        ticks (linear 20 10))
    axis-right (
        limit (0 1)
          ticks (linear 0.1)))
        ticks (linear 0.1))
    body (
      (chart/points
          data-x (100px 500px 700px 900px 300px)
+2 −3
Original line number Diff line number Diff line
(chart/layout
  margin 2em
  bottom (
    (chart/axis-bottom
  axis-bottom (
      limit (1451606400 1451610000)
      labels (datetime "%H:%M:%S"))))
      labels (datetime "%H:%M:%S")))
+2 −3
Original line number Diff line number Diff line
(chart/layout
  margin 2em
  bottom (
    (chart/axis-bottom
  axis-bottom (
      limit (1451606400 1451610000)
      ticks (subdivide 4)
      labels (datetime "%H:%M:%S")
      label-attach begin)))
      label-attach begin))
+2 −3
Original line number Diff line number Diff line
(chart/layout
  margin 2em
  bottom (
    (chart/axis-bottom
  axis-bottom (
      limit (1451606400 1451610000)
      ticks (subdivide 4)
      labels (datetime "%H:%M:%S")
      label-rotate 45
      label-attach begin)))
      label-attach begin))
Loading