See attached sample code at the bottom of this post.
Under Manipulate, as I step through BarChart data using Take with different start/end positions, the chart of the data is refreshed, but the ChartLabels are not. So BarChart correctly labels the default start/end position data, but when new start/end positions are selected, the BarChart correctly updates the chart for the new data, but the ChartLabels are not refreshed. In the case, where star Names are the ChartLabels, labels still show the previous star names.
Manipulate[
Switch[whichBarChart,
4, BarChart[Take[category[[All, 4]], {startPosition, endPosition}],
ChartLabels -> category[[All, label]],
BarOrigin -> Left,
ImageSize -> Large],
where start/end positions are defined as
{{startPosition, 1}, {1, 21, 41, 61, 81, 101, 121, 141, 161, 181,
201}},
{{endPosition, 21}, {21, 41, 61, 81, 101, 121, 141, 161, 181, 201,
221}},
label is defined as
{{label, 3}, {1 -> "Name", 3 -> "SpectralType", 12 -> "Constellation",
4 -> "BVColorIndex", 5 -> "Temperature", 6 -> "Mass",
7 -> "Luminosity", 8 -> "AbsoluteMagnitude"}},
and whichBarChart is defined as
{{whichBarChart, 6, "Choose BarChart"},
{4 -> "BVColorIndex", 5 -> "Temperature", 6 -> "Mass",
7 -> "Luminosity", 8 -> "AbsoluteMagnitude",
15 -> "SortTemperature", 16 -> "SortMass", 17 -> "SortLuminosity",
18 -> "SortAbsoluteMagnitude"}},
and AstronomicalData categories are defined as
{{category, importAllSubgiant }, {
importAllClassA -> "ClassA",
importAllClassB -> "ClassB",
importAllClassF -> "ClassF",
importAllClassG -> "ClassG",
importAllClassM -> "ClassM",
importAllClassO -> "ClassO",
importAllSubgiant -> "Subgiant",
importAllNormalGiant -> "NormalGiant",
importAllSupergiant -> "Supergiant"}}
Any help would be appreciated. Thanks!
Sample code:
classA10 = {{"Sirius", 48915, "A1Vm", 0.009`, 1.6`, 2.6`,
40.`}, {"Vega", 172167, "A0Vvar", 0.`, 1.7`, 2.9`, 50.`},
{"Altair", 187642, "A7V", 0.221`, 1.4`, 1.8`, 9.`}, {"Fomalhaut",
216956, "A3V", 0.145`, 1.5`, 2.2`, 20.`}, {"Deneb", 197345,
"A2Ia", 0.092`, 1.6`, 20.`, 120000.`}, {"Castor", 60179, "A2Vm",
0.034`, 1.6`, 2.4`, 30.`}, {"Miaplacidus", 80007, "A2IV", 0.07`,
1.6`, 2.8`, 60.`}, {"Menkalinan", 40183, "A2V", 0.076`, 1.6`,
2.4`, 30.`}, {"Alhena", 47105, "A0IV", 0.`, 1.7`, 3.5`,
90.`}, {"Î\.b4 Velorum", 74956, "A1V", 0.043`, 1.6`, 2.6`, 40.`}};
classB10 = {{"Rigel", 34085, "B8Ia", -0.03`, 2.5`, 23.`,
200000.`}, {"Achernar", 10144, "B3Vpe", -0.158`, 3.3`, 7.6`,
3000.`}, {"Hadar", 122451, "B1III", -0.231`, 4.6`, 16.`,
80000.`}, {"Acrux", 108248, "B0.5IV", -0.243`, 4.8`, 17.`,
60000.`}, {"Spica", 116658, "B1V", -0.235`, 4.4`, 14.`,
16000.`}, {"Mimosa", 111123, "B0.5III", -0.238`, 4.8`, 18.`,
100000.`}, {"Regulus", 87901, "B7V", -0.087`, 2.2`, 4.4`,
300.`}, {"Adhara", 52089, "B2II", -0.211`, 4.2`, 11.`,
90000.`}, {"Shaula", 158926, "B1.5IV+...", -0.231`, 4.2`, 13.`,
30000.`}, {"Bellatrix", 35468, "B2III", -0.224`, 4.2`, 13.`,
40000.`}};
Manipulate[
Switch[whichBarChart,
5, BarChart[Take[category[[All, 5]], {startPosition, endPosition}],
ChartLabels -> category[[All, label]],
BarOrigin -> Left,
ImageSize -> Large],
6, BarChart[
Take[category[[All, 6]], {startPosition, endPosition}],
ChartLabels -> category[[All, label]],
BarOrigin -> Left,
ImageSize -> Large],
7, BarChart[Take[category[[All, 7]], {startPosition, endPosition}],
ChartLabels -> category[[All, label]],
BarOrigin -> Left,
ImageSize -> Large]
],
{{startPosition, 1}, {1, 6}},
{{endPosition, 5}, {5, 10}},
{{whichBarChart, 6, "Choose BarChart"},
{5 -> "Temperature", 6 -> "Mass", 7 -> "Luminosity"}},
{{label, 1}, {1 -> "Name", 3 -> "SpectralType"}},
{{category, classA10}, {
classA10 -> "ClassA",
classB10 -> "ClassB"
}}
]
ListPicker[Dynamic[a],
{
classA10 -> "ClassA",
classB10 -> "ClassB"
}
];