This is a migrated thread and some comments may be shown as answers.

Linear scale : Apply to right and left sides of Linear Bar

3 Answers 53 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Swati
Top achievements
Rank 1
Swati asked on 01 Feb 2012, 08:32 AM
Hi All,

I am trying to apply linear scale to the left and right side of the Linear Bar.. In my linear gauge I want scale to appear like this:

Scale LinearBar Scale  But when I am taking two scales it is not showing any error as well as no output.. :(

Can anyone help?? Its urgent.. Please guys try this one..

Regards,
Swati

3 Answers, 1 is accepted

Sort by
0
Swati
Top achievements
Rank 1
answered on 01 Feb 2012, 11:09 AM
Hi Guys...

For the above mentioned thing I have referred http://www.telerik.com/help/wpf/linear-gauge-create-thermometer.html  link. Still, I need to do this in Code behind.... Need help in this.. Its URGENT guys........

My code is below: What Modifications shall I do to get proper scale on both the sides and Linear bar between two scales?? 
public Telerik.Windows.Controls.Gauges.LinearGauge CreatelinearBar(Telerik.Windows.Controls.Gauges.LinearGauge linearbar)
       {
           linearbar.Height = 300;
           linearbar.Width = 100;
           linearbar.HorizontalAlignment = HorizontalAlignment.Left;
           LinearBar lb = new LinearBar();
           //lb.Width = 5;
           lb.Background = Brushes.Green;
           lb.Foreground = Brushes.Green;
           lb.StartWidth = 0.1;
           lb.EndWidth = 0.1;
           lb.Value = 70;
           lb.RelativeHeight = 0.9;
           lb.IsAnimated = true;
           lb.Duration = new Duration(TimeSpan.FromSeconds(2));
 
           LinearBar lb1 = new LinearBar();
           //lb1.Width = 5;
           lb1.Background = Brushes.Green;
           lb1.Foreground = Brushes.Green;
           lb1.StartWidth = 0.1;
           lb1.EndWidth = 0.1;
           lb1.Value = 70;
           lb1.IsAnimated = true;
           lb1.RelativeHeight = 0.9;
           lb1.Duration = new Duration(TimeSpan.FromSeconds(2));
 
           LinearScale ls1 = new LinearScale();
           ls1.Name = "NewLs";
           ls1.StartWidth = 0.1;
           ls1.EndWidth = 0.1;
           ls1.ShowFirstLabel = true;
           ls1.ShowLastLabel = true;
           ls1.Min = 0;
           ls1.Max = 10;
           ls1.IsInteractive = true;
 
           ls1.MajorTicks = 5;
           ls1.MajorTickStep = 3;
           ls1.MajorTick.Location = ScaleObjectLocation.Inside;
            
           ls1.MinorTicks = 5;
           ls1.MinorTick.Location = ScaleObjectLocation.Inside;
 
           ls1.MiddleTicks = 2;
           ls1.MiddleTick.Background = Brushes.RoyalBlue;
           ls1.MiddleTick.Location = ScaleObjectLocation.Inside;
           ls1.Location = ScaleObjectLocation.Inside;
           LinearScale ls2 = new LinearScale();
           ls2.Name = "NewLs2";
           ls2.StartWidth = 0.1;
           ls2.EndWidth = 0.1;
           ls2.ShowLastLabel = true;
           ls2.ShowFirstLabel = true;
           ls1.Min = 0;
           ls1.Max = 10;
           ls2.IsInteractive = true;
 
           ls2.MajorTickStep = 3;
           ls2.MajorTicks = 5;
           ls2.MajorTick.Location = ScaleObjectLocation.Outside;
 
           ls2.MinorTicks = 5;
           ls2.MinorTick.Location = ScaleObjectLocation.Outside;
            
            
           ls2.MiddleTicks = 2;
           ls2.MiddleTick.Background = Brushes.RoyalBlue;
           ls2.MiddleTick.Location = ScaleObjectLocation.Outside;
           ls2.Location = ScaleObjectLocation.Outside;
           ls2.Indicators.Add(lb);
           ls1.Indicators.Add(lb1);
           linearbar.Items.Add(ls1);
           linearbar.Items.Add(ls2);
           return linearbar;
       }


Urgent!!!! Please help guys..

Regards,
Swati
0
Accepted
Andrey
Telerik team
answered on 03 Feb 2012, 09:10 AM
Hi Swati,

Please, take a look into the following samples in our demo application. They have similar appearance:

http://demos.telerik.com/silverlight/#Gauge/Gallery/Thermometer
http://demos.telerik.com/silverlight/#Gauge/Theming

Regards,
Andrey Murzov
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

0
Swati
Top achievements
Rank 1
answered on 17 Feb 2012, 08:11 AM
Hi,

Thanks Telerik Team!

Best Regards,
Swati
Tags
General Discussions
Asked by
Swati
Top achievements
Rank 1
Answers by
Swati
Top achievements
Rank 1
Andrey
Telerik team
Share this question
or