<?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 Need help on custom visual format pane in Developer</title>
    <link>https://community.fabric.microsoft.com/t5/Developer/Need-help-on-custom-visual-format-pane/m-p/3391663#M44021</link>
    <description>&lt;P&gt;Hi all,&lt;BR /&gt;&lt;BR /&gt;I'm currently working on my line chart project with pbi custom visual. Then I stumble upon some problem with customizable line color.&lt;/P&gt;&lt;P&gt;I add color option like this in&amp;nbsp;&lt;EM&gt;capabilities.json&lt;BR /&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="salamandra_0-1692684482986.png" style="width: 400px;"&gt;&lt;img src="https://community.fabric.microsoft.com/t5/image/serverpage/image-id/958460i97BCEC23DDDDCAB5/image-size/medium?v=v2&amp;amp;px=400" role="button" title="salamandra_0-1692684482986.png" alt="salamandra_0-1692684482986.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;and update options according to the data with &lt;EM&gt;getFormattingModel()&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;public getFormattingModel(): powerbiVisualsApi.visuals.FormattingModel {
        const colorSelectorCard: powerbi.visuals.FormattingCard = {
            displayName: "Data Colors",
            uid: "dataColorsCard_uid",
            groups: [
                {
                displayName: undefined,
                uid: "dataColorsCard_group_uid",

                slices: [],
            }
            ]
        };
        if (this.lineDataPoint.length) {
            this.lineDataPoint.forEach((dataPoint, idx) =&amp;gt; {
                (&amp;lt;powerbi.visuals.FormattingGroup&amp;gt;colorSelectorCard.groups[0]).slices.push(
                    {
                        uid: `dataColorsCard_group_colorSelector${idx}_uid`,
                        displayName: dataPoint.category,
                        control: {
                            type: powerbi.visuals.FormattingComponent.ColorPicker,
                            properties: {
                                descriptor: {
                                    objectName: "colorSelector",
                                    propertyName: "fill",
                                    selector: dataViewWildcard.createDataViewWildcardSelector(dataViewWildcard.DataViewWildcardMatchingOption.InstancesAndTotals),
                                    altConstantValueSelector: dataPoint.selectionId.getSelector(),
                                    instanceKind: powerbi.VisualEnumerationInstanceKinds.ConstantOrRule
                                },
                                value: { value: dataPoint.color }
                            }
                        }
                    });
            });

            colorSelectorCard.revertToDefaultDescriptors = [
                {
                    objectName: "colorSelector",
                    propertyName: "fill",
                }
            ];
        }
        return { cards: [ colorSelectorCard ] }
    }&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Options is appear and adjustable as expect (I put in 2 line data).&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="salamandra_1-1692684903432.png" style="width: 400px;"&gt;&lt;img src="https://community.fabric.microsoft.com/t5/image/serverpage/image-id/958464i61C27C8CB345ECF8/image-size/medium?v=v2&amp;amp;px=400" role="button" title="salamandra_1-1692684903432.png" alt="salamandra_1-1692684903432.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Nevetheless, the output objects from&amp;nbsp;&lt;EM&gt;dataViews[0].categorical.categories[0]&amp;nbsp;&lt;/EM&gt; is appear to be in the length of&amp;nbsp; value in categories instead of number of line data (660 instead of 2).&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="salamandra_2-1692685236650.png" style="width: 400px;"&gt;&lt;img src="https://community.fabric.microsoft.com/t5/image/serverpage/image-id/958467i6699F34CA90E6694/image-size/medium?v=v2&amp;amp;px=400" role="button" title="salamandra_2-1692685236650.png" alt="salamandra_2-1692685236650.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This could probably lead to some bug in the future, so I want some help on how to shape the objects data to be equal to number of input line data not the categories length.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
    <pubDate>Tue, 22 Aug 2023 06:28:22 GMT</pubDate>
    <dc:creator>salamandra</dc:creator>
    <dc:date>2023-08-22T06:28:22Z</dc:date>
    <item>
      <title>Need help on custom visual format pane</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Need-help-on-custom-visual-format-pane/m-p/3391663#M44021</link>
      <description>&lt;P&gt;Hi all,&lt;BR /&gt;&lt;BR /&gt;I'm currently working on my line chart project with pbi custom visual. Then I stumble upon some problem with customizable line color.&lt;/P&gt;&lt;P&gt;I add color option like this in&amp;nbsp;&lt;EM&gt;capabilities.json&lt;BR /&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="salamandra_0-1692684482986.png" style="width: 400px;"&gt;&lt;img src="https://community.fabric.microsoft.com/t5/image/serverpage/image-id/958460i97BCEC23DDDDCAB5/image-size/medium?v=v2&amp;amp;px=400" role="button" title="salamandra_0-1692684482986.png" alt="salamandra_0-1692684482986.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;and update options according to the data with &lt;EM&gt;getFormattingModel()&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;public getFormattingModel(): powerbiVisualsApi.visuals.FormattingModel {
        const colorSelectorCard: powerbi.visuals.FormattingCard = {
            displayName: "Data Colors",
            uid: "dataColorsCard_uid",
            groups: [
                {
                displayName: undefined,
                uid: "dataColorsCard_group_uid",

                slices: [],
            }
            ]
        };
        if (this.lineDataPoint.length) {
            this.lineDataPoint.forEach((dataPoint, idx) =&amp;gt; {
                (&amp;lt;powerbi.visuals.FormattingGroup&amp;gt;colorSelectorCard.groups[0]).slices.push(
                    {
                        uid: `dataColorsCard_group_colorSelector${idx}_uid`,
                        displayName: dataPoint.category,
                        control: {
                            type: powerbi.visuals.FormattingComponent.ColorPicker,
                            properties: {
                                descriptor: {
                                    objectName: "colorSelector",
                                    propertyName: "fill",
                                    selector: dataViewWildcard.createDataViewWildcardSelector(dataViewWildcard.DataViewWildcardMatchingOption.InstancesAndTotals),
                                    altConstantValueSelector: dataPoint.selectionId.getSelector(),
                                    instanceKind: powerbi.VisualEnumerationInstanceKinds.ConstantOrRule
                                },
                                value: { value: dataPoint.color }
                            }
                        }
                    });
            });

            colorSelectorCard.revertToDefaultDescriptors = [
                {
                    objectName: "colorSelector",
                    propertyName: "fill",
                }
            ];
        }
        return { cards: [ colorSelectorCard ] }
    }&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Options is appear and adjustable as expect (I put in 2 line data).&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="salamandra_1-1692684903432.png" style="width: 400px;"&gt;&lt;img src="https://community.fabric.microsoft.com/t5/image/serverpage/image-id/958464i61C27C8CB345ECF8/image-size/medium?v=v2&amp;amp;px=400" role="button" title="salamandra_1-1692684903432.png" alt="salamandra_1-1692684903432.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Nevetheless, the output objects from&amp;nbsp;&lt;EM&gt;dataViews[0].categorical.categories[0]&amp;nbsp;&lt;/EM&gt; is appear to be in the length of&amp;nbsp; value in categories instead of number of line data (660 instead of 2).&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="salamandra_2-1692685236650.png" style="width: 400px;"&gt;&lt;img src="https://community.fabric.microsoft.com/t5/image/serverpage/image-id/958467i6699F34CA90E6694/image-size/medium?v=v2&amp;amp;px=400" role="button" title="salamandra_2-1692685236650.png" alt="salamandra_2-1692685236650.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This could probably lead to some bug in the future, so I want some help on how to shape the objects data to be equal to number of input line data not the categories length.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Tue, 22 Aug 2023 06:28:22 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Need-help-on-custom-visual-format-pane/m-p/3391663#M44021</guid>
      <dc:creator>salamandra</dc:creator>
      <dc:date>2023-08-22T06:28:22Z</dc:date>
    </item>
  </channel>
</rss>

