<?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: Create Data Labels for Horizontal Bar Chart Custom Visualization in Developer</title>
    <link>https://community.fabric.microsoft.com/t5/Developer/Create-Data-Labels-for-Horizontal-Bar-Chart-Custom-Visualization/m-p/980274#M22740</link>
    <description>&lt;P&gt;In case anyone else has the same question, I thought I would post how I resolved this.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I wasn't able to figure out how to use the labels utility so instead I created my own labels.&amp;nbsp; It is composed of two elements, one being a text element and the other a rectangle (with rounded edges).&amp;nbsp; The positioning is based on the data points and then just offset from there a little bit.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The tricky part was making sure that the labels wouldn't go past an axis or overlap on top of each other.&amp;nbsp; In order to avoid this I put all the required values into lists (i.e. a list of x position, list of y position, list of hieght, etc.).&amp;nbsp; Then I compared the various list values to make sure there wasn't any undesired affects.&amp;nbsp; For example, in my particular case it is a horizontal bar chart and I wanted to make sure the labels did not go to the left of the y-axis.&amp;nbsp; After assigning the x-position for each label to a list variable I checked the label to see if any values were negative.&amp;nbsp; If they were, then I zeroed out all the relevant properties for that label so it would disappear.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Then when I created the labels I iterated over the property lists and merged the results.&amp;nbsp; It seems to work exactly as intended.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hopefully if you have a similar question/problem this is helpful.&lt;/P&gt;</description>
    <pubDate>Wed, 18 Mar 2020 15:42:13 GMT</pubDate>
    <dc:creator>cogsie</dc:creator>
    <dc:date>2020-03-18T15:42:13Z</dc:date>
    <item>
      <title>Create Data Labels for Horizontal Bar Chart Custom Visualization</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Create-Data-Labels-for-Horizontal-Bar-Chart-Custom-Visualization/m-p/959544#M22595</link>
      <description>&lt;P&gt;Does anyone have a simple and basic example for creating data labels on a horizontal bar chart?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am creating a simple custom visualization based on a horizontal bar chart.&amp;nbsp; I would like to add data labels, but I looked at the documentation for the &lt;A href="https://github.com/microsoft/powerbi-visuals-utils-chartutils/blob/master/docs/api/data-label-utils.md" target="_self"&gt;DataLabelUtils&lt;/A&gt;&amp;nbsp;and the&amp;nbsp;DataLabelManager&lt;A href="https://github.com/microsoft/powerbi-visuals-utils-chartutils/blob/master/docs/api/data-label-manager.md" target="_self"&gt;DataLabelManager&lt;/A&gt;&amp;nbsp; but I am having difficulty understanding it.&amp;nbsp; Theoretically, I suppose I could create some SVG elements with the data values in them and have them anchored to the data points, but I was hoping there might be an easier built in way.&amp;nbsp; Also, I really like the collission detection that they have in the DataLabelManager and would love to take advantage of that.&amp;nbsp; Any help you can offer is much appreciated.&amp;nbsp; &amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 05 Mar 2020 01:27:40 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Create-Data-Labels-for-Horizontal-Bar-Chart-Custom-Visualization/m-p/959544#M22595</guid>
      <dc:creator>cogsie</dc:creator>
      <dc:date>2020-03-05T01:27:40Z</dc:date>
    </item>
    <item>
      <title>Re: Create Data Labels for Horizontal Bar Chart Custom Visualization</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Create-Data-Labels-for-Horizontal-Bar-Chart-Custom-Visualization/m-p/980274#M22740</link>
      <description>&lt;P&gt;In case anyone else has the same question, I thought I would post how I resolved this.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I wasn't able to figure out how to use the labels utility so instead I created my own labels.&amp;nbsp; It is composed of two elements, one being a text element and the other a rectangle (with rounded edges).&amp;nbsp; The positioning is based on the data points and then just offset from there a little bit.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The tricky part was making sure that the labels wouldn't go past an axis or overlap on top of each other.&amp;nbsp; In order to avoid this I put all the required values into lists (i.e. a list of x position, list of y position, list of hieght, etc.).&amp;nbsp; Then I compared the various list values to make sure there wasn't any undesired affects.&amp;nbsp; For example, in my particular case it is a horizontal bar chart and I wanted to make sure the labels did not go to the left of the y-axis.&amp;nbsp; After assigning the x-position for each label to a list variable I checked the label to see if any values were negative.&amp;nbsp; If they were, then I zeroed out all the relevant properties for that label so it would disappear.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Then when I created the labels I iterated over the property lists and merged the results.&amp;nbsp; It seems to work exactly as intended.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hopefully if you have a similar question/problem this is helpful.&lt;/P&gt;</description>
      <pubDate>Wed, 18 Mar 2020 15:42:13 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Create-Data-Labels-for-Horizontal-Bar-Chart-Custom-Visualization/m-p/980274#M22740</guid>
      <dc:creator>cogsie</dc:creator>
      <dc:date>2020-03-18T15:42:13Z</dc:date>
    </item>
    <item>
      <title>Re: Create Data Labels for Horizontal Bar Chart Custom Visualization</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Create-Data-Labels-for-Horizontal-Bar-Chart-Custom-Visualization/m-p/2340218#M34418</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/175974"&gt;@cogsie&lt;/a&gt;&amp;nbsp;- I was wondering if you could provide an example of this? I'm trying to achieve something similar and am not sure how to bind text boxes dynamically. Thanks&lt;/P&gt;</description>
      <pubDate>Tue, 15 Feb 2022 17:11:46 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Create-Data-Labels-for-Horizontal-Bar-Chart-Custom-Visualization/m-p/2340218#M34418</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-02-15T17:11:46Z</dc:date>
    </item>
  </channel>
</rss>

