Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Hello there,
I am upgrading my custom visuals from 2.6 to 5.3 - a massive leap in one go. One thing I can't get to work is the Alignment Group.
Within
class DataPointCardSettings extends FormattingSettingsCard {
I have the code:
labelAlignment = new formattingSettings.AlignmentGroup({
name: "labelAlignment",
displayName: "Label alignment",
mode: powerbi.visuals.AlignmentGroupMode.Horizonal,
value: { value: "right" }
});
I can't compile. I get the error: Type {value:string} is not assignable to type "string".
I have tried true / false, I have tried blank, but no joy.
I am using settings.ts, because I am modifying and copying code into the circleCard example. The example I have found online appears to change the code in visual.ts only: Customize the format pane in Power BI custom visuals - Power BI | Microsoft Learn
Can I still use both settings.ts and visual.ts, or should I just be using visual.ts?
The code below (taken from the link above) implies you can assign a string of "right" to value. Any ideas? Thanks
Solved! Go to Solution.
Hi @VizDataLtd
I haven't tried implementing the alignment settings in formatting cards yet, but from looking at the error:
Type {value:string} is not assignable to type "string"
This suggests assigning a string to the value property, not an object. Your reference example shows this, too. I would try amending as follows:
labelAlignment = new formattingSettings.AlignmentGroup({
name: "labelAlignment",
displayName: "Label alignment",
mode: powerbi.visuals.AlignmentGroupMode.Horizonal,
value: "right" // string rather than object
});
Regards,
Daniel
Proud to be a Super User!
On how to ask a technical question, if you really want an answer (courtesy of SQLBI)
Hi @VizDataLtd
I haven't tried implementing the alignment settings in formatting cards yet, but from looking at the error:
Type {value:string} is not assignable to type "string"
This suggests assigning a string to the value property, not an object. Your reference example shows this, too. I would try amending as follows:
labelAlignment = new formattingSettings.AlignmentGroup({
name: "labelAlignment",
displayName: "Label alignment",
mode: powerbi.visuals.AlignmentGroupMode.Horizonal,
value: "right" // string rather than object
});
Regards,
Daniel
Proud to be a Super User!
On how to ask a technical question, if you really want an answer (courtesy of SQLBI)
Check out the July 2025 Power BI update to learn about new features.
User | Count |
---|---|
2 | |
2 | |
2 | |
1 | |
1 |