<?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: developing Custom Visual with Table Data Binding in Developer</title>
    <link>https://community.fabric.microsoft.com/t5/Developer/developing-Custom-Visual-with-Table-Data-Binding/m-p/75129#M2553</link>
    <description>&lt;P&gt;That helps a lot - thank you!&lt;/P&gt;</description>
    <pubDate>Wed, 05 Oct 2016 07:54:48 GMT</pubDate>
    <dc:creator>mpo</dc:creator>
    <dc:date>2016-10-05T07:54:48Z</dc:date>
    <item>
      <title>developing Custom Visual with Table Data Binding</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/developing-Custom-Visual-with-Table-Data-Binding/m-p/74380#M2495</link>
      <description>&lt;P&gt;I am slightly struggling with custom visual development. Any help is very appreciated.&lt;/P&gt;&lt;P&gt;Also asked this on &lt;A href="https://stackoverflow.com/questions/39834786/powerbi-custom-visual-table-data-binding" target="_self"&gt;stackoverflow&lt;/A&gt;.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to change the &lt;A title="sampleBarChart" href="https://github.com/Microsoft/PowerBI-visuals-sampleBarChart" target="_blank"&gt;sampleBarChart&lt;/A&gt; visual to use the "table" data binding instead of "categorical". My first aim is to have a simple table visual, with inputs "X", "Y" and "Value".&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A title="this page" href="https://github.com/Microsoft/PowerBI-visuals-core/wiki/DataView-Introduction" target="_blank"&gt;This wiki page&lt;/A&gt; describes the table data binding, though I cannot find any example visuals which use it and are based on the new API. &lt;STRONG&gt;1) Are there any examples of such visuals?&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;---&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The wiki link above &lt;A href="https://raw.githubusercontent.com/Microsoft/PowerBI-visuals-core/resources/dataview/table_dv_diagram.PNG" target="_self"&gt;shows&lt;/A&gt; that a table object has properties "rows", "columns", "totals" and "identities". So it looks like rows and columns are my indexes and totals are my values?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My data roles:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;        {   "displayName": "Category1 Data",
            "name": "category1",
            "kind": 0},
	{   "displayName": "Category2 Data",
            "name": "category2",
            "kind": 0},
        {   "displayName": "Measure Data",
            "name": "measure",
            "kind": 1}&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Current data view mapping:&lt;/P&gt;&lt;PRE&gt;"table": {
	"rows": {"for": {"in": "category1"}},
	"columns": {"for": {"in": "category2"}},
	"totals": {"select": [{"bind": {"to": "measure"}}]}
	}&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Relevant parts of my visualTransform():&lt;/P&gt;&lt;PRE&gt;    ...
let category1 = categorical.rows;
let category2 = categorical.columns;
let dataValue = categorical.totals;
    ...
for (let i = 0, len = category1.length; i &amp;lt; len; i++) {
for (let j = 0, jlen = category2.length; j &amp;lt; jlen; j++) {
	{
		barChartDataPoints.push({
			category1: i,
			category2: j,
			value: dataValue[i,j],
			color: "#555555"//for now
		});
	}
    ...&lt;/PRE&gt;&lt;P&gt;Test data looks like this:&lt;/P&gt;&lt;PRE&gt;&lt;STRONG&gt;  1 2 3&lt;/STRONG&gt;
&lt;STRONG&gt;1&lt;/STRONG&gt; 4 4 3
&lt;STRONG&gt;2&lt;/STRONG&gt; 4 5 5
&lt;STRONG&gt;3&lt;/STRONG&gt; 3 6 7 (total = 41)&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The code above fills barChartDataPoints with just six data points:&lt;/P&gt;&lt;P&gt;(1; 1; 41),&lt;/P&gt;&lt;P&gt;(1; 2; undefined),&lt;/P&gt;&lt;P&gt;(2; 1; 41),&lt;/P&gt;&lt;P&gt;(2; 2; undefined),&lt;/P&gt;&lt;P&gt;(3; 1; 41),&lt;/P&gt;&lt;P&gt;(3; 2; undefined).&lt;/P&gt;&lt;P&gt;Accessing zero indeces results in nulls.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;2) What am I doing wrong?&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;---&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I don't have a PowerBI account, so have to compile visuals with&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;pbiviz package&lt;/PRE&gt;&lt;P&gt;and import in PowerBI desktop to test. As a result, it's very difficult to debug non-compiler errors - in that case PowerBI displays empty space no matter what data I assign to the visual. As a workaround, I display "window.alert()" and pass it text data I want to view, but this takes a long time and is very limited.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;3) What are some good practices of debugging visuals based on the new API?&lt;/STRONG&gt; (Without having access to powerbi developer tools)&lt;/P&gt;&lt;P&gt;The PowerBI visual playground project seems to be using the old API.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance.&lt;/P&gt;</description>
      <pubDate>Mon, 03 Oct 2016 15:10:08 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/developing-Custom-Visual-with-Table-Data-Binding/m-p/74380#M2495</guid>
      <dc:creator>mpo</dc:creator>
      <dc:date>2016-10-03T15:10:08Z</dc:date>
    </item>
    <item>
      <title>Re: developing Custom Visual with Table Data Binding</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/developing-Custom-Visual-with-Table-Data-Binding/m-p/74693#M2507</link>
      <description>&lt;P&gt;Hey MPO,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;my answer for the&amp;nbsp;&lt;STRONG&gt;first question:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;There are not so many Examples, from the scratch. The API GitHub Page has one.&lt;/P&gt;&lt;P&gt;Some Blogs get Examples too:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://sharepointforum.org/threads/build-your-custom-visuals-in-power-bi-step-by-step.61069/" target="_blank"&gt;https://sharepointforum.org/threads/build-your-custom-visuals-in-power-bi-step-by-step.61069/&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And in the End maybe some Older Custom Visuals from this site:&lt;/P&gt;&lt;P&gt;&lt;A href="https://app.powerbi.com/visuals/" target="_blank"&gt;https://app.powerbi.com/visuals/&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Do you need WinRar or something similiar.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;All this possibilites are not satisfying, the best way is try and error.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;That direct me to&amp;nbsp;the&amp;nbsp;&lt;STRONG&gt;second question:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here you can see, i do not use the columns. Power BI select my three categorys to one and set the two measure values behind them. I need some experiance too and iam not sure that will works for you. But you can try it out and maybe that will help.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;"table":{
                "rows": {
                    "select": [
                        {
                            "for": { "in": "Date"}
                        },
                        {
                            "for": { "in": "ProjectColor"}
                        },
                        {
                            "for": { "in": "ProjectID"}
                        },
                        {
                            "for": { "in": "X"}
                        },
                        {
                            "for": { "in": "Size"}
                        }
                    ]
                }
            }&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When i get a better solution i will post it under your stackoverflow post.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;To your&amp;nbsp;&lt;STRONG&gt;last question:&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;I think without the browser, debugging is very hard. My workaround is the Chrome Javascript Console to debug my Visual.&lt;/P&gt;&lt;P&gt;That would work with the package too.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 04 Oct 2016 08:23:54 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/developing-Custom-Visual-with-Table-Data-Binding/m-p/74693#M2507</guid>
      <dc:creator>Mcburn</dc:creator>
      <dc:date>2016-10-04T08:23:54Z</dc:date>
    </item>
    <item>
      <title>Re: developing Custom Visual with Table Data Binding</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/developing-Custom-Visual-with-Table-Data-Binding/m-p/75129#M2553</link>
      <description>&lt;P&gt;That helps a lot - thank you!&lt;/P&gt;</description>
      <pubDate>Wed, 05 Oct 2016 07:54:48 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/developing-Custom-Visual-with-Table-Data-Binding/m-p/75129#M2553</guid>
      <dc:creator>mpo</dc:creator>
      <dc:date>2016-10-05T07:54:48Z</dc:date>
    </item>
  </channel>
</rss>

