<?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: Using containers in a Custom Visual in Developer</title>
    <link>https://community.fabric.microsoft.com/t5/Developer/Using-containers-in-a-Custom-Visual/m-p/727919#M19830</link>
    <description>&lt;P&gt;Hi there,&lt;/P&gt;&lt;P&gt;Are you looking to have a dropdown to display the measures in your visual and then display properties based on selection, kind of like the core visuals? &lt;A href="https://community.powerbi.com/t5/Custom-Visuals-Development/Dynamically-generate-enumeration-object/td-p/344962" target="_self"&gt;If so, last time this asked, it wasn't supported&lt;/A&gt;.&lt;/P&gt;&lt;P&gt;However... I do see that &lt;A href="https://github.com/microsoft/PowerBI-visuals-PowerKPI" target="_self"&gt;Power KPI is open source now&lt;/A&gt;, and this may have some of the functionality you're after. I agree that an example of this would be very helpful!&lt;/P&gt;&lt;P&gt;I don't have a lot of time to dive fully into this right now and I've been saving such an activity for a rainy day. I've done a quick analysis and followed some breadcrumbs in the code and this might guide you in the right direction:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;The Line menu has a measure selector, but that enum is &lt;A href="https://github.com/microsoft/PowerBI-visuals-PowerKPI/blob/master/capabilities.json#L1166" target="_self"&gt;not defined in the capabilities for that menu&lt;/A&gt;.&lt;/LI&gt;&lt;LI&gt;The &lt;FONT face="courier new,courier"&gt;settings.ts&lt;/FONT&gt; definition for the &lt;FONT face="courier new,courier"&gt;line&lt;/FONT&gt; menu points to the &lt;FONT face="courier new,courier"&gt;&lt;A href="https://github.com/microsoft/PowerBI-visuals-PowerKPI/blob/master/src/settings/descriptors/lineDescriptor.ts" target="_self"&gt;LineDescriptor&lt;/A&gt;&lt;/FONT&gt; class, which extends from the &lt;FONT face="courier new,courier"&gt;&lt;A href="https://github.com/microsoft/PowerBI-visuals-PowerKPI/blob/master/src/settings/descriptors/descriptor.ts" target="_self"&gt;BaseDescriptor&lt;/A&gt;&lt;/FONT&gt; class.&lt;/LI&gt;&lt;LI&gt;&lt;A href="https://github.com/microsoft/PowerBI-visuals-PowerKPI/blob/master/src/visual.ts#L255" target="_self"&gt;This portion of the visual settings processing&lt;/A&gt; looks like it assigns the values to the dropdown and then the subsequent &lt;FONT face="courier new,courier"&gt;&lt;A href="https://github.com/microsoft/PowerBI-visuals-PowerKPI/blob/master/src/visual.ts#L314" target="_self"&gt;enumerateSettingsDeep()&lt;/A&gt;&lt;/FONT&gt; and &lt;FONT face="courier new,courier"&gt;&lt;A href="https://github.com/microsoft/PowerBI-visuals-PowerKPI/blob/master/src/visual.ts#L297" target="_self"&gt;applySettings()&lt;/A&gt;&lt;/FONT&gt; calls apply this to the properties pane.&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;I hope that this might be helpful in some capacity, and if you get moving, let us know how you get on! It would be great to see if someone else is able to get this stuff working.&lt;/P&gt;&lt;P&gt;Good luck,&lt;/P&gt;&lt;P&gt;Daniel&lt;/P&gt;</description>
    <pubDate>Sun, 30 Jun 2019 20:23:43 GMT</pubDate>
    <dc:creator>dm-p</dc:creator>
    <dc:date>2019-06-30T20:23:43Z</dc:date>
    <item>
      <title>Using containers in a Custom Visual</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Using-containers-in-a-Custom-Visual/m-p/727874#M19829</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I am currently trying to use containers to group properties per measure group.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Unfortunately, I can see the dropdown on the properties pane but its empty... nothing gets assigned to it.&lt;/P&gt;&lt;P&gt;Anyone using this feature that could provide an example? It would be great to have this sample on the documentation.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Regards&lt;/P&gt;&lt;P&gt;LS&lt;/P&gt;</description>
      <pubDate>Sun, 30 Jun 2019 12:15:59 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Using-containers-in-a-Custom-Visual/m-p/727874#M19829</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-06-30T12:15:59Z</dc:date>
    </item>
    <item>
      <title>Re: Using containers in a Custom Visual</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Using-containers-in-a-Custom-Visual/m-p/727919#M19830</link>
      <description>&lt;P&gt;Hi there,&lt;/P&gt;&lt;P&gt;Are you looking to have a dropdown to display the measures in your visual and then display properties based on selection, kind of like the core visuals? &lt;A href="https://community.powerbi.com/t5/Custom-Visuals-Development/Dynamically-generate-enumeration-object/td-p/344962" target="_self"&gt;If so, last time this asked, it wasn't supported&lt;/A&gt;.&lt;/P&gt;&lt;P&gt;However... I do see that &lt;A href="https://github.com/microsoft/PowerBI-visuals-PowerKPI" target="_self"&gt;Power KPI is open source now&lt;/A&gt;, and this may have some of the functionality you're after. I agree that an example of this would be very helpful!&lt;/P&gt;&lt;P&gt;I don't have a lot of time to dive fully into this right now and I've been saving such an activity for a rainy day. I've done a quick analysis and followed some breadcrumbs in the code and this might guide you in the right direction:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;The Line menu has a measure selector, but that enum is &lt;A href="https://github.com/microsoft/PowerBI-visuals-PowerKPI/blob/master/capabilities.json#L1166" target="_self"&gt;not defined in the capabilities for that menu&lt;/A&gt;.&lt;/LI&gt;&lt;LI&gt;The &lt;FONT face="courier new,courier"&gt;settings.ts&lt;/FONT&gt; definition for the &lt;FONT face="courier new,courier"&gt;line&lt;/FONT&gt; menu points to the &lt;FONT face="courier new,courier"&gt;&lt;A href="https://github.com/microsoft/PowerBI-visuals-PowerKPI/blob/master/src/settings/descriptors/lineDescriptor.ts" target="_self"&gt;LineDescriptor&lt;/A&gt;&lt;/FONT&gt; class, which extends from the &lt;FONT face="courier new,courier"&gt;&lt;A href="https://github.com/microsoft/PowerBI-visuals-PowerKPI/blob/master/src/settings/descriptors/descriptor.ts" target="_self"&gt;BaseDescriptor&lt;/A&gt;&lt;/FONT&gt; class.&lt;/LI&gt;&lt;LI&gt;&lt;A href="https://github.com/microsoft/PowerBI-visuals-PowerKPI/blob/master/src/visual.ts#L255" target="_self"&gt;This portion of the visual settings processing&lt;/A&gt; looks like it assigns the values to the dropdown and then the subsequent &lt;FONT face="courier new,courier"&gt;&lt;A href="https://github.com/microsoft/PowerBI-visuals-PowerKPI/blob/master/src/visual.ts#L314" target="_self"&gt;enumerateSettingsDeep()&lt;/A&gt;&lt;/FONT&gt; and &lt;FONT face="courier new,courier"&gt;&lt;A href="https://github.com/microsoft/PowerBI-visuals-PowerKPI/blob/master/src/visual.ts#L297" target="_self"&gt;applySettings()&lt;/A&gt;&lt;/FONT&gt; calls apply this to the properties pane.&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;I hope that this might be helpful in some capacity, and if you get moving, let us know how you get on! It would be great to see if someone else is able to get this stuff working.&lt;/P&gt;&lt;P&gt;Good luck,&lt;/P&gt;&lt;P&gt;Daniel&lt;/P&gt;</description>
      <pubDate>Sun, 30 Jun 2019 20:23:43 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Using-containers-in-a-Custom-Visual/m-p/727919#M19830</guid>
      <dc:creator>dm-p</dc:creator>
      <dc:date>2019-06-30T20:23:43Z</dc:date>
    </item>
    <item>
      <title>Re: Using containers in a Custom Visual</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Using-containers-in-a-Custom-Visual/m-p/728170#M19835</link>
      <description>&lt;P&gt;Indeed, my last attempt of dynamic dropdowns failed as I do believe it is still not supported: the result of the&amp;nbsp;&lt;SPAN&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;enumerateObjectInstances &lt;/FONT&gt;&lt;/STRONG&gt;method doesn't parse metadata and dropdowns are defined as static metadata &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But you can create a loop to populate the same settings for multiple field values. I have create a method(s) to do this like this one:&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;PRE&gt;public dataShapesEnumerateObjectInstances(dataPoints: ChartDataPoint[]): VisualObjectInstance[] {
    let instances: VisualObjectInstance[] = [];
    dataPoints.forEach((dataPoint: chartDataPoint, index: number) =&amp;gt; {
        instances.push({
            displayName: `${dataPoint.label} - line size`,
            objectName: "shapes",
            selector: { id: index.toString(), metadata: undefined },
            properties: {
                strokeWidth: dataPoint.lineSize
            }
        });
        instances.push({
            displayName: `${dataPoint.label} - line type`,
            objectName: "shapes",
            selector: { id: index.toString(), metadata: undefined },
            properties: {
                lineStyle: dataPoint.lineStyle // defined as enum inline with capabilities.json
            }
        });
    });
    return instances;
}&lt;/PRE&gt;&lt;P&gt;Call it in&amp;nbsp;&lt;STRONG&gt;&lt;SPAN&gt;&lt;FONT face="courier new,courier"&gt;enumerateObjectInstances&lt;/FONT&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;via&amp;nbsp;&lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;&lt;SPAN&gt;instances&lt;/SPAN&gt; &lt;SPAN&gt;=&lt;/SPAN&gt; &lt;SPAN&gt;this&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;dataColorsEnumerateObjectInstances&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;this&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;data&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;dataPoints&lt;/SPAN&gt;&lt;SPAN&gt;);&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;And define the metadata in capbilities.json:&lt;/DIV&gt;&lt;DIV&gt;&lt;PRE&gt;"shapes": {
    "displayName": "Shapes",
    "properties": {
        "strokeWidth": {
            "displayName": "Stroke size",
            "type": {
                "numeric": true
            }
        },
        "lineStyle": {
            "displayName": "Line style",
            "type" : {
                "enumeration": [
                    {
                        "value": "0",
                        "displayName": "Dashed"
                    },
                    {
                        "value": "1",
                        "displayName": "Solid"
                    },
                    {
                        "value": "2",
                        "displayName": "Dotted"
                    }
                ]
            }
        }
    }
}&lt;/PRE&gt;This should result in a (long) list of the same properties grouped per field value, in your case the content of the calculation groups.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;-JP&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Mon, 01 Jul 2019 07:28:56 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Using-containers-in-a-Custom-Visual/m-p/728170#M19835</guid>
      <dc:creator>jppp</dc:creator>
      <dc:date>2019-07-01T07:28:56Z</dc:date>
    </item>
    <item>
      <title>Re: Using containers in a Custom Visual</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Using-containers-in-a-Custom-Visual/m-p/728262#M19836</link>
      <description>&lt;P&gt;&lt;A href="https://community.powerbi.com/t5/Custom-Visuals-Ideas/Dynamic-Enumeration-and-Property-Groups/idi-p/728260#M357" target="_self"&gt;I've created an idea for this&lt;/A&gt;, as there didn't seem to be one already. Not sure if it will get any traction, but if you'd like to vote, go nuts!&lt;/P&gt;</description>
      <pubDate>Mon, 01 Jul 2019 08:33:07 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Using-containers-in-a-Custom-Visual/m-p/728262#M19836</guid>
      <dc:creator>dm-p</dc:creator>
      <dc:date>2019-07-01T08:33:07Z</dc:date>
    </item>
  </channel>
</rss>

