We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Issue with chart label formatting

Hi,

I have this code set in my XAML

<chart:SfChart.SecondaryAxis>
            <chart:NumericalAxis>
              <chart:NumericalAxis.Title>
                <chart:ChartAxisTitle Text="{Binding Detail.Result.Result.AxisCostLabel}"/>
              </chart:NumericalAxis.Title>

              <chart:NumericalAxis.LabelStyle>
                <chart:ChartAxisLabelStyle LabelFormat = "0:0,0"/>
              </chart:NumericalAxis.LabelStyle>
              
              
            </chart:NumericalAxis>
          </chart:SfChart.SecondaryAxis>

but it has no effect, i am expecting the chart labels on the axis sot be formatted with no decimals and a , as thousands seperator

17 Replies

MS Mohamed Samsudeen K S Syncfusion Team March 21, 2016 11:09 AM UTC

Hi Kieran,

Thanks for contacting Syncfusion support.

It is possible to achieve the specified requirement by setting the LabelFormat as shown below.


<chart:NumericalAxis.LabelStyle>

  <chart:ChartAxisLabelStyle LabelFormat="#,###.00" />
</chart:NumericalAxis.LabelStyle>


Regards,
Samsudeen K S


KP Kieran Pierce March 21, 2016 02:47 PM UTC

That works, I have moved the format into a binable paramater and this is also working fne, but it will not work on the label formatiing of the trackbacll

I have this 

<chart:ChartTrackballBehavior.LabelStyle>

                <chart:ChartTrackballLabelStyle LabelFormat = "{Binding Detail.Result.Result.CostFormat}"/>

              </chart:ChartTrackballBehavior.LabelStyle>


and this


<chart:NumericalAxis.LabelStyle>

                <chart:ChartAxisLabelStyle LabelFormat = "{Binding Detail.Result.Result.CostFormat}"/>

              </chart:NumericalAxis.LabelStyle>


the format on the axis is fine, but not on the track ball, I can set the label format manualy on the track ball which does work but i want to bind it in order to set pre and post fixes based on data in the model


any ideas?



SB Suresh B Syncfusion Team March 22, 2016 11:43 AM UTC

Hi Kieran,

Thanks for contacting Syncfusion support.

We are unable to reproduce the issue “Binding is not working for trackball label format”. So, please check the attached sample and provide the modified sample as per your requirement to reproduce the issue.

Sample Link: SimpleSample

Thanks,
Suresh B


KP Kieran Pierce March 22, 2016 01:50 PM UTC

where is the sample? how do i see it


SB Suresh B Syncfusion Team March 23, 2016 07:31 AM UTC

Hi Kieran,

Sorry for the inconvenience caused,

Please find the sample link below, 
Link: 
http://www.syncfusion.com/downloads/support/directtrac/general/ze/SimpleSample-1574018957.zip

Thanks,
Suresh B



KP Kieran Pierce March 23, 2016 09:35 AM UTC

so i took a look at the sample, it did not work. i updated my version of sfchat to the one i can download to day. Now in debug i see the binding collect the formtatting but track ball does not work at all in IOS simulatre in my project or in the what could be happing?


KP Kieran Pierce March 23, 2016 01:15 PM UTC

That message was not great I typed it on my phone.

What I am trying to say is:

On my system the Sample and My App does not work. With an older version of the .dll the trackball works on the graph but with the issue I have been having on the data binding. I have upgraded the .dll to the latest version I downloaded form the site today. This has made the data binding work. But the trackball is not working at all on the simulator and a real phone all running IOS 9.2, what I mean buy his is that dragging my finger over the graph I see no trackball info any more.


KP Kieran Pierce March 23, 2016 01:59 PM UTC

I just tested this on Android and here the Trackball does work but the formatting of the label will not databind. can you confirm the version of the dll files you are using please


MS Mohamed Samsudeen K S Syncfusion Team March 24, 2016 02:23 PM UTC

Hi Kieran,

We are not able to reproduce the reported issues in our end. Please find our latest Essential Studio 2015 Volume 4 Service Pack Release 2 v13.4.0.63 under the following link.

http://www.syncfusion.com/forums/123314/essential-studio-2015-volume-4-service-pack-release-v13-4-0-63-available-for-download

If you are still facing this issue, we kindly request you to update us the modified sample for helping you further.

Regards,
Samsudeen K S


KP Kieran Pierce March 29, 2016 08:04 PM UTC

Hi,

I can now get the sample to work, the odd thing is that none of the chat behaviors work in my app, they used to

hers the code

<chart:SfChart  VerticalOptions="FillAndExpand" IsVisible="{Binding BudgetVisible}" BackgroundColor="Transparent" >


          

            <chart:SfChart.PrimaryAxis>

            <chart:CategoryAxis LabelPlacement="BetweenTicks"  ZoomFactor="1"  LabelRotationAngle = "0" LabelsIntersectAction="MultipleRows">

              <!--SelectedIndex="{Binding SelectedValue}"-->

              <chart:CategoryAxis.Title>

                <chart:ChartAxisTitle Text="Day of Month"/>

              </chart:CategoryAxis.Title>

            </chart:CategoryAxis>

          </chart:SfChart.PrimaryAxis>


          <chart:SfChart.SecondaryAxis>

            

            <chart:NumericalAxis>

              <chart:NumericalAxis.Title>

                <chart:ChartAxisTitle Text="Cost"/>

              </chart:NumericalAxis.Title>


              <chart:NumericalAxis.LabelStyle>

                <chart:ChartAxisLabelStyle LabelFormat = "{Binding Detail.Result.Result.CostFormat}"/>

              </chart:NumericalAxis.LabelStyle>

            </chart:NumericalAxis>

          

          </chart:SfChart.SecondaryAxis>

          

          <chart:SfChart.Series>

            <chart:ColumnSeries ItemsSource = "{Binding Detail.Result.Result.DaysCumForGraph}" Color="{x:Static statics:Palette.LemongrassGreen}"/>

            <chart:LineSeries ItemsSource = "{Binding Detail.Result.Result.DaysBudgetForGraph}" Color="{x:Static statics:Palette.DarkGreen}"/>

          </chart:SfChart.Series>


          <chart:SfChart.ChartBehaviors>


            <chart:ChartZoomPanBehavior />

            


            <chart:ChartTrackballBehavior x:Name="trackBall" ShowLine="False" LabelDisplayMode="NearestPoint">

              <chart:ChartTrackballBehavior.LabelStyle>

                <chart:ChartTrackballLabelStyle LabelFormat="{Binding Binding Detail.Result.Result.CostFormatTrackBall}" />

              </chart:ChartTrackballBehavior.LabelStyle>

            </chart:ChartTrackballBehavior>

                   

            

          

          

          </chart:SfChart.ChartBehaviors>



          



        </chart:SfChart>


any ideas



KP Kieran Pierce March 29, 2016 08:36 PM UTC

Just tested this same code in windows phone 8.1 and it works fine including the binding which did not work befor the sfchar update


YP Yuvaraj Palanisamy Syncfusion Team March 30, 2016 03:11 PM UTC

Hi Kieran,

We are not able to reproduce the reported issues in our end.  We have prepared sample based on this. Please download the sample from location given below.


http://www.syncfusion.com/downloads/support/forum/123457/ze/SimpleSample-15740189571405615776

If you are still facing this issue, we kindly request you to update us the modified sample for helping you further.

Regards,
Yuvaraj



KP Kieran Pierce April 7, 2016 12:19 PM UTC

I have finally tracked down the issue. you need to have 2 charts on the same page, then the chart behaviours only apply the last one added. how to fix this?


SP Saravana Pandian Murugan Syncfusion Team April 8, 2016 01:55 PM UTC

Hi Kieran,

We are unable to reproduce the reported issue. We have prepared a sample which contains two Charts on the same page. Please download the sample from the location given below.

Sample : http://www.syncfusion.com/downloads/support/forum/123457/ze/ChartLabel1677899722

If you are still facing this issue, we kindly request you to update us the modified sample for helping you further.

Thanks,
Saravana Pandian M.


KP Kieran Pierce May 20, 2016 03:50 PM UTC

The issue is if you set the second chart in the stack to invisible


KP Kieran Pierce May 20, 2016 04:01 PM UTC

oh forgot to say, the latest SP have fixed the issue 


SP Saravana Pandian Murugan Syncfusion Team May 23, 2016 04:23 AM UTC

Hi Kieran,

Thanks for your update. We are glad to know that the given solution works. Please contact us if you need any further assistance.

Regards,
Saravana Pandian M.


Loader.
Live Chat Icon For mobile
Up arrow icon