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
490
Horizontal alignment changes on marker text
posted

We have a column series chart which is created once and reused for rendering data(from performance perspective as we are creating them in bulk). We are using Marker data-template to display text

 <DataTemplate x:Key="TextMarkerTemplate">

                <Grid ><TextBlock Text="{Binding Item.BarValue}" FontFamily="HelveticaNeue LT 55 Roman"/>

                    </Grid></DataTemplate>

There is a random issue we are facing where one of the marker text is skewed to the right 

(This happens only if control is being reused multiple times i.e. we keep updating the datacontext object model for re-rendering)

 

 

 

 

 

Parents
  • 490
    posted

    Also, I was wondering we have  this solution for range series where we do calculate  marker position from code behind, I was wondering can we get similar solution for column series as well

     var rangeSeries = Context.Series as RangeCategorySeries;

      var viewport = new Rect(0, 0, rangeSeries.ActualWidth, rangeSeries.ActualHeight);

     double scaledLow = rangeSeries.YAxis.GetScaledValue(Low, rangeSeries.Chart.WindowRect, viewport);

     double scaledHigh = rangeSeries.YAxis.GetScaledValue(High, rangeSeries.Chart.WindowRect, viewport);

     scaledLow += 5;
    scaledHigh -= 5;

    var tbHigh = new TextBlock()  {

                        Text =  High,RenderTransform = new TranslateTransform(){Y = scaledHigh - mid} };

    var tbLow = new TextBlock() {

                        Text = Low,  RenderTransform =new TranslateTransform(){Y = scaledLow - mid} };

     

     

Reply Children
No Data