Define colors and other properties by data

Learn how to set colors and other properties using codes in data

Introduction

Datylon comes with a very powerful feature to define colors and some other properties using reference codes in the data. Linking the reference codes to chart elements is done in the Bindings tab. 

If colors or other properties are bound, they overrule any other similar setting in the Styling tab.


The following properties can be bound:

Chart Type

Features

Bar

Bar color

Scatter

Data Mark color, Data Mark stroke color, Icon type, Label

Pie

Slice color, Slice Stroke color, Slice radius, 

Icon

Icon color, Icon type

Binding Colors

To bind colors, follow the steps below. In the example the data is structured in rows.

1-4

  1. Add a column to your data with one of the following the color descriptions:
    • In RGB color mode there are 4 formats to define a color in data: 
      • #RRGGBB : hexadecimal format. Fully opaque, or 0% transparency.
      • #RRGGBBAA : in hexadecimal format where AA defines the opacity from 00 (0) to FF (255).
      • HTML color names. Case insensitive. HEX codes can be mixed with HTML color names in one column. 
      • rgb(RRR,GGG,BBB) : Red, green and blue values from 0 to 255. Fully opaque, or 0% transparency.
      • rgb(RRR,GGG,BBB, AAA) : Red, green, blue and Opacity (AAA) from 0 to 255.
    • CMYK color mode (Datylon for Illustrator only), has 2 supported formats:
      • CCC,MMM,YYY,KKK : whole numbers between 0-100 separated by comma’s e.g.  0,37,100,0  which results in the orange as shown above. Fully opaque, or 0% transparency.
      • CCC,MMM,YYY,KKK, AAA : where AAA adds the opacity from 0 (transparent) to 100 (fully opaque). 
    • If an invalid color code or name is entered, the result will be black without a warning or notification. 
    • Empty fields in the bound column will keep the default color as set in Styling.
    • The color codes can be typed in or pasted in straight in the data sheet. The HEX codes can be copied from the Datylon color panel.
    • When using a spreadsheet, the color codes can even be generated with a formula based on the other data and imported in Datylon with the Data sheet manager. This is particularly useful for data driven or conditional coloring of your chart.
  1. Go to the Bindings tab and select the column from the list in the desired Color property. The chart will be re-rendered with the new colors.  At any time now, data with new color information can be imported to update the color of the chart.

Binding Icon type for Scatter chart and Icon array

2-6

By adding icon names in the data and binding this column/row to Icon under the Binding tab, you can assign icon types to data points.

Proceed as described in color binding, but instead of color codes, add icon type names in your data before binding to Icon Type in the Binding tab.  

See below the list of the icons and the names which should be used in the datasheet.
icons-1

Note the names are case sensitive, an do not fully correspond with the icon names in the list of the Datylon panel.

Binding Slice radius for Pie chart

  • Proceed as indicated above, but instead of color codes or icon types, add the radius value in your data before binding to Radius in the Binding tab.
  • The radius is expressed in percentages of the maximum radius of the pie and can be any number between 0 and 100. 
  • When a field is left empty it is considered as 100%. 
  • Do not add the %. 


3-2