Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
105
Funnel/Pyramid Charts: Percent_Value not available for Callouts in IRenderLabel
posted

Hello,

I have a Pyramid Chart and a Funnel Chart that both have the same problem.  When I assign the FormatString for the Label to be a custom IRenderLabel format, the "Percent_Value" is not available in the Context HashTable.  However, if I put in the standard "<PERCENT_VALUE>"  instead of using my custom IRenderLabel code a Percent value is available.  How can I get access to the Percent_Value while using a custom IRenderLabel?

Best Regards,

Kevin

Parents
No Data
Reply
  • 28496
    Verified Answer
    Offline posted

    this worked okay for me... does it work for you?

    public partial class _Default : System.Web.UI.Page, IRenderLabel
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            this.UltraChart1.ChartType = ChartType.FunnelChart;
            this.UltraChart1.Data.DataSource = Infragistics.UltraChart.Data.DemoTable.AllPositive();
            this.UltraChart1.Data.DataBind();

            Hashtable labelHash = new Hashtable();
            labelHash.Add("MY_LABEL", this);
            this.UltraChart1.LabelHash = labelHash;
            this.UltraChart1.FunnelChart.Labels.FormatString = "<MY_LABEL>";


        }
        string IRenderLabel.ToString(Hashtable context)
        {
            object o = context["PERCENT_VALUE"];
            if (o == null)
            {
                return "nothing";
            }
            return o.ToString();
        }

    }

Children