In this tutorial we will use several marks in a very basic form. We will use the same data for all marks. Below an example of a chart containing the marks Area, Dot, Line, and Text combined.
Introducing the data
We will use the following data throughout this tutorial:
name,value,date
a,1,2025-01-01
b,2,2025-02-01
c,3,2025-03-01
d,2,2025-04-01
e,3,2025-05-01
f,4,2025-06-01
The above data is presented in CSV format (comma separated values) and can easily be copied into the DataPicta app.
- Copy the data above to your clipboard
- Goto www.datapicta.com
- Click the Upload data icon
- Paste the data in the text area
- Enter a name for the dataset, for example Basic Data
- Click Parse
You now see the data presented in a table. In the date field you see dates presented as strings, this means that the app will handle these values as just text and not real dates. You should convert these text values to dates.
- Click Parse field
- At the Date row click Date...
Here you can format how the text presents the data, but by default this is YYYY-MM-DD which is the same as the format of the text. So you can just click OK.
The LINE mark
- Click the Add a mark icon
- Click LINE in the presented dialog
- For X axis choose date
- For Y axis choose value
- For Stroke color choose name
- Click the Style tab
- For Stroke width choose 3 pixels
The DOT mark
- Click the Add a mark icon
- Click DOT in the presented dialog
- For X axis choose date
- For Y axis choose value
- Click the Style tab
- For Radius choose 6 pixels
- For Fill color choose a dark color
- For Stroke color choose a light color
- For Stroke width choose 3 pixels
The AREA mark
- Click the Add a mark icon
- Click AREA in the presented dialog
- For X axis choose date
- For Y axis choose value
- Click the Style tab
- For Fill color choose an even lighter color
You now see three marks in the chart. The area mark is drawn on top of the line and dot marks, which does not look very nice. Now collapse the panel and play with the arrows to move the marks up and down, you want to have the dot mark to be drawn last so it is on top of the area mark.
The TEXT mark
- Click the Add a mark icon
- Click TEXT in the presented dialog
- For X axis choose date
- For Y axis choose value
- For Text choose name
The names appear on the chart, but they are not very readable.
- Click the Style tab
- For Font size choose 16 pixels
- Scroll down to Offset
- For Horizontal offset choose 16 pixels
And now you know how to combine marks in a chart. This is the basic principle of the Grammar of Graphics, a core concept of the DataPicta app.