<andrewb@dundas.com> wrote in message
news:1162565234.246326.61490@i42g2000cwa.googlegroups.com...
> Steve,
>
> The best solution for this is to use our code editor and set a named
> "code parameter" value with an expression. Then, during one of the
> events, use the boolean value determined by your expression expression
> and set it to the enabled property of the legend that you want to hide.
>
> I would suggest doing this during either the PostInitialize OR the
> PostApplyData events. the C# code would look like:
>
> // a code parameter called ShowLegend should be defined with a value
> // that will be resolved as a boolean
> if(codeParams.ContainsKey("ShowLegend"))
> {
> bool showLegend = false;
> if(bool.TryParse(codeParams["ShowLegend"].ToString(), out showLegend))
> chartObj.Legends[0].Enabled = showLegend;
> }
>
> For faster response to questions, please use the dundas forums:
>
>
http://support.dundas.com/forum/ >
> Thanks
>
> Andrew Bryan
>
>
>
> Steve MunLeeuw wrote:
>> In our horizontal stacked bar charts we use a zero line as a watermark.
>> Because we need to re-arange the sort order from left to right, rather
>> than
>> from the zero line we use a custom legend. Depending on the data
>> availible
>> we show one of two sets of statistics. I'd like to build two custom
>> legends
>> and show/hide them as appropriate, but the enabled property doesn't allow
>> expressions. Should I try to accomplish setting the enabled property on
>> the
>> legends from an event in the chart instance, or from code behind in the
>> report? I have the chart in a list, frequently I will want to show
>> legend
>> 'A' for the first list item, and legend 'B' for the remainder. The
>> standard
>> chart that ships with RS doesn't have this feature either.
>>
>>
>> Thanks,
>> Steve MunLeeuw
>