Commit 495c72da authored by Paul Asmuth's avatar Paul Asmuth
Browse files

add examples/charts-custom/logarithmic_scale.fvz

parent 4f226cda
Loading
Loading
Loading
Loading
+16 −2
Original line number Diff line number Diff line
@@ -69,8 +69,22 @@ ReturnCode build(
    {"limit-y", bind(&expr_to_float64_opt_pair, _1, &scale_y.min, &scale_y.max)},
    {"limit-y-min", bind(&expr_to_float64_opt, _1, &scale_y.min)},
    {"limit-y-max", bind(&expr_to_float64_opt, _1, &scale_y.max)},
    {"scale-x", bind(&scale_configure_kind, _1, &scale_x)},
    {"scale-y", bind(&scale_configure_kind, _1, &scale_y)},
    {
      "scale-x",
      expr_calln_fn({
        bind(&scale_configure_kind, _1, &scale_x),
        bind(&expr_rewritev, _1, "scale-x", &line_opts),
        bind(&expr_rewritev, _1, "scale", &axis_x_opts)
      })
    },
    {
      "scale-y",
      expr_calln_fn({
        bind(&scale_configure_kind, _1, &scale_y),
        bind(&expr_rewritev, _1, "scale-y", &line_opts),
        bind(&expr_rewritev, _1, "scale", &axis_y_opts)
      })
    },
    {"scale-x-padding", bind(&expr_to_float64, _1, &scale_x.padding)},
    {"scale-y-padding", bind(&expr_to_float64, _1, &scale_y.padding)},
    {
+16 −2
Original line number Diff line number Diff line
@@ -69,8 +69,22 @@ ReturnCode build(
    {"limit-y", bind(&expr_to_float64_opt_pair, _1, &scale_y.min, &scale_y.max)},
    {"limit-y-min", bind(&expr_to_float64_opt, _1, &scale_y.min)},
    {"limit-y-max", bind(&expr_to_float64_opt, _1, &scale_y.max)},
    {"scale-x", bind(&scale_configure_kind, _1, &scale_x)},
    {"scale-y", bind(&scale_configure_kind, _1, &scale_y)},
    {
      "scale-x",
      expr_calln_fn({
        bind(&scale_configure_kind, _1, &scale_x),
        bind(&expr_rewritev, _1, "scale-x", &point_opts),
        bind(&expr_rewritev, _1, "scale", &axis_x_opts)
      })
    },
    {
      "scale-y",
      expr_calln_fn({
        bind(&scale_configure_kind, _1, &scale_y),
        bind(&expr_rewritev, _1, "scale-y", &point_opts),
        bind(&expr_rewritev, _1, "scale", &axis_y_opts)
      })
    },
    {"scale-x-padding", bind(&expr_to_float64, _1, &scale_x.padding)},
    {"scale-y-padding", bind(&expr_to_float64, _1, &scale_y.padding)},
    {
+10 −0
Original line number Diff line number Diff line
(chart/linechart
    data-x (csv "tests/testdata/log_example.csv" x)
    data-y (csv "tests/testdata/log_example.csv" y)
    limit-x (1 5)
    limit-y (0 10000)
    scale-y (log)
    ticks-y (subdivide 10)
    grid (color #fff)
    background #eee
    border none)
+119 −0
Original line number Diff line number Diff line
<svg xmlns="http://www.w3.org/2000/svg" width="900.000000" height="480.000000" viewBox="0 0 900 480">
  <rect width="900.000000" height="480.000000" fill="#ffffff"/>
  <path fill="#eeeeee" d="M84.3045 49.2889 L815.695 49.2889 L815.695 430.711 L84.3045 430.711 L84.3045 49.2889 "/>
  <path stroke-width="1.000000" stroke="#ffffff" fill="none" d="M84.3045 49.2889 L84.3045 430.711 "/>
  <path stroke-width="1.000000" stroke="#ffffff" fill="none" d="M157.444 49.2889 L157.444 430.711 "/>
  <path stroke-width="1.000000" stroke="#ffffff" fill="none" d="M230.583 49.2889 L230.583 430.711 "/>
  <path stroke-width="1.000000" stroke="#ffffff" fill="none" d="M303.722 49.2889 L303.722 430.711 "/>
  <path stroke-width="1.000000" stroke="#ffffff" fill="none" d="M376.861 49.2889 L376.861 430.711 "/>
  <path stroke-width="1.000000" stroke="#ffffff" fill="none" d="M450 49.2889 L450 430.711 "/>
  <path stroke-width="1.000000" stroke="#ffffff" fill="none" d="M523.139 49.2889 L523.139 430.711 "/>
  <path stroke-width="1.000000" stroke="#ffffff" fill="none" d="M596.278 49.2889 L596.278 430.711 "/>
  <path stroke-width="1.000000" stroke="#ffffff" fill="none" d="M669.417 49.2889 L669.417 430.711 "/>
  <path stroke-width="1.000000" stroke="#ffffff" fill="none" d="M742.556 49.2889 L742.556 430.711 "/>
  <path stroke-width="1.000000" stroke="#ffffff" fill="none" d="M815.695 49.2889 L815.695 430.711 "/>
  <path stroke-width="1.000000" stroke="#ffffff" fill="none" d="M84.3045 430.711 L815.695 430.711 "/>
  <path stroke-width="1.000000" stroke="#ffffff" fill="none" d="M84.3045 392.569 L815.695 392.569 "/>
  <path stroke-width="1.000000" stroke="#ffffff" fill="none" d="M84.3045 354.427 L815.695 354.427 "/>
  <path stroke-width="1.000000" stroke="#ffffff" fill="none" d="M84.3045 316.284 L815.695 316.284 "/>
  <path stroke-width="1.000000" stroke="#ffffff" fill="none" d="M84.3045 278.142 L815.695 278.142 "/>
  <path stroke-width="1.000000" stroke="#ffffff" fill="none" d="M84.3045 240 L815.695 240 "/>
  <path stroke-width="1.000000" stroke="#ffffff" fill="none" d="M84.3045 201.858 L815.695 201.858 "/>
  <path stroke-width="1.000000" stroke="#ffffff" fill="none" d="M84.3045 163.716 L815.695 163.716 "/>
  <path stroke-width="1.000000" stroke="#ffffff" fill="none" d="M84.3045 125.573 L815.695 125.573 "/>
  <path stroke-width="1.000000" stroke="#ffffff" fill="none" d="M84.3045 87.4311 L815.695 87.4311 "/>
  <path stroke-width="1.000000" stroke="#ffffff" fill="none" d="M84.3045 49.2889 L815.695 49.2889 "/>
  <path stroke-width="2.000000" stroke="#000000" fill="none" d="M84.3045 430.711 L267.152 335.356 L450 240 L632.848 144.644 L815.695 49.2889 "/>
  <path stroke-width="0.000000" stroke="#333333" fill="none" d="M84.3045 49.2889 L815.695 49.2889 "/>
  <path stroke-width="0.000000" stroke="#333333" fill="none" d="M84.3045 49.2889 L84.3045 54.6222 "/>
  <path stroke-width="0.000000" stroke="#333333" fill="none" d="M157.444 49.2889 L157.444 54.6222 "/>
  <path stroke-width="0.000000" stroke="#333333" fill="none" d="M230.583 49.2889 L230.583 54.6222 "/>
  <path stroke-width="0.000000" stroke="#333333" fill="none" d="M303.722 49.2889 L303.722 54.6222 "/>
  <path stroke-width="0.000000" stroke="#333333" fill="none" d="M376.861 49.2889 L376.861 54.6222 "/>
  <path stroke-width="0.000000" stroke="#333333" fill="none" d="M450 49.2889 L450 54.6222 "/>
  <path stroke-width="0.000000" stroke="#333333" fill="none" d="M523.139 49.2889 L523.139 54.6222 "/>
  <path stroke-width="0.000000" stroke="#333333" fill="none" d="M596.278 49.2889 L596.278 54.6222 "/>
  <path stroke-width="0.000000" stroke="#333333" fill="none" d="M669.417 49.2889 L669.417 54.6222 "/>
  <path stroke-width="0.000000" stroke="#333333" fill="none" d="M742.556 49.2889 L742.556 54.6222 "/>
  <path stroke-width="0.000000" stroke="#333333" fill="none" d="M815.695 49.2889 L815.695 54.6222 "/>
  <text x="74.109201" y="33.555556" fill="#333333" font-size="14.666667" font-family="Arial,Helvetica,'Helvetica Neue',sans-serif">1.0</text>
  <text x="147.248300" y="33.555556" fill="#333333" font-size="14.666667" font-family="Arial,Helvetica,'Helvetica Neue',sans-serif">1.4</text>
  <text x="220.387398" y="33.555556" fill="#333333" font-size="14.666667" font-family="Arial,Helvetica,'Helvetica Neue',sans-serif">1.8</text>
  <text x="293.526502" y="33.555556" fill="#333333" font-size="14.666667" font-family="Arial,Helvetica,'Helvetica Neue',sans-serif">2.2</text>
  <text x="366.665595" y="33.555556" fill="#333333" font-size="14.666667" font-family="Arial,Helvetica,'Helvetica Neue',sans-serif">2.6</text>
  <text x="439.804688" y="33.555556" fill="#333333" font-size="14.666667" font-family="Arial,Helvetica,'Helvetica Neue',sans-serif">3.0</text>
  <text x="512.943802" y="33.555556" fill="#333333" font-size="14.666667" font-family="Arial,Helvetica,'Helvetica Neue',sans-serif">3.4</text>
  <text x="586.082873" y="33.555556" fill="#333333" font-size="14.666667" font-family="Arial,Helvetica,'Helvetica Neue',sans-serif">3.8</text>
  <text x="659.221988" y="33.555556" fill="#333333" font-size="14.666667" font-family="Arial,Helvetica,'Helvetica Neue',sans-serif">4.2</text>
  <text x="732.361103" y="33.555556" fill="#333333" font-size="14.666667" font-family="Arial,Helvetica,'Helvetica Neue',sans-serif">4.6</text>
  <text x="805.500174" y="33.555556" fill="#333333" font-size="14.666667" font-family="Arial,Helvetica,'Helvetica Neue',sans-serif">5.0</text>
  <path stroke-width="0.000000" stroke="#333333" fill="none" d="M815.695 49.2889 L815.695 430.711 "/>
  <path stroke-width="0.000000" stroke="#333333" fill="none" d="M815.695 430.711 L810.362 430.711 "/>
  <path stroke-width="0.000000" stroke="#333333" fill="none" d="M815.695 392.569 L810.362 392.569 "/>
  <path stroke-width="0.000000" stroke="#333333" fill="none" d="M815.695 354.427 L810.362 354.427 "/>
  <path stroke-width="0.000000" stroke="#333333" fill="none" d="M815.695 316.284 L810.362 316.284 "/>
  <path stroke-width="0.000000" stroke="#333333" fill="none" d="M815.695 278.142 L810.362 278.142 "/>
  <path stroke-width="0.000000" stroke="#333333" fill="none" d="M815.695 240 L810.362 240 "/>
  <path stroke-width="0.000000" stroke="#333333" fill="none" d="M815.695 201.858 L810.362 201.858 "/>
  <path stroke-width="0.000000" stroke="#333333" fill="none" d="M815.695 163.716 L810.362 163.716 "/>
  <path stroke-width="0.000000" stroke="#333333" fill="none" d="M815.695 125.573 L810.362 125.573 "/>
  <path stroke-width="0.000000" stroke="#333333" fill="none" d="M815.695 87.4311 L810.362 87.4311 "/>
  <path stroke-width="0.000000" stroke="#333333" fill="none" d="M815.695 49.2889 L810.362 49.2889 "/>
  <text x="827.428819" y="435.711111" fill="#333333" font-size="14.666667" font-family="Arial,Helvetica,'Helvetica Neue',sans-serif">1.0</text>
  <text x="827.428819" y="397.568888" fill="#333333" font-size="14.666667" font-family="Arial,Helvetica,'Helvetica Neue',sans-serif">2.5</text>
  <text x="827.428819" y="359.426666" fill="#333333" font-size="14.666667" font-family="Arial,Helvetica,'Helvetica Neue',sans-serif">6.3</text>
  <text x="827.428819" y="321.284440" fill="#333333" font-size="14.666667" font-family="Arial,Helvetica,'Helvetica Neue',sans-serif">15.8</text>
  <text x="827.428819" y="283.142220" fill="#333333" font-size="14.666667" font-family="Arial,Helvetica,'Helvetica Neue',sans-serif">39.8</text>
  <text x="827.428819" y="245.000000" fill="#333333" font-size="14.666667" font-family="Arial,Helvetica,'Helvetica Neue',sans-serif">100.0</text>
  <text x="827.428819" y="206.857769" fill="#333333" font-size="14.666667" font-family="Arial,Helvetica,'Helvetica Neue',sans-serif">251.2</text>
  <text x="827.428819" y="168.715560" fill="#333333" font-size="14.666667" font-family="Arial,Helvetica,'Helvetica Neue',sans-serif">631.0</text>
  <text x="827.428819" y="130.573329" fill="#333333" font-size="14.666667" font-family="Arial,Helvetica,'Helvetica Neue',sans-serif">1584.9</text>
  <text x="827.428819" y="92.431097" fill="#333333" font-size="14.666667" font-family="Arial,Helvetica,'Helvetica Neue',sans-serif">3981.1</text>
  <text x="827.428819" y="54.288889" fill="#333333" font-size="14.666667" font-family="Arial,Helvetica,'Helvetica Neue',sans-serif">10000.0</text>
  <path stroke-width="0.000000" stroke="#333333" fill="none" d="M84.3045 430.711 L815.695 430.711 "/>
  <path stroke-width="0.000000" stroke="#333333" fill="none" d="M84.3045 430.711 L84.3045 425.378 "/>
  <path stroke-width="0.000000" stroke="#333333" fill="none" d="M157.444 430.711 L157.444 425.378 "/>
  <path stroke-width="0.000000" stroke="#333333" fill="none" d="M230.583 430.711 L230.583 425.378 "/>
  <path stroke-width="0.000000" stroke="#333333" fill="none" d="M303.722 430.711 L303.722 425.378 "/>
  <path stroke-width="0.000000" stroke="#333333" fill="none" d="M376.861 430.711 L376.861 425.378 "/>
  <path stroke-width="0.000000" stroke="#333333" fill="none" d="M450 430.711 L450 425.378 "/>
  <path stroke-width="0.000000" stroke="#333333" fill="none" d="M523.139 430.711 L523.139 425.378 "/>
  <path stroke-width="0.000000" stroke="#333333" fill="none" d="M596.278 430.711 L596.278 425.378 "/>
  <path stroke-width="0.000000" stroke="#333333" fill="none" d="M669.417 430.711 L669.417 425.378 "/>
  <path stroke-width="0.000000" stroke="#333333" fill="none" d="M742.556 430.711 L742.556 425.378 "/>
  <path stroke-width="0.000000" stroke="#333333" fill="none" d="M815.695 430.711 L815.695 425.378 "/>
  <text x="74.109201" y="456.444444" fill="#333333" font-size="14.666667" font-family="Arial,Helvetica,'Helvetica Neue',sans-serif">1.0</text>
  <text x="147.248300" y="456.444444" fill="#333333" font-size="14.666667" font-family="Arial,Helvetica,'Helvetica Neue',sans-serif">1.4</text>
  <text x="220.387398" y="456.444444" fill="#333333" font-size="14.666667" font-family="Arial,Helvetica,'Helvetica Neue',sans-serif">1.8</text>
  <text x="293.526502" y="456.444444" fill="#333333" font-size="14.666667" font-family="Arial,Helvetica,'Helvetica Neue',sans-serif">2.2</text>
  <text x="366.665595" y="456.444444" fill="#333333" font-size="14.666667" font-family="Arial,Helvetica,'Helvetica Neue',sans-serif">2.6</text>
  <text x="439.804688" y="456.444444" fill="#333333" font-size="14.666667" font-family="Arial,Helvetica,'Helvetica Neue',sans-serif">3.0</text>
  <text x="512.943802" y="456.444444" fill="#333333" font-size="14.666667" font-family="Arial,Helvetica,'Helvetica Neue',sans-serif">3.4</text>
  <text x="586.082873" y="456.444444" fill="#333333" font-size="14.666667" font-family="Arial,Helvetica,'Helvetica Neue',sans-serif">3.8</text>
  <text x="659.221988" y="456.444444" fill="#333333" font-size="14.666667" font-family="Arial,Helvetica,'Helvetica Neue',sans-serif">4.2</text>
  <text x="732.361103" y="456.444444" fill="#333333" font-size="14.666667" font-family="Arial,Helvetica,'Helvetica Neue',sans-serif">4.6</text>
  <text x="805.500174" y="456.444444" fill="#333333" font-size="14.666667" font-family="Arial,Helvetica,'Helvetica Neue',sans-serif">5.0</text>
  <path stroke-width="0.000000" stroke="#333333" fill="none" d="M84.3045 49.2889 L84.3045 430.711 "/>
  <path stroke-width="0.000000" stroke="#333333" fill="none" d="M84.3045 430.711 L89.6378 430.711 "/>
  <path stroke-width="0.000000" stroke="#333333" fill="none" d="M84.3045 392.569 L89.6378 392.569 "/>
  <path stroke-width="0.000000" stroke="#333333" fill="none" d="M84.3045 354.427 L89.6378 354.427 "/>
  <path stroke-width="0.000000" stroke="#333333" fill="none" d="M84.3045 316.284 L89.6378 316.284 "/>
  <path stroke-width="0.000000" stroke="#333333" fill="none" d="M84.3045 278.142 L89.6378 278.142 "/>
  <path stroke-width="0.000000" stroke="#333333" fill="none" d="M84.3045 240 L89.6378 240 "/>
  <path stroke-width="0.000000" stroke="#333333" fill="none" d="M84.3045 201.858 L89.6378 201.858 "/>
  <path stroke-width="0.000000" stroke="#333333" fill="none" d="M84.3045 163.716 L89.6378 163.716 "/>
  <path stroke-width="0.000000" stroke="#333333" fill="none" d="M84.3045 125.573 L89.6378 125.573 "/>
  <path stroke-width="0.000000" stroke="#333333" fill="none" d="M84.3045 87.4311 L89.6378 87.4311 "/>
  <path stroke-width="0.000000" stroke="#333333" fill="none" d="M84.3045 49.2889 L89.6378 49.2889 "/>
  <text x="52.180556" y="435.711111" fill="#333333" font-size="14.666667" font-family="Arial,Helvetica,'Helvetica Neue',sans-serif">1.0</text>
  <text x="52.180556" y="397.568888" fill="#333333" font-size="14.666667" font-family="Arial,Helvetica,'Helvetica Neue',sans-serif">2.5</text>
  <text x="52.180556" y="359.426666" fill="#333333" font-size="14.666667" font-family="Arial,Helvetica,'Helvetica Neue',sans-serif">6.3</text>
  <text x="44.024306" y="321.284440" fill="#333333" font-size="14.666667" font-family="Arial,Helvetica,'Helvetica Neue',sans-serif">15.8</text>
  <text x="44.024306" y="283.142220" fill="#333333" font-size="14.666667" font-family="Arial,Helvetica,'Helvetica Neue',sans-serif">39.8</text>
  <text x="35.868056" y="245.000000" fill="#333333" font-size="14.666667" font-family="Arial,Helvetica,'Helvetica Neue',sans-serif">100.0</text>
  <text x="35.868056" y="206.857769" fill="#333333" font-size="14.666667" font-family="Arial,Helvetica,'Helvetica Neue',sans-serif">251.2</text>
  <text x="35.868056" y="168.715560" fill="#333333" font-size="14.666667" font-family="Arial,Helvetica,'Helvetica Neue',sans-serif">631.0</text>
  <text x="27.711806" y="130.573329" fill="#333333" font-size="14.666667" font-family="Arial,Helvetica,'Helvetica Neue',sans-serif">1584.9</text>
  <text x="27.711806" y="92.431097" fill="#333333" font-size="14.666667" font-family="Arial,Helvetica,'Helvetica Neue',sans-serif">3981.1</text>
  <text x="19.555556" y="54.288889" fill="#333333" font-size="14.666667" font-family="Arial,Helvetica,'Helvetica Neue',sans-serif">10000.0</text>
</svg>
 No newline at end of file
+0 −25
Original line number Diff line number Diff line
width: 1200px;
height: 480px;

scale-x: log;
scale-x-min: 0;
scale-x-max: 5;

scale-y: log;
scale-y-min: 0;
scale-y-max: 10000;

lines {
  xs: csv('tests/testdata/log_example.csv', x);
  ys: csv('tests/testdata/log_example.csv', y);
  color: #06c;
}

axis {
  position: left;
}

axis {
  position: bottom;
}
Loading