Commit 181cec98 authored by Paul Asmuth's avatar Paul Asmuth
Browse files

add documentation for the 'chart/points' element

parent 1cdeee41
Loading
Loading
Loading
Loading
+6 −3
Original line number Diff line number Diff line
@@ -184,10 +184,13 @@ properties:
        desc_code: |
          axes ([top] [right] [bottom] [left])
        examples: |
          ;; automatic bottom and left axis
          axes (bottom left)
          ;; display a left and bottom axis only
          axes (left bottom)

          ;; disable automatic axes
          ;; display all axes
          axes (top left bottom right)

          ;; display no axes
          axes ()
      - name: axis-top
        desc: |
+2 −0
Original line number Diff line number Diff line
@@ -165,6 +165,8 @@ ReturnCode build(
    {"colors", expr_tov_fn<Color>(bind(&expr_to_color, _1, _2), &c->colors)},
    {"labels", bind(&data_load_strings, _1, &c->labels)},
    {"label-font-size", bind(&expr_to_measure, _1, &c->label_font_size)},
    {"label-color", bind(&expr_to_color, _1, &c->label_color)},
    {"label-padding", bind(&expr_to_measure, _1, &c->label_padding)},
  });

  if (!config_rc) {
+115 −0
Original line number Diff line number Diff line
name: chart/points
example: charts-basic/scatterplot
desc: |
  The chart/points element is used to create point/scattercharts.

reference: |
  (chart/points <options>)

option_summary: true

properties:
  - title: "Point Options"
    anchor: point-options
    properties:
      - name: data-x
        desc: |
          Set the 'x' dataset for the plot. The 'x' dataset will be used to
          calculate the horizontal position of geometry.
        desc_code: |
          data-x (<values>...)
          data-x (csv <file> <column>)
        examples: |
          ;; list of static values
          data-x (10px 20px 30px)

          ;; load a csv file
          data-x (csv myfile.csv mycolumn)
      - name: data-y
        desc: |
          Set the 'y' dataset for the plot. The 'y' dataset will be used to
          calculate the vertical position of geometry.
        desc_code: |
          data-y (<values>...)
          data-y (csv <file> <column>)
        examples: |
          ;; list of static values
          data-y (10px 20px 30px)

          ;; load a csv file
          data-y (csv myfile.csv mycolumn)
      - name: color
        alias: colors
      - name: colors
        desc: |
          Set the colors for the plot. If set, a label will be drawn for each
          point in the dataset at the points (x, y) coordinate,
        desc_code: |
          colors (<values>...)
          colors (csv <file> <column>)
        examples: |
          ;; list of static values
          colors (#0f0 #00f #f00)

          ;; load a csv file
          colors (csv myfile.csv mycolors)
      - name: marker-size
        alias: marker-sizes
      - name: marker-sizes
        desc: |
          Set the marker-sizes for the plot. If set, a label will be drawn for each
          point in the dataset at the points (x, y) coordinate,
        desc_code: |
          marker-sizes (<values>...)
          marker-sizes (csv <file> <column>)
        examples: |
          ;; list of static values
          marker-sizes (2pt 4pt 2pt)

          ;; load a csv file
          marker-sizes (csv myfile.csv mysizes)

  - title: "Label Options"
    anchor: label-options
    properties:
      - name: labels
        desc: |
          Set the labels for the plot. If set, a label will be drawn for each
          point in the dataset at the points (x, y) coordinate,
        desc_code: |
          labels (<values>...)
          labels (csv <file> <column>)
        examples: |
          ;; list of static values
          labels ("A" "B" "C")

          ;; load a csv file
          labels (csv myfile.csv mylabels)
      - name: label-font-size
        desc: |
          Set the label font size. See the [measure](#FIXME) page for more details on valid values.
        desc_code: |
          label-font-size <measure>
        examples: |
          ;; set the label font size to 14pt
          label-font-size 14pt
      - name: label-color
        desc: |
          Set the label color. See the [color](#FIXME) page for more details on valid values.
        desc_code: |
          label-color <color>
        examples: |
          ;; set the label color to grey
          label-color #eee
      - name: label-padding
        desc: |
          Set the label padding/spacing. See the [measure](#FIXME) page for more details on valid values.
        desc_code: |
          label-padding <measure>
        examples: |
          ;; set the label padding to 2em
          label-padding 2em

  - title: "Scale Options"
    anchor: scale-options
    inherit: ["elements/chart/layout", "scale-options"]
+3 −0
Original line number Diff line number Diff line
@@ -111,6 +111,9 @@ documentation:
      -
        title: "chart/axis-left"
        url: "/documentation/elements/chart/axis-left"
      -
        title: "chart/points"
        url: "/documentation/elements/chart/points"

  -
    title: "Community"
+6 −1
Original line number Diff line number Diff line
@@ -42,9 +42,14 @@

      <div style="margin-top: 1.4em;">
        {{{desc}}}
        {{#alias}}
          Alias for the <a href="#option-{{alias}}">{{alias}}</a> option.
        {{/alias}}
      <div>

      {{#desc_code}}
        <pre><code>{{desc_code}}</code></pre>
      {{/desc_code}}

      {{#desc_detail}}
        <div style="margin-top: 1.4em;">