When I am executing this code in notebook, there is no error but when I am deploying it in CDF, this error is coming.
$RecursionLimit::reclim: Recursion depth of 256 exceeded. >>
The code is
With[{y1 = {1, 2, 2, 1, 7}, y2 = {0, 3.27, 4.188, 7.331, 4.694}},
Column[
{ Spacer[70],
Text[Style["iPhone and iPad quarterly sales- units, million", Bold, 18]],
Column[
{Spacer[70],
Text[Style["Click on/off:", Bold, 14]],
q1 = True; q2 = True;
Row[
{Labeled[
Button[" ", q1 = ! q1, Background -> Blue, Appearance->"Frameless"],
"iPhone", {Right}
],
Spacer[19],
Labeled[
Button[" ",q2 =!q2,Background -> Orange, Appearance -> "Frameless"],
"iPad", {Right}
]
}
],
Column[
{Dynamic@ BarChart[
Table[{If[q1, y1[[i]], 0], If[q2, y2[[i]], 0]},{i, 1, 5, 1}],
BarSpacing -> 0.8, ChartStyle -> {Blue, Orange},
ImageSize -> {600, 280},
GridLines -> {None, Automatic}
]
}
]}]}]]

I have tried using
$RecursionLimit = Infinity
But it has not worked. Please help.