Shape

The Shape property allows you to encode data by assigning different shapes to the marks in a data view.
When you place a dimension on the Shape target on the Marks card, Tableau separates the marks according to the members in the dimension, and assigns a unique shape to each member. Tableau also displays a shape legend, which shows each member name and its associated shape. When you place a measure on the Shape target, the measure is converted to a discrete measure.
Shape-encoding data separates the marks in the same way as the Detail property does, and then provides additional information (a shape) for each mark. Shape is the default mark type when measures are the inner most (farthest right) fields for both the Rows shelf and the Columns shelf.
In the view below, the marks are separated into different shapes according to the members of the Customer Segment dimension. Each shape reflects the customer segment’s contribution to profit and sales.

Editing Shapes

By default, ten unique shapes are used to encode dimensions. If you have more than 10 members, the shapes repeat. In addition to the default palette, you can choose from a variety of shape palettes, including filled shapes, arrows, and even weather symbols.
  1. Click the Shape target on the Marks card, or select Edit Shape on the legend’s card menu.
  2. In the Edit Shape dialog box, select a member on the left and then select the new shape in the palette on the right. You can also click Assign Palette to quickly assign the shapes to the members of the field.

Select a different shape palette using the drop-down menu in the upper right.
Shape encodings are shared across multiple worksheets that use the same data source. For example, if you define Furniture products to be represented by a square, they will automatically be squares in all other views in the workbook. To set the default shape encodings for a field, right-click the field in the Data window and select Default Properties >Shape.

Custom Shapes

You can add custom shapes to a workbook by copying shape image files to the Shapes folder in your Tableau Repository, which is located in your Documents folder. When you use custom shapes, they are saved with the workbook. That way the workbook can be shared with others.
  1. Create your shape image files. Each shape should be saved as its own file and can be in any of several image formats including bitmap (.bmp), portable network graphic (.png), JPEG, graphics interchange format (.gif).
  2. Copy the shape files to a new folder in the My Tableau Repository\Shapes folder in your Documents folder. The name of the folder will be used as the name of the palette in Tableau. In the example below, two new palettes are created: Maps and My Custom Shapes.

  3. In Tableau, click to the right of the dimension name on the shape legend, and choose Edit Shape.

  4. Choose the new custom palette in the drop-down list. If you modified the shapes while Tableau was running, you may need to click Reload Shapes.

  5. You can either assign members shapes one at a time, or click Assign Palette to automatically assign the shapes to the members.

You can return to the default palette by clicking the Reset button. If you open a workbook that uses custom shapes that you don’t have, the workbook will show the custom shapes because the shapes are saved as part of the workbook. However, you can click Reload Shapes in the Edit Shapes dialog box to use the ones in your repository instead.
Below are some examples of views that use both the default and custom shape palettes.

Tips for Creating Custom Shapes

When you create custom shapes there are a few things that you can do to improve how your shapes look and function in the view. If you are creating your own shapes, we recommend following general guidelines for making icons or clip art.
  • Suggested Size - Unless you plan on using the Size target to make the shapes really large, you should try to make your original shape size close to 32 pixels by 32 pixels. However, the original size is dependent on the range of sizes you want available in Tableau. You can resize the shapes in Tableau by clicking Size on the Marks card, or by using the cell size options on the Format menu.
  • Adding Color Encoding - If you plan to also use Color to encode shapes, you should use a transparent background. Otherwise, the entire square of the image will be colored rather than just the symbol. GIF and PNG file formats both support transparency. GIF files support transparency for a single color that is 100% transparent, while PNG files support alpha channels with a range of transparency levels available on every pixel in the image. When Tableau color encodes a symbol, the amount of transparency for each pixel will not be modified, so you can maintain smooth edges.
  • File Formats - Tableau does not support symbols that are in the Enhanced Meta File format (.emf). The shape image files can be in one of the following formats: .png, .gif, .jpg, .bmp, and .tiff.

1 comment:

  1. Hi, I read your whole blog. This is very nice. Good to know about the Tableau and is very demanding in future. We are also providing various Tableau Training & Certification Courses, anyone interested can Tableau certification for making their career in this field.

    ReplyDelete