I am using 3 checkboxes as desktops, portables and ipods in such a way that when I click to desktops it should shows ListLinePlot
of p1
, when I click to portables, it should show ListLinePlot
of p2
and in the same way, when I click to ipods, it shows ListLinePlot
of p3
.
p1 = {.955, .914, .956, 1.516, 1.355};
p2 = {1.462, 1.357, 1.577, 1.917, 2.054};
p3 = {0,0, 1.57, 1.619, 3.997};
Column[{CheckboxBar[
Dynamic[z], {ListLinePlot[p1, Filling -> Axis,
FillingStyle -> Blue] -> Desktop,
ListLinePlot[p2, Filling -> Axis, FillingStyle -> LightBlue] ->
Portables,
ListLinePlot[p3, Filling -> Axis, FillingStyle -> Green] -> Ipods}], Spacer[5], Dynamic[z]}]
This is working correctly. But I want when I click both desktops and portables on, it should show the plots of p1
and p2
in a stacked way. Here I am explaining it with the help of BarChart
because I have no idea whether ListLinePlot
can do this .
BarChart[Table[{p1[[i]], p2[[i]]}, {i, 1, 5, 1}], ChartLayout -> "Stacked"]
If I click Desktops, Portables and ipods, then it should dynamically take data of p1, p2 and p3 in stacked order as
BarChart[Table[{p1[[i]],p2[[i]], p3[[i]]}, {i, 1, 5, 1}], ChartLayout -> "Stacked"]
and so on. But I want stacked ListLinePlot
and I don't know any function like ChartLayout
in BarChart
. I have seen the Accumulate
function but it does not work as I wanted. For more clarification, just have a look at
http://graphics.thomsonreuters.com/12/01/US_APPLEBREAK0112_VT.html
I want to do as it is, as in the product button of this link. Please help me.