0

Using a List Box to change tags in a Bar Chart

I have a bar chart (name=BC_ByWeek) and I have a list box (name=LB_ChartItem) that allows the user to select which tag they want to use for the bar chart. I have used list boxes to change bar chart properties like aggregatekind. However, I'm not sure how to address the "Tags" property of the bar chart. Ideally, I want a change in the list box (multiselect is disabled) to remove any current tags from the bar chart and add the one the user selects. Can someone help me with this? 

Here's my current script where I am successfully changing aggregatekind:

public void LB_ChartItem_OnSelectionChange(object sender, string[] selectedItems)
        {
            if (selectedItems[0]=="Total Stops") BC_ByWeek.AggregateKind = "CountinStateZero";
            if (selectedItems[0]!="Total Stops") BC_ByWeek.AggregateKind = "CountinStateNonZero";
        }

1 reply

null
    • wise_james
    • 2 yrs ago
    • Reported - view

    FYI in case anyone else runs into this and needs a work around.... There might be a better approach but for now I worked around it by copying the panel with my chart and changing the item of the chart per panel and using the list box to set IsVisible to false on the ones that weren’t for the selected item, and true to the one for the selected item.

                if (selectedItems[0]!="# stops/1000 linear yards") PAN_ByPeriod.IsVisible = true;
                if (selectedItems[0]=="# stops/1000 linear yards") PAN_ByPeriod.IsVisible = false;
                if (selectedItems[0]=="# stops/1000 linear yards") PAN_ByPeriod_LVL.IsVisible = true;
                if (selectedItems[0]!="# stops/1000 linear yards") PAN_ByPeriod_LVL.IsVisible = false;

Content aside

print this pagePrint this page
  • Status Answered
  • 2 yrs agoLast active
  • 1Replies
  • 78Views
  • 1 Following