<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Deneb - Vega Lite Color Gradient Per Category in Custom Visuals Development Discussion</title>
    <link>https://community.fabric.microsoft.com/t5/Custom-Visuals-Development/Deneb-Vega-Lite-Color-Gradient-Per-Category/m-p/3030991#M6600</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Just wondering if and how it is possible to set the color gradient for category within a visual rather than across the full visual.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The below example shows the gradient based all all categories but is is possible for the color gradient to be applied on each individual category.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="DW868990_0-1674126126758.png" style="width: 400px;"&gt;&lt;img src="https://community.fabric.microsoft.com/t5/image/serverpage/image-id/858246iCBCA7594BF3F3396/image-size/medium?v=v2&amp;amp;px=400" role="button" title="DW868990_0-1674126126758.png" alt="DW868990_0-1674126126758.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;SPAN class=""&gt;{&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class=""&gt;"data"&lt;/SPAN&gt;&lt;SPAN class=""&gt;:&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class=""&gt;{&lt;/SPAN&gt;&lt;SPAN class=""&gt;"url"&lt;/SPAN&gt;&lt;SPAN class=""&gt;:&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class=""&gt;"data/cars.json"&lt;/SPAN&gt;&lt;SPAN class=""&gt;}&lt;/SPAN&gt;&lt;SPAN class=""&gt;,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;"mark"&lt;/SPAN&gt;&lt;SPAN class=""&gt;:&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class=""&gt;"rect"&lt;/SPAN&gt;&lt;SPAN class=""&gt;,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;"encoding"&lt;/SPAN&gt;&lt;SPAN class=""&gt;:&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class=""&gt;{&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class=""&gt;"y"&lt;/SPAN&gt;&lt;SPAN class=""&gt;:&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class=""&gt;{&lt;/SPAN&gt;&lt;SPAN class=""&gt;"field"&lt;/SPAN&gt;&lt;SPAN class=""&gt;:&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class=""&gt;"Origin"&lt;/SPAN&gt;&lt;SPAN class=""&gt;,&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class=""&gt;"type"&lt;/SPAN&gt;&lt;SPAN class=""&gt;:&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class=""&gt;"nominal"&lt;/SPAN&gt;&lt;SPAN class=""&gt;}&lt;/SPAN&gt;&lt;SPAN class=""&gt;,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;"x"&lt;/SPAN&gt;&lt;SPAN class=""&gt;:&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class=""&gt;{&lt;/SPAN&gt;&lt;SPAN class=""&gt;"field"&lt;/SPAN&gt;&lt;SPAN class=""&gt;:&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class=""&gt;"Cylinders"&lt;/SPAN&gt;&lt;SPAN class=""&gt;,&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class=""&gt;"type"&lt;/SPAN&gt;&lt;SPAN class=""&gt;:&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class=""&gt;"ordinal"&lt;/SPAN&gt;&lt;SPAN class=""&gt;}&lt;/SPAN&gt;&lt;SPAN class=""&gt;,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;"color"&lt;/SPAN&gt;&lt;SPAN class=""&gt;:&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class=""&gt;{&lt;/SPAN&gt;&lt;SPAN class=""&gt;"aggregate"&lt;/SPAN&gt;&lt;SPAN class=""&gt;:&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class=""&gt;"mean"&lt;/SPAN&gt;&lt;SPAN class=""&gt;,&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class=""&gt;"field"&lt;/SPAN&gt;&lt;SPAN class=""&gt;:&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class=""&gt;"Horsepower"&lt;/SPAN&gt;&lt;SPAN class=""&gt;}&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class=""&gt;}&lt;/SPAN&gt;&lt;SPAN class=""&gt;,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;"config"&lt;/SPAN&gt;&lt;SPAN class=""&gt;:&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class=""&gt;{&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class=""&gt;"axis"&lt;/SPAN&gt;&lt;SPAN class=""&gt;:&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class=""&gt;{&lt;/SPAN&gt;&lt;SPAN class=""&gt;"grid"&lt;/SPAN&gt;&lt;SPAN class=""&gt;:&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class=""&gt;true&lt;/SPAN&gt;&lt;SPAN class=""&gt;,&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class=""&gt;"tickBand"&lt;/SPAN&gt;&lt;SPAN class=""&gt;:&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class=""&gt;"extent"&lt;/SPAN&gt;&lt;SPAN class=""&gt;}&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;}&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class=""&gt;}&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;Thanks in advance&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Thu, 19 Jan 2023 11:02:15 GMT</pubDate>
    <dc:creator>DW868990</dc:creator>
    <dc:date>2023-01-19T11:02:15Z</dc:date>
    <item>
      <title>Deneb - Vega Lite Color Gradient Per Category</title>
      <link>https://community.fabric.microsoft.com/t5/Custom-Visuals-Development/Deneb-Vega-Lite-Color-Gradient-Per-Category/m-p/3030991#M6600</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Just wondering if and how it is possible to set the color gradient for category within a visual rather than across the full visual.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The below example shows the gradient based all all categories but is is possible for the color gradient to be applied on each individual category.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="DW868990_0-1674126126758.png" style="width: 400px;"&gt;&lt;img src="https://community.fabric.microsoft.com/t5/image/serverpage/image-id/858246iCBCA7594BF3F3396/image-size/medium?v=v2&amp;amp;px=400" role="button" title="DW868990_0-1674126126758.png" alt="DW868990_0-1674126126758.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;SPAN class=""&gt;{&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class=""&gt;"data"&lt;/SPAN&gt;&lt;SPAN class=""&gt;:&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class=""&gt;{&lt;/SPAN&gt;&lt;SPAN class=""&gt;"url"&lt;/SPAN&gt;&lt;SPAN class=""&gt;:&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class=""&gt;"data/cars.json"&lt;/SPAN&gt;&lt;SPAN class=""&gt;}&lt;/SPAN&gt;&lt;SPAN class=""&gt;,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;"mark"&lt;/SPAN&gt;&lt;SPAN class=""&gt;:&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class=""&gt;"rect"&lt;/SPAN&gt;&lt;SPAN class=""&gt;,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;"encoding"&lt;/SPAN&gt;&lt;SPAN class=""&gt;:&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class=""&gt;{&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class=""&gt;"y"&lt;/SPAN&gt;&lt;SPAN class=""&gt;:&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class=""&gt;{&lt;/SPAN&gt;&lt;SPAN class=""&gt;"field"&lt;/SPAN&gt;&lt;SPAN class=""&gt;:&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class=""&gt;"Origin"&lt;/SPAN&gt;&lt;SPAN class=""&gt;,&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class=""&gt;"type"&lt;/SPAN&gt;&lt;SPAN class=""&gt;:&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class=""&gt;"nominal"&lt;/SPAN&gt;&lt;SPAN class=""&gt;}&lt;/SPAN&gt;&lt;SPAN class=""&gt;,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;"x"&lt;/SPAN&gt;&lt;SPAN class=""&gt;:&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class=""&gt;{&lt;/SPAN&gt;&lt;SPAN class=""&gt;"field"&lt;/SPAN&gt;&lt;SPAN class=""&gt;:&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class=""&gt;"Cylinders"&lt;/SPAN&gt;&lt;SPAN class=""&gt;,&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class=""&gt;"type"&lt;/SPAN&gt;&lt;SPAN class=""&gt;:&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class=""&gt;"ordinal"&lt;/SPAN&gt;&lt;SPAN class=""&gt;}&lt;/SPAN&gt;&lt;SPAN class=""&gt;,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;"color"&lt;/SPAN&gt;&lt;SPAN class=""&gt;:&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class=""&gt;{&lt;/SPAN&gt;&lt;SPAN class=""&gt;"aggregate"&lt;/SPAN&gt;&lt;SPAN class=""&gt;:&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class=""&gt;"mean"&lt;/SPAN&gt;&lt;SPAN class=""&gt;,&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class=""&gt;"field"&lt;/SPAN&gt;&lt;SPAN class=""&gt;:&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class=""&gt;"Horsepower"&lt;/SPAN&gt;&lt;SPAN class=""&gt;}&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class=""&gt;}&lt;/SPAN&gt;&lt;SPAN class=""&gt;,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;"config"&lt;/SPAN&gt;&lt;SPAN class=""&gt;:&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class=""&gt;{&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class=""&gt;"axis"&lt;/SPAN&gt;&lt;SPAN class=""&gt;:&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class=""&gt;{&lt;/SPAN&gt;&lt;SPAN class=""&gt;"grid"&lt;/SPAN&gt;&lt;SPAN class=""&gt;:&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class=""&gt;true&lt;/SPAN&gt;&lt;SPAN class=""&gt;,&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class=""&gt;"tickBand"&lt;/SPAN&gt;&lt;SPAN class=""&gt;:&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class=""&gt;"extent"&lt;/SPAN&gt;&lt;SPAN class=""&gt;}&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;}&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class=""&gt;}&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;Thanks in advance&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 19 Jan 2023 11:02:15 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Custom-Visuals-Development/Deneb-Vega-Lite-Color-Gradient-Per-Category/m-p/3030991#M6600</guid>
      <dc:creator>DW868990</dc:creator>
      <dc:date>2023-01-19T11:02:15Z</dc:date>
    </item>
    <item>
      <title>Re: Deneb - Vega Lite Color Gradient Per Category</title>
      <link>https://community.fabric.microsoft.com/t5/Custom-Visuals-Development/Deneb-Vega-Lite-Color-Gradient-Per-Category/m-p/3031720#M6601</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/421796"&gt;@DW868990&lt;/a&gt;. Not quite sure if this is what you're after (see below), this implementation utilizes faceting. If it is, consider marking this as the solution. If not, could you please clarify what you mean? I'm making the assumption that you want your category to be &lt;EM&gt;Cylinders&lt;/EM&gt;.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="mgiammaria_0-1674141532570.png" style="width: 400px;"&gt;&lt;img src="https://community.fabric.microsoft.com/t5/image/serverpage/image-id/858431i72836FE1CAFBB46A/image-size/medium?v=v2&amp;amp;px=400" role="button" title="mgiammaria_0-1674141532570.png" alt="mgiammaria_0-1674141532570.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;{
  "$schema": "https://vega.github.io/schema/vega-lite/v5.json",
  "data": {"url": "data/cars.json"},
  "transform": [
    {
      "aggregate": [{"op": "count", "as": "num_cars"}],
      "groupby": ["Origin", "Cylinders"]
    },
    {
      "window": [{"field": "num_cars", "op": "average", "as": "avg num_cars"}],
      "groupby": ["Cylinders"],
      "frame": [null, null]
    },
    {
      "window": [
        {"field": "num_cars", "op": "count", "as": "record ct per cylinders"}
      ],
      "groupby": ["Cylinders"],
      "frame": [null, null]
    },
    {
      "calculate": "((datum['num_cars']-datum['avg num_cars']))",
      "as": "variance"
    },
    {
      "sort": [
        {"field": "Cylinders"},
        {"field": "num_Cars", "order": "descending"}
      ]
    }
  ],
  "facet": {"column": {"field": "Cylinders", "title": null}},
  "title": {
    "text": "Count of Cars per Cylinder per Origin",
    "orient": "top",
    "anchor": "middle"
  },
  "spec": {
    "encoding": {
      "y": {"field": "Origin", "type": "ordinal"},
      "x": {"field": "Cylinders", "type": "ordinal", "axis": null}
    },
    "layer": [
      {
        "mark": "rect",
        "encoding": {
          "color": {
            "field": "num_cars",
            "type": "quantitative",
            "legend": {
              "direction": "vertical",
              "orient": "bottom",
              "gradientLength": 100,
              "title": null
            }
          }
        }
      },
      {
        "mark": "text",
        "encoding": {
          "text": {"field": "num_cars", "type": "quantitative"},
          "color": {
            "condition": {"test": "datum['variance'] &amp;lt; 0", "value": "black"},
            "value": "white"
          }
        }
      }
    ]
  },
  "resolve": {"scale": {"x": "independent", "color": "independent"}},
  "config": {"axis": {"grid": true, "tickBand": "extent"}}
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 19 Jan 2023 15:21:43 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Custom-Visuals-Development/Deneb-Vega-Lite-Color-Gradient-Per-Category/m-p/3031720#M6601</guid>
      <dc:creator>mgiammaria</dc:creator>
      <dc:date>2023-01-19T15:21:43Z</dc:date>
    </item>
    <item>
      <title>Re: Deneb - Vega Lite Color Gradient Per Category</title>
      <link>https://community.fabric.microsoft.com/t5/Custom-Visuals-Development/Deneb-Vega-Lite-Color-Gradient-Per-Category/m-p/3031752#M6603</link>
      <description>&lt;P&gt;Thank you. Yes its nearly what i am after. Although the category i would be using is Origin in this example.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;So for example say Europe ranged from 1 to 100&lt;BR /&gt;and then USA ranged from 1 to 1000&lt;BR /&gt;&lt;BR /&gt;The color for the highest value for each category would be the same gradient/colour.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for your help.&lt;/P&gt;</description>
      <pubDate>Thu, 19 Jan 2023 15:31:07 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Custom-Visuals-Development/Deneb-Vega-Lite-Color-Gradient-Per-Category/m-p/3031752#M6603</guid>
      <dc:creator>DW868990</dc:creator>
      <dc:date>2023-01-19T15:31:07Z</dc:date>
    </item>
    <item>
      <title>Re: Deneb - Vega Lite Color Gradient Per Category</title>
      <link>https://community.fabric.microsoft.com/t5/Custom-Visuals-Development/Deneb-Vega-Lite-Color-Gradient-Per-Category/m-p/3031785#M6604</link>
      <description>&lt;P&gt;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/421796"&gt;@DW868990&lt;/a&gt;, how about this?&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="giammariam_0-1674142572081.png" style="width: 400px;"&gt;&lt;img src="https://community.fabric.microsoft.com/t5/image/serverpage/image-id/858452i92A3C3716C034398/image-size/medium?v=v2&amp;amp;px=400" role="button" title="giammariam_0-1674142572081.png" alt="giammariam_0-1674142572081.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;{
  "$schema": "https://vega.github.io/schema/vega-lite/v5.json",
  "data": {"url": "data/cars.json"},
  "transform": [
    {
      "aggregate": [{"op": "count", "as": "num_cars"}],
      "groupby": ["Origin", "Cylinders"]
    },
    {
      "window": [{"field": "num_cars", "op": "average", "as": "avg num_cars"}],
      "groupby": ["Origin"],
      "frame": [null, null]
    },
    {
      "window": [
        {"field": "num_cars", "op": "count", "as": "record ct per cylinders"}
      ],
      "groupby": ["Origin"],
      "frame": [null, null]
    },
    {
      "calculate": "((datum['num_cars']-datum['avg num_cars']))",
      "as": "variance"
    },
    {
      "sort": [
        {"field": "Cylinders"},
        {"field": "num_Cars", "order": "descending"}
      ]
    }
  ],
  "facet": {"row": {"field": "Origin", "title": null}},
  "title": {
    "text": "Count of Cars per Cylinder per Origin",
    "orient": "top",
    "anchor": "middle"
  },
  "spec": {
    "encoding": {
      "y": {"field": "Origin", "type": "ordinal", "axis": null},
      "x": {"field": "Cylinders", "type": "ordinal"}
    },
    "layer": [
      {
        "mark": "rect",
        "encoding": {
          "color": {
            "field": "num_cars",
            "type": "quantitative",
            "legend": {
              "direction": "horizontal",
              "orient": "right",
              "gradientLength": 100,
              "title": null
            }
          }
        }
      },
      {
        "mark": "text",
        "encoding": {
          "text": {"field": "num_cars", "type": "quantitative"},
          "color": {
            "condition": {"test": "datum['variance'] &amp;lt; 0", "value": "black"},
            "value": "white"
          }
        }
      }
    ]
  },
  "resolve": {"scale": {"y": "independent", "color": "independent"}},
  "config": {"axis": {"grid": true, "tickBand": "extent"}}
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 19 Jan 2023 15:36:59 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Custom-Visuals-Development/Deneb-Vega-Lite-Color-Gradient-Per-Category/m-p/3031785#M6604</guid>
      <dc:creator>giammariam</dc:creator>
      <dc:date>2023-01-19T15:36:59Z</dc:date>
    </item>
    <item>
      <title>Re: Deneb - Vega Lite Color Gradient Per Category</title>
      <link>https://community.fabric.microsoft.com/t5/Custom-Visuals-Development/Deneb-Vega-Lite-Color-Gradient-Per-Category/m-p/3031828#M6606</link>
      <description>&lt;P&gt;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/124852"&gt;@giammariam&lt;/a&gt;&amp;nbsp; Yes 99% there, aside from in my case its not an aggregation the gradients needs to be based on, its just a value of a measure.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Thanks for your help.&lt;/P&gt;</description>
      <pubDate>Thu, 19 Jan 2023 15:50:51 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Custom-Visuals-Development/Deneb-Vega-Lite-Color-Gradient-Per-Category/m-p/3031828#M6606</guid>
      <dc:creator>DW868990</dc:creator>
      <dc:date>2023-01-19T15:50:51Z</dc:date>
    </item>
    <item>
      <title>Re: Deneb - Vega Lite Color Gradient Per Category</title>
      <link>https://community.fabric.microsoft.com/t5/Custom-Visuals-Development/Deneb-Vega-Lite-Color-Gradient-Per-Category/m-p/3031885#M6607</link>
      <description>&lt;P&gt;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/421796"&gt;@DW868990&lt;/a&gt;,&amp;nbsp;oh wow, apologies. It was so similar to an example on the vega-lite page, that I missed what you were actually after. Let me know if this is better. Happy to make additional tweaks if necessary. I took out the text in the boxes to match what you have. Can add it back in though if you like.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;{
  "$schema": "https://vega.github.io/schema/vega-lite/v5.json",
  "data": {"url": "data/cars.json"},
  "facet": {"row": {"field": "Origin", "title": null}},
  "title": {
    "text": "Mean Horsepower per Cylinder per Origin",
    "orient": "top",
    "anchor": "middle"
  },
  "spec": {
    "encoding": {
      "y": {"field": "Origin", "type": "ordinal", "axis": null},
      "x": {"field": "Cylinders", "type": "ordinal"}
    },
    "layer": [
      {
        "mark": "rect",
        "encoding": {
          "color": {
            "field": "Horsepower",
            "aggregate": "average",
            "type": "quantitative",
            "legend": {
              "direction": "horizontal",
              "orient": "right",
              "gradientLength": 100,
              "title": null
            }
          }
        }
      }
    ]
  },
  "resolve": {"scale": {"y": "independent", "color": "independent"}},
  "config": {"axis": {"grid": true, "tickBand": "extent"}}
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="giammariam_0-1674144319383.png" style="width: 400px;"&gt;&lt;img src="https://community.fabric.microsoft.com/t5/image/serverpage/image-id/858475i7DBF1C271B864612/image-size/medium?v=v2&amp;amp;px=400" role="button" title="giammariam_0-1674144319383.png" alt="giammariam_0-1674144319383.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 19 Jan 2023 16:21:25 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Custom-Visuals-Development/Deneb-Vega-Lite-Color-Gradient-Per-Category/m-p/3031885#M6607</guid>
      <dc:creator>giammariam</dc:creator>
      <dc:date>2023-01-19T16:21:25Z</dc:date>
    </item>
    <item>
      <title>Re: Deneb - Vega Lite Color Gradient Per Category</title>
      <link>https://community.fabric.microsoft.com/t5/Custom-Visuals-Development/Deneb-Vega-Lite-Color-Gradient-Per-Category/m-p/3031950#M6608</link>
      <description>&lt;P&gt;Fantastic, this is exactly what i was after, thank you.&lt;/P&gt;</description>
      <pubDate>Thu, 19 Jan 2023 16:27:39 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Custom-Visuals-Development/Deneb-Vega-Lite-Color-Gradient-Per-Category/m-p/3031950#M6608</guid>
      <dc:creator>DW868990</dc:creator>
      <dc:date>2023-01-19T16:27:39Z</dc:date>
    </item>
    <item>
      <title>Re: Deneb - Vega Lite Color Gradient Per Category</title>
      <link>https://community.fabric.microsoft.com/t5/Custom-Visuals-Development/Deneb-Vega-Lite-Color-Gradient-Per-Category/m-p/3032044#M6609</link>
      <description>&lt;P&gt;No problem. Thanks for sticking by through the iterations. Happy to help and get some Deneb practice in. Feel free to&amp;nbsp;@ me in any deneb related questions you have in the future.&lt;/P&gt;</description>
      <pubDate>Thu, 19 Jan 2023 16:48:59 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Custom-Visuals-Development/Deneb-Vega-Lite-Color-Gradient-Per-Category/m-p/3032044#M6609</guid>
      <dc:creator>giammariam</dc:creator>
      <dc:date>2023-01-19T16:48:59Z</dc:date>
    </item>
    <item>
      <title>Re: Deneb - Vega Lite Color Gradient Per Category</title>
      <link>https://community.fabric.microsoft.com/t5/Custom-Visuals-Development/Deneb-Vega-Lite-Color-Gradient-Per-Category/m-p/3186710#M7316</link>
      <description>&lt;P&gt;Hi, how do you do this in Powerbi? I've not worked with Deneb before&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 13 Apr 2023 15:34:10 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Custom-Visuals-Development/Deneb-Vega-Lite-Color-Gradient-Per-Category/m-p/3186710#M7316</guid>
      <dc:creator>TheBIGuy_PBI</dc:creator>
      <dc:date>2023-04-13T15:34:10Z</dc:date>
    </item>
    <item>
      <title>Re: Deneb - Vega Lite Color Gradient Per Category</title>
      <link>https://community.fabric.microsoft.com/t5/Custom-Visuals-Development/Deneb-Vega-Lite-Color-Gradient-Per-Category/m-p/3186768#M7317</link>
      <description>&lt;P&gt;Hi, looking at this question, I'm trying to create a similar image, but using one color.&lt;BR /&gt;Is there a way to duplicate the chart on the right, and if so, how?&lt;BR /&gt;Is Deneb the key to doing this?&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="TheBIGuy_PBI_0-1681401240863.png" style="width: 400px;"&gt;&lt;img src="https://community.fabric.microsoft.com/t5/image/serverpage/image-id/901318iD233863EBD9B0E08/image-size/medium?v=v2&amp;amp;px=400" role="button" title="TheBIGuy_PBI_0-1681401240863.png" alt="TheBIGuy_PBI_0-1681401240863.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 13 Apr 2023 15:54:29 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Custom-Visuals-Development/Deneb-Vega-Lite-Color-Gradient-Per-Category/m-p/3186768#M7317</guid>
      <dc:creator>TheBIGuy_PBI</dc:creator>
      <dc:date>2023-04-13T15:54:29Z</dc:date>
    </item>
    <item>
      <title>Re: Deneb - Vega Lite Color Gradient Per Category</title>
      <link>https://community.fabric.microsoft.com/t5/Custom-Visuals-Development/Deneb-Vega-Lite-Color-Gradient-Per-Category/m-p/3186792#M7318</link>
      <description>&lt;P&gt;Hey&amp;nbsp;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/444812"&gt;@TheBIGuy_PBI&lt;/a&gt;, this could definitely be accomplished with Deneb, but the &lt;A href="https://learn.microsoft.com/en-us/power-bi/visuals/power-bi-visualization-filled-maps-choropleths?tabs=powerbi-desktop" target="_self"&gt;Filled map&lt;/A&gt; core visual should suffice.&lt;/P&gt;</description>
      <pubDate>Thu, 13 Apr 2023 16:00:14 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Custom-Visuals-Development/Deneb-Vega-Lite-Color-Gradient-Per-Category/m-p/3186792#M7318</guid>
      <dc:creator>giammariam</dc:creator>
      <dc:date>2023-04-13T16:00:14Z</dc:date>
    </item>
  </channel>
</rss>

