Skip to content

Copying to cells

This section assumes you already covered the Filtering interactively section. In this section, we will show you how to use the "Copy code" function to copy the code of any of your charts and paste it on a separate cell.

Steps

Let's assume you'd like to render the histogram widget on a separate cell. First, update the title of your widget so that it renders with that title on the new cell.

image

Copy the code of this chart by using the "Copy code" function on the top right menu of your widget as shown below.

image

Paste the code on another cell and execute it. You should see an output similar to the one shown below.

image

Note that the chart rendered is exactly as it is on the Studio canvas, including its colors and filters. In this case, the rendered histogram includes the "Survived" and "Sex" filters.

Useful functions

cf.title()

Sets the title of your chart

cf.width()

Sets the width of your chart in pixels

cf.height()

Sets the height of your chart in pixels