This question is locked. New answers and comments are not allowed.
Hi, followed the tutorials and I'm trying to create a linear gauge from code behind, however nothing shows; code snippet below
| void loadItem() |
| { |
| LinearScale scale = new LinearScale(); |
| scale.Min = Convert.ToDouble(dashitem.minvalue); |
| scale.Max = Convert.ToDouble(dashitem.maxvalue); |
| scale.Width = 70; |
| // add a linear bar, already bound to the stock |
| scale.Indicators.Add(getLinearBar(dt.Rows[0])); |
| // initialize a stack panel to contain a text label |
| // and scale. Add the stack panel to the stack panel |
| // already in the xaml markup |
| StackPanel stackPanel = new StackPanel(); |
| stackPanel.VerticalAlignment = VerticalAlignment.Stretch; |
| stackPanel.Children.Add(scale); |
| spScales.Children.Add(stackPanel); |
| } |
| private LinearBar getLinearBar(DataRow row) |
| { |
| LinearBar linearBar = new LinearBar(); |
| linearBar.Value = Convert.ToDouble(row[dashitem.yfield]); |
| linearBar.StartWidth = .1; |
| linearBar.EndWidth = .1; |
| linearBar.RelativeHeight = 0.9; |
| return linearBar; |
| <Grid x:Name="LayoutRoot"> |
| <control:RadGauge x:Name="radGauge1"> |
| <StackPanel x:Name="spScales" Orientation="Horizontal" HorizontalAlignment="Center" Margin="10" > |
| </StackPanel> |
| </control:RadGauge> |
| </Grid> |