Forum Discussion

matan_benyishay's avatar
3 years ago

Second glyph/plot segment in Charticulator

Hi,

I'm trying to use Charticulator to make a template for a jitter chart with median and average lines. This is especially helpful for visualizing the variation within and between groups, including for racial equity. For an example, please take a look at the right chart in the attached photo (not produced in Power BI).

I've been able to get the jitter functionality in Charticulator - this seems simple enough, since the plot segment allows a jitter type. However, I can't figure out how to add a second glyph, or to attach the data to a second plot segment, in order to get median and average lines. Does this need a second data set? What is the workflow here?

 

1 Reply

  • ppm1's avatar
    ppm1
    Solution Sage

    I think you'll have more flexibility with the Deneb visual for this one (based on Vega Lite). Here is a quick example.

     

    Below is the JSON "spec" for the above chart that you can modify as needed. Also, here is a link with a good intro to Deneb - Getting Started | Deneb

    {
      "data": {"name": "dataset"},
      "transform": [
        {
          "calculate": "random()",
          "as": "jitter"
        }
      ],
      "layer": [
        {
          "mark": {"type": "point"},
          "encoding": {
            "x": {
              "field": "Total Qty",
              "type": "quantitative"
            },
            "yOffset": {"field": "jitter"}
          }
        },
        {
          "mark": {
            "type": "tick",
            "size": 200,
            "color": "red"
          },
          "encoding": {
            "x": {
              "field": "Total Qty",
              "aggregate": "mean"
            },
            "detail": {"field": "Category"}
          }
        }
      ],
      "encoding": {
        "y": {
          "field": "Category",
          "type": "nominal"
        }
      }
    }

     

    Pat