使用DevExpress Chart 3D控件时如何使X轴和Y轴的长度相同?

问题描述 投票:0回答:1

最近在研究DevExpress WPF Chart 3D控件,修改示例代码生成如下图表[![图表图片][1]][1]

我的代码片段是

var points = new List<TestPoint>();
for (int i = 0; i < 90; i++)
{
    for (int j = 0; j < 360; j++)
    {
        points.Add(new TestPoint()
        {
          X = i,
          Y = j,
          Z = new Random(i * j % 10).NextDouble() * 10 + 100
        });
    }
}
...
DoubleCollection mapX = new DoubleCollection(xArray.Length);
DoubleCollection mapY = new DoubleCollection(yArray.Length);
DoubleCollection values = new DoubleCollection(xArray.Length * yArray.Length);

for (int i = 0; i < xArray.Length; i++)
{
    mapX.Add(xStart + i * xStep);
    for (int j = 0; j < yArray.Length; j++)
    {
        mapY.Add(yStart + j * yStep);
        double value = array[i, j];
        values.Add(value);
    }
}
MapY = mapX;
MapX = mapY;
MapValues = values;

如何使X轴和Y轴的长度相同,使XY平面为正方形? 任何帮助,将不胜感激。 [1]: https://i.stack.imgur.com/PorZ8.png

charts devexpress axis
1个回答
0
投票

我找到了解决方案。将 Chart3DControl 的 AspectRatio 设置为“1 1 1”效果很好。

© www.soinside.com 2019 - 2024. All rights reserved.