How to change in diagram the TextBlock content

5 posts, 1 answers
  1. Fahd
    Fahd avatar
    5 posts
    Member since:
    Jan 2016

    Posted 25 Jan Link to this post

    Hi, 

    I cant find a method for changing the content of textBlock text appended to a shape. In this demo: http://dojo.telerik.com/IDEnA , there is a method for changing the color of the shape, is there a similar method to change the textBlock text. any help ? thank you.

  2. Niko
    Admin
    Niko avatar
    399 posts

    Posted 27 Jan Link to this post

    Hello,

    You can define the color of the text in a TextBlock by changing the fill option. If you wish to change the background of the text, then you could put the TextBlock in a Rectangle and set its fill color.

    Hope this helps.

    Regards,
    Niko
    Telerik by Progress
    Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
  3. Fahd
    Fahd avatar
    5 posts
    Member since:
    Jan 2016

    Posted 27 Jan Link to this post

    Hi Niko,

    Thanks for the replay, but i think you did not well understand my problem, i want to change the text it self not the color, i used the color as an example, my real issue is with the text content. In this link (  http://dojo.telerik.com/IDEnA  ) there is a comment that well describes my issue i hope you can check it out.

  4. Answer
    Niko
    Admin
    Niko avatar
    399 posts

    Posted 30 Jan Link to this post

    Hello,

    Please, check a couple of options for updating the text of a particular shape and then redraw the shape with the new value - http://dojo.telerik.com/OjobUb.

    First option is to change the individual dataItem of the shape, then use the redrawVisual method to apply the change to the visual. This method is a simplification of the the approach you proposed in your post. The drawback here is that the dataSource is out of sync with the shape.

    The second option is to change the dataSource - will it be through a call to the server or update the data on the client-side. Then call the refresh method of the diagram. The shapes get the updated data from the dataSource and get recreated.

    Regards,

    Niko

    Telerik by Progress

    Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
  5. Fahd
    Fahd avatar
    5 posts
    Member since:
    Jan 2016

    Posted 03 Feb Link to this post

    Hi Niko,

    Thank you very much for your help, that's really what I was looking for.

     

     

Back to Top