This is a migrated thread and some comments may be shown as answers.

How do I make dataviz.diagram.TextBlock text bold?

2 Answers 319 Views
Diagram
This is a migrated thread and some comments may be shown as answers.
Maksim
Top achievements
Rank 1
Maksim asked on 22 Mar 2016, 06:32 AM

I am using kendo diagram with visualTemplate 
http://demos.telerik.com/kendo-ui/diagram/index

I need to write name with bold font 

g.append(new dataviz.diagram.TextBlock({
    text: textBlock.label,
    x: textBlock.x,
    y: textBlock.y,
    bold: true // <--- ???
}));

and job title using normal font
What are workarounds?

2 Answers, 1 is accepted

Sort by
0
Maksim
Top achievements
Rank 1
answered on 23 Mar 2016, 06:20 AM

I've used Arial Black as "bold" font.

Another workaround for now are to set it to the fontSize or to set the font to the drawing element - example

0
Vessy
Telerik team
answered on 24 Mar 2016, 10:21 AM
Hi Maksim,

Thank you for contacting us. The best option to style the content of the shape is exactly by adding a TextBlock through a Visual template and styling it after that in the way found by you. 

The only other possible approach I can suggest you in ccase you want to bold the text content of all shapes is to use a similar CSS styles:
#diagram svg text
{
    font-weight: 900 !important;
}

Regards,
Vessy
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
Tags
Diagram
Asked by
Maksim
Top achievements
Rank 1
Answers by
Maksim
Top achievements
Rank 1
Vessy
Telerik team
Share this question
or