0
2

how do add styles to edges like bold , color , dashed etc ..?\ni tried doing it with the edge declaration insertEdge(..)..\nbut it didn't work may be because i am using heirarchial layout so \ngive me the exact piece of command as i am a newbie.

asked 20 Jun '11, 09:28

novice_coder's gravatar image

novice_coder
312
accept rate: 0%

I also seeing the same problem in mxGraph (JavaScript) ver. 1.7.0.4

\n

I use the exact style string above "dashed=1;fontColor=#FF0000;"

\n

I get the dashed, but that string and other colors do not work. This is on FF versions 5.0/win and FF 3.6.18 / Ubuntu.

\n

fontColor by itself doesn't work either.

(29 Jun '11, 14:44) Ed Hassinger

This works for me:

n

var v1 = graph.insertVertex(parent, null, 'Hello,', 20, 20, 80, 30);nvar v2 = graph.insertVertex(parent, null, 'World!', 200, 150, 80, 30);nvar e1 = graph.insertEdge(parent, null, 'Test', v1, v2, 'dashed=1;fontColor=#FF0000;');n

(29 Jun '11, 21:49) Gaudenz

Use the style argument, eg. "dashed=1".

link

answered 21 Jun '11, 07:23

Gaudenz's gravatar image

Gaudenz
80.1k1310
accept rate: 39%

yes , this worked but i need 4-5 different/distinguishable styles for edges and vertices also .Working on similar pattern , "bold=1" and "color=red" compiled but didn't work .Please suggest .I couldn't really find the solution for this in api also .

(23 Jun '11, 06:12) novice_coder

See mxConstants.STYLE_FONTCOLOR, mxConstants.STYLE_FONTSTYLE

(23 Jun '11, 06:14) Gaudenz

how exactly am i supposed to use it..?\ni tried fittin it "STYLE_FONTCOLOR=green" in insertEdge(..) but it didnt work..Please give the piece of code like "dashed=1" It would be a real help.!

(24 Jun '11, 06:57) novice_coder
1

Does this help: "dashed=1;fontColor=#FF0000;"?

(24 Jun '11, 07:02) Gaudenz

yet again , the code for "fontColor=.." compiled.i tried it with many color combinations , but to no effect .its still the same style i see .Is the problem with me having used hierarchical layout.?and i also would like to change the background color

(26 Jun '11, 23:42) novice_coder

I also have the same issue, using the exact code below I see the dashed line but never a color change. I've tried various color values too. This is on mxGraph (JavaScript).

\n

Is this a known bug being looked at?

\n

var styleString = "dashed=1;fontColor=#FF0000;";

\n

graph.insertEdge(parent, null, "", node, cell, styleString);

(30 Jun '11, 07:05) Ed Hassinger

Try STROKECOLOR instead of FONTCOLOR.

(10 Jan '12, 21:36) Saju Chithran
showing 5 of 7 show all

Can someone provide a testcase for us to reproduce this? Like I said the above code works for me with 1.7.0.7 and 1.7.0.4.

link

answered 30 Jun '11, 07:06

Gaudenz's gravatar image

Gaudenz
80.1k1310
accept rate: 39%

I'd be happy to, let me try to isolate the problem with a smaller snippet and I'll post in its entirety.

(30 Jun '11, 07:08) Ed Hassinger
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×194
×100
×50
×45
×20

Asked: 20 Jun '11, 09:28

Seen: 5,332 times

Last updated: 10 Jan '12, 21:36