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

3 posts, 0 answers
  1. Maksim
    Maksim avatar
    22 posts
    Member since:
    Apr 2013

    Posted 22 Mar Link to this post

    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. Maksim
    Maksim avatar
    22 posts
    Member since:
    Apr 2013

    Posted 23 Mar in reply to Maksim Link to this post

    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

  3. Kendo UI is VS 2017 Ready
  4. Vessy
    Admin
    Vessy avatar
    1389 posts

    Posted 24 Mar Link to this post

    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!
     
Back to Top