<?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 DIY Gradient Bar Chart by DAX+SVG in Custom Visuals Development Discussion</title>
    <link>https://community.fabric.microsoft.com/t5/Custom-Visuals-Development/DIY-Gradient-Bar-Chart-by-DAX-SVG/m-p/2090780#M3939</link>
    <description>&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="wujunmin_0-1632298769380.png" style="width: 400px;"&gt;&lt;img src="https://community.fabric.microsoft.com/t5/image/serverpage/image-id/598369i5A0265A166A6820D/image-size/medium?v=v2&amp;amp;px=400" role="button" title="wujunmin_0-1632298769380.png" alt="wujunmin_0-1632298769380.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Measure:&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Bar = 
VAR CityCount =
    DISTINCTCOUNT ( 'table'[city] )
VAR Height =30
VAR MaxSales =
    MAXX ( ALLSELECTED('table'), [revenue] ) / 300
VAR Color=
"&amp;lt;defs&amp;gt;
    &amp;lt;LinearGradient id='wu'&amp;gt;
        &amp;lt;Stop offset='0%' style='stop-color:White'/&amp;gt;
        &amp;lt;Stop offset='100%' style='stop-color:DarkCyan'/&amp;gt;
    &amp;lt;/LinearGradient&amp;gt;
&amp;lt;/defs&amp;gt;"
VAR BarTable =
    ADDCOLUMNS (
        SUMMARIZE (
            'table',
            'table'[city],
            "index", RANKX ( ALLSELECTED ( 'table' ), [revenue],,, DENSE )
        ),
        "Rect",
            "&amp;lt;rect x='0' y='" &amp;amp; ( [index] - 1 ) * Height &amp;amp; "' width='" &amp;amp; [revenue] / MaxSales &amp;amp; "' height='" &amp;amp; Height-2 &amp;amp; " ' rx='15' ry='15' fill='url(#wu)' /&amp;gt;",
        "Text",
            "&amp;lt;text x='2' y='"
                &amp;amp; ( [index] - 1 ) * Height
                    + INT ( Height * 0.6 ) &amp;amp; "' fill='black' text-anchor='left' font-size='"
                &amp;amp; INT ( Height * 0.6 ) &amp;amp; "' &amp;gt;" &amp;amp; [city] &amp;amp; "["
                &amp;amp; ROUND ( [revenue], 0 ) &amp;amp; "]" &amp;amp; "&amp;lt;/text&amp;gt;"
    )
VAR Bar =
    CONCATENATEX ( BarTable, [Rect] &amp;amp; [Text] )
VAR SVG = "&amp;lt;svg xmlns='http://www.w3.org/2000/svg' height='"&amp;amp;Height*CityCount&amp;amp;"' width='300' &amp;gt;" &amp;amp;Color&amp;amp; Bar &amp;amp; "&amp;lt;/svg&amp;gt;"
RETURN
    IF ( HASONEVALUE ( 'table'[province] ), SVG, BLANK () )&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 22 Sep 2021 08:24:53 GMT</pubDate>
    <dc:creator>wujunmin</dc:creator>
    <dc:date>2021-09-22T08:24:53Z</dc:date>
    <item>
      <title>DIY Gradient Bar Chart by DAX+SVG</title>
      <link>https://community.fabric.microsoft.com/t5/Custom-Visuals-Development/DIY-Gradient-Bar-Chart-by-DAX-SVG/m-p/2090780#M3939</link>
      <description>&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="wujunmin_0-1632298769380.png" style="width: 400px;"&gt;&lt;img src="https://community.fabric.microsoft.com/t5/image/serverpage/image-id/598369i5A0265A166A6820D/image-size/medium?v=v2&amp;amp;px=400" role="button" title="wujunmin_0-1632298769380.png" alt="wujunmin_0-1632298769380.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Measure:&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Bar = 
VAR CityCount =
    DISTINCTCOUNT ( 'table'[city] )
VAR Height =30
VAR MaxSales =
    MAXX ( ALLSELECTED('table'), [revenue] ) / 300
VAR Color=
"&amp;lt;defs&amp;gt;
    &amp;lt;LinearGradient id='wu'&amp;gt;
        &amp;lt;Stop offset='0%' style='stop-color:White'/&amp;gt;
        &amp;lt;Stop offset='100%' style='stop-color:DarkCyan'/&amp;gt;
    &amp;lt;/LinearGradient&amp;gt;
&amp;lt;/defs&amp;gt;"
VAR BarTable =
    ADDCOLUMNS (
        SUMMARIZE (
            'table',
            'table'[city],
            "index", RANKX ( ALLSELECTED ( 'table' ), [revenue],,, DENSE )
        ),
        "Rect",
            "&amp;lt;rect x='0' y='" &amp;amp; ( [index] - 1 ) * Height &amp;amp; "' width='" &amp;amp; [revenue] / MaxSales &amp;amp; "' height='" &amp;amp; Height-2 &amp;amp; " ' rx='15' ry='15' fill='url(#wu)' /&amp;gt;",
        "Text",
            "&amp;lt;text x='2' y='"
                &amp;amp; ( [index] - 1 ) * Height
                    + INT ( Height * 0.6 ) &amp;amp; "' fill='black' text-anchor='left' font-size='"
                &amp;amp; INT ( Height * 0.6 ) &amp;amp; "' &amp;gt;" &amp;amp; [city] &amp;amp; "["
                &amp;amp; ROUND ( [revenue], 0 ) &amp;amp; "]" &amp;amp; "&amp;lt;/text&amp;gt;"
    )
VAR Bar =
    CONCATENATEX ( BarTable, [Rect] &amp;amp; [Text] )
VAR SVG = "&amp;lt;svg xmlns='http://www.w3.org/2000/svg' height='"&amp;amp;Height*CityCount&amp;amp;"' width='300' &amp;gt;" &amp;amp;Color&amp;amp; Bar &amp;amp; "&amp;lt;/svg&amp;gt;"
RETURN
    IF ( HASONEVALUE ( 'table'[province] ), SVG, BLANK () )&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 22 Sep 2021 08:24:53 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Custom-Visuals-Development/DIY-Gradient-Bar-Chart-by-DAX-SVG/m-p/2090780#M3939</guid>
      <dc:creator>wujunmin</dc:creator>
      <dc:date>2021-09-22T08:24:53Z</dc:date>
    </item>
  </channel>
</rss>

