如何在WinRT XAML Toolkit折线图中设置轴边距? [英] How to set axis margin in WinRT XAML Toolkit line chart?
问题描述
答案
最后,我用这个答案解决了我的问题。
Finally I solved my answer with this.
((LineSeries)MyChart.Series[0]).IndependentAxis = new LinearAxis
{
Minimum = 1,
Maximum = 5,
Orientation = AxisOrientation.X,
Interval = 1,
Margin = new Thickness(10, 0, 10, 0)
};
((LineSeries)MyChart.Series[0]).Clip = null;
((LineSeries)MyChart.Series[0]).Margin = new Thickness(10, 0, 10, 0);
href =https://winrtxamltoolkit.codeplex.com/ =nofollow noreferrer> WinRT XAML工具包。我手动设置X轴,但是当我设置我变得开始&终点。我试图设置边距和填充,但它不工作。
I am drawing line chart with help of WinRT XAML Toolkit. I am setting X axis manually, but when I set I am getting wierd start & end point. I tried to set margin and padding but it's not working. Will you please suggest me how can I do that ?
((LineSeries)MyChart.Series[0]).IndependentAxis = new LinearAxis
{
Minimum = 1,
Maximum = 5,
Orientation = AxisOrientation.X,
Interval = 1,
//Margin = .... Not working
//Padding = .... Not working
};
推荐答案
我将使用一个可视化的树调试器从这些数据点走向可视树,以查看Clip属性设置的位置。事实上,我只是在样本项目上做的,它是在LineSeries上设置的。看看它是否设置为其XAML模板的一部分,或者如果它在C#中完成,并删除它。此外,您可以更改X轴上的最小/最大值以获得更多空间。我将添加清除这一切到我的TODO列表。
I'd use a visual tree debugger to walk up the visual tree from these data points to see where the Clip property is set. In fact I just did that on the samples project and it is set on the LineSeries. See if it's set as part of its XAML template or if it is done in C# and remove it there. Also you could change the Minimum/Maximum values on your X axis to make more space. I'll add cleaning this all up to my TODO list.
这篇关于如何在WinRT XAML Toolkit折线图中设置轴边距?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!