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

Change the position of a connection label

6 Answers 118 Views
Diagram
This is a migrated thread and some comments may be shown as answers.
Seifeddine
Top achievements
Rank 1
Seifeddine asked on 31 Aug 2015, 12:06 PM

Hello,

I was able to change the label text successfully but no the text position.

I'm using :

kendoDiagram.connections[0].redraw({content: {text: 'myLabel', x: 20, y: 50}})​;

In fact, the position changes but temporary until:

 - selecting other connection/shape

 - clicking in the background of the diagram

 - calling  kendoDiagram.connections[0].re​fresh();

H​ow can I proceed to change the position of the label please?

Best regards,

Seifeddine

In fact, the position  

6 Answers, 1 is accepted

Sort by
0
Daniel
Telerik team
answered on 02 Sep 2015, 08:21 AM
Hello Seifeddine,

I am afraid that this is not currently supported. The content position is automatically calculated and cannot be changed.

Regards,
Daniel
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
0
Seifeddine
Top achievements
Rank 1
answered on 02 Sep 2015, 11:07 AM

Hello Daniel,

Thanks for your answer.​

Actually, I can change its position but I'm asking how to keep it in the new position.

Is that possible?

Regards,
Seifeddine

0
Daniel
Telerik team
answered on 04 Sep 2015, 07:54 AM
Hello,

Actually, the position being changed at all when using the redraw method is a bug that is fixed in the latest version. The built-in alignment was not performed when updating the content. It should be possible to keep the position set with the redraw method in the latest version by overriding the internal _alignContent method:
kendoDiagram.connections[0]._alignContent = $.noop;
kendoDiagram.connections[0].redraw({content: {text: 'myLabel', x: 20, y: 50}})​;
but note that this is not recommended. 


Regards,
Daniel
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
0
Seifeddine
Top achievements
Rank 1
answered on 04 Sep 2015, 01:16 PM

Hello,

Thanks for this Daniel - this is what is needed.

What about resetting the _alignContent to the default behaviour after overriding it?

Regards,
Seifeddine

0
Daniel
Telerik team
answered on 07 Sep 2015, 10:28 AM
Hi,

You could either keep a reference to the function or get a reference from the prototype:
kendoDiagram.connections[0]._alignContent = kendo.dataviz.diagram.Connection.fn._alignContent;


Regards,
Daniel
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
0
Seifeddine
Top achievements
Rank 1
answered on 08 Sep 2015, 10:46 AM

Hi,

Thanks - the second option is the needed one.

Regards,
Seifeddine

Tags
Diagram
Asked by
Seifeddine
Top achievements
Rank 1
Answers by
Daniel
Telerik team
Seifeddine
Top achievements
Rank 1
Share this question
or