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
Dora
Helper II
Helper II

Custom Visual Issue

Dear All,

 

I want to make a gauge with changing a backgroud image and test it should also chage the values,I am currently developing my visual.My code is as follows,there is no compile error.But arc is not appearing in power bi. visual1.png

And also are there any easy way to develop my code.since I am new to typescript.Please help.

Best Regards,

Dora

3 REPLIES 3
az2451
Resolver I
Resolver I

You have to use the update method

 

 public update(options: VisualUpdateOptions) {

var xAxis = d3.svg.axis()
				this.g
				.append('g')
				.attr("class", "x axis")
				.attr("transform", "translate(0," + gHeight + ")") 
				.style("opacity", (settings.generalView.opacity/100))
				.call(d3.svg.axis().scale(x).orient("bottom"));

var yAxis = d3.svg.axis()
				this.g
				.append('g')
				.attr("class", "y axis")
				.style("opacity", (settings.generalView.opacity/100))
				.call(d3.svg.axis().scale(y).orient("left")); 

.....
}

your constructor will look like this

 

 constructor(options: VisualConstructorOptions) {
	
			this.svg = d3.select(options.element).append('svg'); 
			this.g = this.svg.append('g');

....
}

 

Giving following Error

 

 

c3.PNG

 

You are missing this in your update-method

   let settings = this.chartSettings = viewModel.settings;

 

 

I think this is helpful:

 

https://github.com/Microsoft/PowerBI-visuals-sampleBarChart

 

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.