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
2070
Thermometer Vertical Customization
posted

Hi

I want to show string values(month names) from database in the right side intead of F. In left side 1-10. I did left side easily by setting start value and end value. But in right side I am unable to show. How can I show this? My requirement is to show string values at right side and percentage or numeric at left side. With which gauge I can achieve this? Please help me in this issue.

Sridhar

Parents
No Data
Reply
  • 28496
    Verified Answer
    Offline posted

        protected void Page_Load(object sender, EventArgs e)
        {
            ((LinearGauge)this.UltraGauge1.Gauges[0]).Scales[1].Labels.FormatString = "<DATA_VALUE>REPLACEME";
        }
        protected void UltraGauge1_RenderLabel(object sender, Infragistics.UltraGauge.Resources.RenderLabelEventArgs e)
        {
            if (e.Text != null && e.Text.EndsWith("REPLACEME"))
            {
                e.Text = e.Text.Replace("REPLACEME", "");
                double value = double.Parse(e.Text);
                if (value < 0)
                {
                    e.Text = "Frigid";
                }
                else if (value < 20)
                {
                    e.Text = "Frosty";
                }
                else if (value < 40)
                {
                    e.Text = "Cold";
                }
                else if (value < 60)
                {
                    e.Text = "Chilly";
                }
                else if (value < 80)
                {
                    e.Text = "Warm";
                }
                else if (value < 100)
                {
                    e.Text = "Hot";
                }
                else
                {
                    e.Text = "Scorching";
                }
            }
        }

     

Children