Forum Discussion

AnthonyJoseph's avatar
AnthonyJoseph
Resolver III
4 years ago
Solved

Bar chart with design

Hello Community,

 

Wondering if we can create a chart  (with kind of design as in the picture).  Not sure, if there is a visual that exists any ideas/possiblities are most welcome.

 

 

 

Thanks,

Anthony Joseph

  • Hi AnthonyJoseph

    Core visuals certainly dont support pattern fills, and there are a few custom ones that do. Visuals that adhere to the OBCS standard (such as ZebraBI have patern shading, but these are typically contextual for how patterns should be used in an IBCS scenario).

    If you want a bit more control as the cost of having to do a bit more to set it up, Deneb provides support for a number of popular SVG patterns. Here's a quick mockup:

     

    I've attached a sample workbook, but here's the Vega-Lite specification I used to produce:

    {
      "data": {"name": "dataset"},
      "layer": [
        {
          "mark": {
            "type": "bar",
            "stroke": "black"
          },
          "encoding": {
            "fill": {
              "field": "Series",
              "legend": {
                "title": null,
                "orient": "top",
                "symbolType": "square",
                "symbolStrokeWidth": 1,
                "symbolSize": 200
              },
              "scale": {
                "range": [
                  "url(#diagonal-stripe-1)",
                  "url(#circles-1)",
                  "url(#houndstooth)"
                ]
              }
            }
          }
        },
        {
          "mark": {
            "type": "text",
            "dy": -10
          },
          "encoding": {
            "text": {"field": "Value"}
          }
        }
      ],
      "encoding": {
        "x": {
          "field": "Category",
          "axis": {"labelAngle": 0}
        },
        "xOffset": {"field": "Series"},
        "y": {
          "field": "Value",
          "type": "quantitative"
        }
      }
    }

    Regards,

    Daniel

1 Reply

  • dm-p's avatar
    dm-p
    Super User

    Hi AnthonyJoseph

    Core visuals certainly dont support pattern fills, and there are a few custom ones that do. Visuals that adhere to the OBCS standard (such as ZebraBI have patern shading, but these are typically contextual for how patterns should be used in an IBCS scenario).

    If you want a bit more control as the cost of having to do a bit more to set it up, Deneb provides support for a number of popular SVG patterns. Here's a quick mockup:

     

    I've attached a sample workbook, but here's the Vega-Lite specification I used to produce:

    {
      "data": {"name": "dataset"},
      "layer": [
        {
          "mark": {
            "type": "bar",
            "stroke": "black"
          },
          "encoding": {
            "fill": {
              "field": "Series",
              "legend": {
                "title": null,
                "orient": "top",
                "symbolType": "square",
                "symbolStrokeWidth": 1,
                "symbolSize": 200
              },
              "scale": {
                "range": [
                  "url(#diagonal-stripe-1)",
                  "url(#circles-1)",
                  "url(#houndstooth)"
                ]
              }
            }
          }
        },
        {
          "mark": {
            "type": "text",
            "dy": -10
          },
          "encoding": {
            "text": {"field": "Value"}
          }
        }
      ],
      "encoding": {
        "x": {
          "field": "Category",
          "axis": {"labelAngle": 0}
        },
        "xOffset": {"field": "Series"},
        "y": {
          "field": "Value",
          "type": "quantitative"
        }
      }
    }

    Regards,

    Daniel