Page 1 of 1

<graph> element usage, CMlGraphCurve::Style ?

Posted: 03 Apr 2019, 18:46
by reaby
Hi,

I've seen <graph> can do lines, but GraphCurve suggest that it could do bezier as well...
  • What are the possible values for the Style attribute ?
  • Can <graph> hold possible <curve> values ?
Something like:

Code: Select all

<graph min="0 0" max="100 100">
       <curve color="fff" width="0.1">
	       <point pos="0 0" />
               <point pos="0 10" />
      	</curve>
</graph>
or what is the right syntax, as there's so little infos for this manialink element :)

**edit**
changed topic title, so it's easier to find the info from future searches.

Re: CMlGraphCurve::Style

Posted: 04 Apr 2019, 10:06
by cgdb
Hello,

I'm not an expert of this topic, but some infos I have found :
- The points use a "coords" attribute, not "pos".
- A curve seems to only describe a y=f(x) described function, which means that the points should be sorted from lowest to highest x-coordinate and no pair of points can share the same x-coordinate.
- The style attribute seems to have an effect only on the curve width :
* If left empty, width is described in Ml units.
* If set to "thin", width is described in pixels.
* I have seen someone saying the style can be set to "surface", this is correct but the internal logic of this style is broken.
- You can have multiple curves on the same graph, each with their own color, style, etc...

You can also manipulate a graph and its curves using Maniascript, check the CMlGraph and the CMlGraphCurve API.

Here is a bit of Manialink I made to check these infos, you can copy it to test it yourself.

Code: Select all

<graph size="50 50" min="0 0" max="10 10">
	 <curve color="00f" width="1" style="thin">
		<point coords="0 0" />
		 <point coords="10 10" />
	</curve>
	<curve color="f00" width="1">
		<point coords="0 10" />
		 <point coords="5 0" />
		 <point coords="10 10" />
	</curve>
</graph>
And attached the resulting curves in my Interface Designer.

Re: CMlGraphCurve::Style

Posted: 05 Apr 2019, 12:29
by reaby
Hi cgdb,

The element has been a mystery for me for a quite a while and I was re-discovering the possibilities lately. I was kind of hoping it could do also curves and fills... But this new infos helps to draw much more easily graphs from manialink as the only known way by this far was to generate maniascript into manialink to draw the lines. Graph is very useful for histograms or to visualize some valuedata from maniascript or from server contorller :)

Many thanks for a fast reply and detailed answer,
Reaby