xmCHART 3.4 Reference
Last updated: 2010-06-05


Syntax back functions constants


  Functions
     
   
  • Functions are separated by carriage returns. That means there is one function call per line.

  • The arguments of the functions are to be placed in round brackets.
    For example: AddSymbol(100;150;bullet;10;1;darkGray)

  • Function names and constants are not case sensitive. For example:
    BORDERSTYLE(all;POLY;2;darkblue) // allowed
    Borderstyle(All;Poly;3;DARKBLUE) // no error

  • If a function is called several times, the last one will be used; all previous ones will be ignored.
    Exception: The functions PieChartExplodes(), PieChartExplodeDepths()
    and graphic primitive functions, e.g. AddText(), AddSymbol(),
    AddPicture() etc. — they can be called multiple times.

    For example:
    OpenDrawing(400;300)
    ChartData(12 45 23 -10 34) // is ignored
    ChartData(78 -23 56 22 11)
    PieChart(oval+shadow+label) // is ignored
    BarChart(label)
    FillStyle(1;red) // is ignored
    FillStyle(1;blue)
    FillStyle(2;yellow)
    AddText(20;20;"Diagram 1")
    AddText(20;35;"(Variant A)")
    AddText(200;280;"Copyright")
    CloseDrawing()


  Arguments
     
   
  • If a function has several arguments, they are separated by semicolons, e.g.: OpenDrawing(400;300).

  • Optional arguments – those which are not absolutely necessary – can be skipped in a function call. The default values stored in xmCHART are used in this case. See function reference for these values. Examples:
    LegendBackground(white;;2;;;3)
    LegendBackground()

  • ChartData() function:
    Values of a data series are separated by spaces, tabs or line feeds, several data series by semicolons ";". For example:
    ChartData(78 -23 56 22 11; 34 23 -87 18 72)

    The number of values per series may vary. For example:
    ChartData(78 -12; 45 7 -23; 0 ;12 -34 78 23)

    Entering chart values in scientific notation (E-format) is allowed. For example:
    ChartData(-1.2e04 0.2E04 .2e-3)

    Support of "NULL" for missing charting values. For example:
    ChartData(12 98.3 null 23.1 Null NULL 7.23 -0.67)

  • Texts and names of fonts, e.g. "Times", are to be placed in double quotes. For example:
    TitleText("Chart 1")
    If a double quote is to be issued, it must be entered twice or as \". For example:
    TitleText("""A""BC""") produces "A"BC".
    TitleText("\"A\"BC\"") produces "A"BC".

    PLEASE NOTE: Double quotes (") are not to be confused with typographical quotes (”“). Typographical quotes can be activated or deactivated in the File>File Options…>Text menu of FileMaker Pro
    .

  • Texts may also have several lines. For example:
    TitleText("Chart 1\nOverview") // "\n"...new line

  • RGB colors are defined by three integers between 0 and 255, which represent the red, green and blue components. These three color components are separated by spaces. For example:
    FillStyle(all;255 127 0)
    LegendBackground(255 255 0) % yellow

    Transparency (alpha channel) is supported as optional 4th argument
    in R G B A. Range: 0 (invisible) ... 255 (opaque) default: 255
    For example:
    FillStyle(1;100 0 188 255) // same as FillStyle(1;100 0 188)
    FillStyle(1;255 0 255 200)
    FillStyle(1;#FF8900DE)
    FillStyle(1;darkRed 200) // Error, not allowed!
    FillStyle(1;darkRed,200) // Error, not allowed!


    Colors can be entered as hexcodes, with or without alpha channel,
    #RRGGBB,#rrggbb,#RRGGBBAA,#rrggbbaa. For example:
    FillStyle(1;#FF8900DE)
    BorderStyle(all;poly;2;#ff12c0)


    Since the handling of RGB colors is a bit cumbersome, xmCHART also has its own palette of 88 colors and easy-to-remember names for the most common colors.
    Refer to the constant reference for the color names.

  • 42 built-in backgrounds (gradient fills) can be accessed by entering resource as picture source and a resource ID between "1" and "42", for example:
    BackgroundPict(resource;"12")
    Please note: The resource ID is to be placed in double quotes.

    A picture in the clipboard is copied to xmCHART by entering the picture source constant clipboard. For example:
    AddPicture(100;150;;;clipboard)

    A picture from a file is copied to xmCHART by entering the picture source constant file and the name of the file. Examples:
    BackgroundPict(file;"Pictures/Pict_01.png")
    BackgroundPict(file;"C:/Pictures/Pict_01.png")

    BackgroundPict(file;"Macintosh HD/Picts/Pict_01.pdf")
    In order to be imported, pictures have to be in PDF, PICT, GIF, JPEG, PNG, BMP or TIFF format in Mac OS X and in WMF, EMF, GIF, JPEG, PNG, BMP or TIFF format under Windows.

  • A dash pattern can be assigned to the line width by adding a list of
    dash lengths and gaps. Examples:
    LineStyle(1;poly;1) // solid line (default)
    BorderStyle(1;poly;1 2 2) // dotted line
    LineStyle(all;poly;1 5 5) // dashed line
    BorderStyle(all;;2 9 4 2 4) // dash-dotted line


  Miscellaneous
     
   
  • Comments:
    - comments start with 2 slashes "//". For example:
    MajorGridLineWidths(x;y;0) // only vertical gridlines.
    - C-style multi-line /* ... */ comments. For example:
    MajorGridLineWidths(x;y;0) /* only vertical gridlines */

  • Special characters:
    \n = new line
    \r = carriage return (\r is equivalent to \n)
    \t = tab character
    \\ = backslash
    \" = quote (\" is equivalent to "")
    \uXXXX = Unicode character (hexadecimal)

    Examples:
    TitleText("Chart-1\nSeries AB")
    LegendTexts("Category \"A\"") // Category "A"
    LegendTexts("Category ""A""") // Category "A"
    TitleText("Group \u00DF") // \u00DF = "ß"
    AddText(5;50;"\u00A9X2max Software") // \u00A9 = "©"

  • Get xmCHART version:
    xmCH_GetVersion(type) with,
    type = 1: long version string
    type = 2: short version string
    Examples:
    xmCH_GetVersion(1) // returns, for example: "xmCHART 3.4.1"
    xmCH_GetVersion(2) // returns, for example: "3.4.1"

  • Mouse coordinates:
    xmCH_GetMouse() returns the current mouse coordinates.
    Examples:
    xmCH_GetMouse("") // returns x y, e.g.: 419 253
    xmCH_GetMouse("%1 %2") // returns x y, e.g.: 419 253
    xmCH_GetMouse("%2") // returns the y-coordinate.
    xmCH_GetMouse("(x=%1; y=%2)")// returns e.g.:(x=419; y=253)


©2010 X2max Software back functions constants