<?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 Re: Deneb - change labelFontWeight for one value in an axis label in Custom Visuals Development Discussion</title>
    <link>https://community.fabric.microsoft.com/t5/Custom-Visuals-Development/Deneb-change-labelFontWeight-for-one-value-in-an-axis-label/m-p/3067078#M6820</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/348255"&gt;@tomwill&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;Fields are not exposed in the &lt;FONT face="courier new,courier"&gt;datum&lt;/FONT&gt; object for an axis label. &lt;A href="https://vega.github.io/vega-lite/docs/axis.html#labels:~:text=Note%3A%20The%20label%20text%20and%20value%20can%20be%20assessed%20via%20the%20label%20and%20value%20properties%20of%20the%20axis%E2%80%99s%20backing%20datum%20object." target="_self"&gt;You have access to either a &lt;FONT face="courier new,courier"&gt;label&lt;/FONT&gt; or &lt;FONT face="courier new,courier"&gt;value&lt;/FONT&gt; property in the backing &lt;FONT face="courier new,courier"&gt;datum&lt;/FONT&gt;&lt;/A&gt; and it's this that you need to inspect in your condition.&lt;/P&gt;
&lt;P&gt;Something like the following should work:&lt;/P&gt;
&lt;LI-CODE lang="javascript"&gt;  "labelFontWeight": {
    "condition": {
      "test": "datum['value'] == 'Global'",
      "value": "bold"
    },
    "value": "normal"
  }&lt;/LI-CODE&gt;
&lt;P&gt;I've replicated this in a chart I have open, specifying that the Wellington label be bold, as per the above approach and this seems as expected, e.g.:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="dmp_0-1675801219693.png" style="width: 400px;"&gt;&lt;img src="https://community.fabric.microsoft.com/t5/image/serverpage/image-id/867862i61D356B6B8B0A20F/image-size/medium?v=v2&amp;amp;px=400" role="button" title="dmp_0-1675801219693.png" alt="dmp_0-1675801219693.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Regards,&lt;/P&gt;
&lt;P&gt;Daniel&lt;/P&gt;</description>
    <pubDate>Tue, 07 Feb 2023 20:20:33 GMT</pubDate>
    <dc:creator>dm-p</dc:creator>
    <dc:date>2023-02-07T20:20:33Z</dc:date>
    <item>
      <title>Deneb - change labelFontWeight for one value in an axis label</title>
      <link>https://community.fabric.microsoft.com/t5/Custom-Visuals-Development/Deneb-change-labelFontWeight-for-one-value-in-an-axis-label/m-p/3066912#M6812</link>
      <description>&lt;P&gt;I have a text field ['Region'] with four values {Global, AMER, APAC, EMEA}. I have a simple bar chart and want the label to be bold only for 'Global'. I tried:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;"encoding": {
    "y": {
      "field": "Region",
      "type": "nominal",
      "axis": {
        "offset": 10,
        "title": null,
       "labelFontWeight": {
         "condition": {"test": "datum['Region'] == 'Global'","value":"bold"},
            "value":"normal"
       }&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;but there is no change to the label font weight. What is interesting is that I switched the result conditions, making the '==Global' "normal" and the else "bold" and it changed font weight on all the labels to bold. That leads me to believe that my condition is never being evaluated as true. Any ideas why? Is what I want to do - changing a signal value in an axis label - possible?&lt;/P&gt;</description>
      <pubDate>Tue, 07 Feb 2023 18:45:08 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Custom-Visuals-Development/Deneb-change-labelFontWeight-for-one-value-in-an-axis-label/m-p/3066912#M6812</guid>
      <dc:creator>tomwill</dc:creator>
      <dc:date>2023-02-07T18:45:08Z</dc:date>
    </item>
    <item>
      <title>Re: Deneb - change labelFontWeight for one value in an axis label</title>
      <link>https://community.fabric.microsoft.com/t5/Custom-Visuals-Development/Deneb-change-labelFontWeight-for-one-value-in-an-axis-label/m-p/3067078#M6820</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/348255"&gt;@tomwill&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;Fields are not exposed in the &lt;FONT face="courier new,courier"&gt;datum&lt;/FONT&gt; object for an axis label. &lt;A href="https://vega.github.io/vega-lite/docs/axis.html#labels:~:text=Note%3A%20The%20label%20text%20and%20value%20can%20be%20assessed%20via%20the%20label%20and%20value%20properties%20of%20the%20axis%E2%80%99s%20backing%20datum%20object." target="_self"&gt;You have access to either a &lt;FONT face="courier new,courier"&gt;label&lt;/FONT&gt; or &lt;FONT face="courier new,courier"&gt;value&lt;/FONT&gt; property in the backing &lt;FONT face="courier new,courier"&gt;datum&lt;/FONT&gt;&lt;/A&gt; and it's this that you need to inspect in your condition.&lt;/P&gt;
&lt;P&gt;Something like the following should work:&lt;/P&gt;
&lt;LI-CODE lang="javascript"&gt;  "labelFontWeight": {
    "condition": {
      "test": "datum['value'] == 'Global'",
      "value": "bold"
    },
    "value": "normal"
  }&lt;/LI-CODE&gt;
&lt;P&gt;I've replicated this in a chart I have open, specifying that the Wellington label be bold, as per the above approach and this seems as expected, e.g.:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="dmp_0-1675801219693.png" style="width: 400px;"&gt;&lt;img src="https://community.fabric.microsoft.com/t5/image/serverpage/image-id/867862i61D356B6B8B0A20F/image-size/medium?v=v2&amp;amp;px=400" role="button" title="dmp_0-1675801219693.png" alt="dmp_0-1675801219693.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Regards,&lt;/P&gt;
&lt;P&gt;Daniel&lt;/P&gt;</description>
      <pubDate>Tue, 07 Feb 2023 20:20:33 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Custom-Visuals-Development/Deneb-change-labelFontWeight-for-one-value-in-an-axis-label/m-p/3067078#M6820</guid>
      <dc:creator>dm-p</dc:creator>
      <dc:date>2023-02-07T20:20:33Z</dc:date>
    </item>
    <item>
      <title>Re: Deneb - change labelFontWeight for one value in an axis label</title>
      <link>https://community.fabric.microsoft.com/t5/Custom-Visuals-Development/Deneb-change-labelFontWeight-for-one-value-in-an-axis-label/m-p/3070266#M6837</link>
      <description>&lt;P&gt;Thanks this worked. Very new to Deneb so still a lot of copy, paste, pray. I had used the&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;"datum['Region']&lt;/PRE&gt;&lt;P&gt;structure to change data labels based on value but must be a difference in how datum works in a 'mark' block vs and 'encoding' block.&lt;/P&gt;</description>
      <pubDate>Wed, 08 Feb 2023 21:17:25 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Custom-Visuals-Development/Deneb-change-labelFontWeight-for-one-value-in-an-axis-label/m-p/3070266#M6837</guid>
      <dc:creator>tomwill</dc:creator>
      <dc:date>2023-02-08T21:17:25Z</dc:date>
    </item>
    <item>
      <title>Re: Deneb - change labelFontWeight for one value in an axis label</title>
      <link>https://community.fabric.microsoft.com/t5/Custom-Visuals-Development/Deneb-change-labelFontWeight-for-one-value-in-an-axis-label/m-p/3070282#M6838</link>
      <description>&lt;P&gt;Glad it worked! Normally you would be correct in your assumption - you would refer to the field in a datum whenever it typically makes sense to do so (i.e. in a mark or most encoding channels), and was a good place to start. I was caught out by this initally, too &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Axes are a special case because they potentially represent the normalisation of multiple series for a category, or could be continuous (and therefore use a different granularity for the number of displayed ticks than there are in your series). As such, the axis labels have their own (simpler) datum structure that is derived from the field you've encoded.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 08 Feb 2023 21:31:42 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Custom-Visuals-Development/Deneb-change-labelFontWeight-for-one-value-in-an-axis-label/m-p/3070282#M6838</guid>
      <dc:creator>dm-p</dc:creator>
      <dc:date>2023-02-08T21:31:42Z</dc:date>
    </item>
  </channel>
</rss>

