In this article, we will learn how to create a chart with checkboxes. Let's start by creating a simple chart with the data.
In this chart, the main product1 is the most important, which must always be shown, and the others are optional.
Select the data and create a chart. Change the chart type to combo and make products 2 and 3 as line chart with secondary axis.
Finally, the chart will look like this, and products 2 and 3 will have a secondary axis on the right. As it has different values than the main product, it is better to show it on the secondary axis. Now we will create the checkboxes to show and unshow product 2 and product 3, as these are optional.
Let's define two names: series1 and series2 as follows.
Here is how to define the first name:
And the second one:
In cells F2 and F3, enter the following values as TRUE:
Create a checkbox and format controls as follows:
Link series to series names created:
We can now remove and re-add products 2 and 3 to the list using checkboxes.