CDML Examples
Here are some examples of CDML in action in Logi applications:
Creating a 2-Line Axis Title
Using Subscripts in an Axis Title
- As shown above, the <*block*> and <*/block*> tags are used in the Data Title attribute to delimit the new font style.
- The <*sub*> tag specifies the new style, i.e. subscript.
- The <*/font*> tag ends the new style and returns to the original style.
Setting Font Size and Adding Superscript in an Axis Title
- As shown above, the <*block*> and <*/block*> tags are used in the Label Title attribute to delimit the new font style.
- The <*size*> and <*super*> tags are used to define the new font styles.
- The <*/font*> tag ends the new style and returns to the original style.
Creating a 2-Line Data Label
To format data using CDML, it's necessary to first add a column to the datalayer to contain the formatted data.
- As shown above, a Calculated Column is used to combine the data from two columns and add a <*br*> tag in between them to put the data on two lines.
- The chart's Label Column X-axis attribute value is then set to the name of the calculated column, as shown above.
Alternately, instead of using a Calculated Column element, the results shown in the example above could also be achieved by includingCDML right in the SQL query. For example:
SELECT FQuarter + '<*br*>' + RIGHT(FYear,2) AS calcQuarterYear FROM SomeSQLTable would return a column that concatenated the values from two others with the CDML tag needed to insert the new line.