سؤال

enter image description here

I am using line chart from WinRT XAML Toolkit. Now my IndependentValueBinding is done from integer values from 1 to 5, but when it is displayed, it also shows floating values like 1.2, 1.4, 1.6, etc....

So how can I display only 1, 2, 3, 4 & 5 on the X axis.

هل كانت مفيدة؟

المحلول

UPDATE 1

If you add IndependentAxis, then you will face clipping issue of data points, so here's solution for that.

How to set axis margin in WinRT XAML Toolkit line chart?


Finally I added this, and it worked.

((LineSeries)MyChart.Series[0]).IndependentAxis = new LinearAxis
                                                  {
                                                      Minimum = 1,
                                                      Maximum = 5,
                                                      Orientation = AxisOrientation.X,
                                                      Interval = 1
                                                  };

نصائح أخرى

I don't know the WinRT XAML Toolkit, but with Telerik RadChart I have just solved the same issue by setting a property called MajorStep (which controls the value distance between the major tick lines of the axis) to a suitable integer value. Maybe WinRT XAML Toolkit has a similar property?

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top