Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
alexisc67
Helper I
Helper I

D3 Custom Visual build a simple table doesn't display

Hi,

 

I need your help to find why the code below doesn't work. I am using the D3 custom visual with PowerBI Desktop. I have created a couple of sample charts with data and they work well. However I have not been able to display a simple table. 

 

The data is loaded and has five columns. The custom visual is blank.

 

The code is below:

 

 

var margin = {top: 20, right: 30, bottom: 30, left: 40},
    width = pbi.width - margin.left - margin.right,
    height = pbi.height - margin.top - margin.bottom;

pbi.dsv(type, function(error, data) {
  	if (error) throw error;
    var table = d3.select("#chart")
    	.append('table');
        
  		tbody = table.append("tbody");

    	var rows = tbody.selectAll("tr")
      		.data(data)
        	.enter()
      		.append("tr");

    	var cells = rows.selectAll("td")
      		.data(function(row) {
          	return d3.range(Object.keys(row).length).map(function(column, i) {
              return row[Object.keys(row)[i]];
          	});
      	})
    	.enter()
      	.append("td")
      	.text(function(d) { return d; });

  });

 

2 REPLIES 2
v-chuncz-msft
Community Support
Community Support

@alexisc67,

 

Here is a forum dedicated to Custom Visuals Development. You could also send an email to pbicvsupport@microsoft.com.

Community Support Team _ Sam Zha
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
alexisc67
Helper I
Helper I

HTML table is not supported. Only svg.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.