Tracker custom precision

Jul 23, 2013 at 10:43 AM

I wanted to round off the double precision displayed in the tracker X and Y values .. using some custom rounding values. Is it possible to do with the current tracker?

Jul 23, 2013 at 11:21 AM
See Tracker Examples

                    <oxy:TrackerControl Position="{Binding Position}" BorderThickness="2" BorderBrush="LightSteelBlue" LineStroke="SteelBlue" LineExtents="{Binding PlotModel.PlotArea}">
                            <LinearGradientBrush EndPoint="0,1">
                                <GradientStop Color="#B0C4DE" />
                                <GradientStop Offset="1" Color="#f0ffffff" />

                            <UniformGrid  Columns="2" Canvas.Left="{Binding Position.X}" Canvas.Top="{Binding Position.Y}" Margin="6">
                                <TextBlock Text="{Binding Series.Title}" FontWeight="Bold" FontSize="15" Foreground="Black" />
                                <TextBlock Text="{Binding Series.Tag}" Foreground="Black"/>
                                    <Run Text="X:" FontWeight="Bold" Foreground="Black" />
                                    <Run Text="{Binding DataPoint.X, StringFormat='{}{0:0.000}'}" Foreground="Black"/>
                                    <Run Text="Y:" FontWeight="Bold" Foreground="Black" />
                                    <Run Text="{Binding DataPoint.Y, StringFormat='{}{0:0.000}'}" Foreground="Black" />


Good luck
Jul 23, 2013 at 12:11 PM
Hi everytimer..

Thanks for the example. I have seen it but I don't think its dynamically possible to change the precision with it?
Jul 23, 2013 at 12:39 PM
I think you should create a custom Series derived from LineSeries with the TrackerFormatString property exposed. See MatrixSeries.cs.

Good luck
Jul 23, 2013 at 12:41 PM
Just put StringFormat='{}{0:0.0}' for only one decimal for example.
If you want more explanation about double format :
Jul 23, 2013 at 1:04 PM
Edited Jul 23, 2013 at 1:05 PM
Thanks everytimer... That's a good idea, it will work!
Jul 23, 2013 at 1:08 PM
Thanks raphay.. But my query was more towards the binding aspect.