Prototyping a toggle button using variables (not working)

I’ve been struggling with this for a while. I’m working on a chart where I want to use a toggle to switch between different views (e.g., Days, Weeks, Months).

I created three different chart variants called LineDays3, LineWeeks3, and LineMonths3. In each chart variant, I added an action that changes a variable when clicked (as shown in the images below).
LineDays3:
image
image
LineWeeks3:
image
image
LineMonths3:
image
image

The prototype only works on the first click. For example, if the default view is LineDays3, it works when I click on either Weeks or Months. However, after that first action, the prototype stops working. I’m not sure what the issue is. :cry:

This is an assumtion, withous seening your variables:
after your first action, var LineDays3 = “LineWeeks3”, so after this action LineDays is kind of gone. IDK, to be honest. Definitely, the selected should be some general variable, I’m not sure if you can even control in Figma with variables which variant should be triggered.

I can’t see if you are creating one big component or separate frames.

Why not create a component with 3 variants:
Days selected, Weeks selected, Months selected
Next just create a “local” interaction within that component.
Note: TBH, if you don’t have some fancy-schmancy animation here, you can skip this nav component part and just place buttons in 3 frames.

Then you create 3 frames, one for each case and separate content.