<?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 Custom Object Formatting in Developer</title>
    <link>https://community.fabric.microsoft.com/t5/Developer/Custom-Object-Formatting/m-p/988078#M22784</link>
    <description>&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried searching for this topic thinking it would be popoular. I just couldn't nail the keywords correctly and nothing comes up.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My question is, when you build a custom visual, is there a way to dynamic populate the formatting tab so that you can create some settings/formatting around them? For example, in the diagram below, the data color for each data node can be changed individually.&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="CustomFormatting.jpg" style="width: 185px;"&gt;&lt;img src="https://community.fabric.microsoft.com/t5/image/serverpage/image-id/249027i3743E31649F483C7/image-size/large?v=v2&amp;amp;px=999" role="button" title="CustomFormatting.jpg" alt="CustomFormatting.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is this possible in custom visual? Thank you.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Kenneth&lt;/P&gt;</description>
    <pubDate>Tue, 24 Mar 2020 05:05:56 GMT</pubDate>
    <dc:creator>KennethWang</dc:creator>
    <dc:date>2020-03-24T05:05:56Z</dc:date>
    <item>
      <title>Custom Object Formatting</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Custom-Object-Formatting/m-p/988078#M22784</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried searching for this topic thinking it would be popoular. I just couldn't nail the keywords correctly and nothing comes up.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My question is, when you build a custom visual, is there a way to dynamic populate the formatting tab so that you can create some settings/formatting around them? For example, in the diagram below, the data color for each data node can be changed individually.&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="CustomFormatting.jpg" style="width: 185px;"&gt;&lt;img src="https://community.fabric.microsoft.com/t5/image/serverpage/image-id/249027i3743E31649F483C7/image-size/large?v=v2&amp;amp;px=999" role="button" title="CustomFormatting.jpg" alt="CustomFormatting.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is this possible in custom visual? Thank you.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Kenneth&lt;/P&gt;</description>
      <pubDate>Tue, 24 Mar 2020 05:05:56 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Custom-Object-Formatting/m-p/988078#M22784</guid>
      <dc:creator>KennethWang</dc:creator>
      <dc:date>2020-03-24T05:05:56Z</dc:date>
    </item>
    <item>
      <title>Re: Custom Object Formatting</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Custom-Object-Formatting/m-p/989538#M22801</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/159589"&gt;@KennethWang&lt;/a&gt;&lt;/P&gt;
&lt;P&gt;This is possible in custom visuals - &lt;A href="https://github.com/microsoft/PowerBI-visuals-sampleBarChart/blob/master/Tutorial/DataBoundObjects.md" target="_self"&gt;there is a specific portion of the tutorial in the sample bar chart repo for it&lt;/A&gt;, and this is pretty much the scenario you've added the image for.&lt;/P&gt;
&lt;P&gt;This is all covered in the example in more detail but in short, you need to do the following:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Define a template object in your &lt;FONT face="courier new,courier"&gt;capabilities.json&lt;/FONT&gt; you can use for each value.&lt;/LI&gt;
&lt;LI&gt;Add a property to your view model for each category's colour.&lt;/LI&gt;
&lt;LI&gt;Create &lt;FONT face="courier new,courier"&gt;selectionIds&lt;/FONT&gt; for the items you want to appear in the properties pane (&lt;A href="https://docs.microsoft.com/en-nz/power-bi/developer/visuals/selection-api" target="_self"&gt;more about selection&lt;/A&gt;) when mapping your view model.&lt;/LI&gt;
&lt;LI&gt;Also, when mapping your view model, you need to set the colour by looking in the dataView for any stored values based on this selectionId. If there is nothing found (which there typically won't be the first time), then this needs to be assigned a suitable default.&lt;/LI&gt;
&lt;LI&gt;In your &lt;FONT face="courier new,courier"&gt;enumerateObjectInstances&lt;/FONT&gt; method (in &lt;FONT face="courier new,courier"&gt;visual.ts&lt;/FONT&gt;), you need to iterate through your categories from your view model and create colour pickers based on the vales set in your view model mapping, and use the template object defined in your &lt;FONT face="courier new,courier"&gt;capabilities.json&lt;/FONT&gt; above. Each one needs the &lt;FONT face="courier new,courier"&gt;selectionId&lt;/FONT&gt; also, so it knows where to store the value to in the dataView when the user sets it in the properties pane.&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;If this is all set up accordingly, the colour should be stored in the &lt;FONT face="courier new,courier"&gt;dataView&lt;/FONT&gt; and retrieved correctly for subsequent updates. If the colour changes back after selection, then there is an issue with the &lt;FONT face="courier new,courier"&gt;selectionId&lt;/FONT&gt; and you might need to review this to get it to work.&lt;/P&gt;
&lt;P&gt;Good luck!&lt;/P&gt;
&lt;P&gt;Daniel&lt;/P&gt;</description>
      <pubDate>Tue, 24 Mar 2020 19:02:36 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Custom-Object-Formatting/m-p/989538#M22801</guid>
      <dc:creator>dm-p</dc:creator>
      <dc:date>2020-03-24T19:02:36Z</dc:date>
    </item>
    <item>
      <title>Re: Custom Object Formatting</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Custom-Object-Formatting/m-p/997898#M22869</link>
      <description>&lt;P&gt;Thank you!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I can't mention enough how much that has helped. It took me a while to get through your points layers by layers and also with reference to the bar chart. I also fell into the SelectionID issue as you have foresighted, mainly because I have multiple Categories and also processed the categories in a way different from the usual bar charts.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You are awesome!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Kenneth&lt;/P&gt;</description>
      <pubDate>Mon, 30 Mar 2020 07:24:46 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Custom-Object-Formatting/m-p/997898#M22869</guid>
      <dc:creator>KennethWang</dc:creator>
      <dc:date>2020-03-30T07:24:46Z</dc:date>
    </item>
  </channel>
</rss>

