WPF D3 Dynamic Data Display Multiple axes

感情迁移 提交于 2019-12-11 11:41:51

问题


I have a Dynamic Data Display chart. I am using ChartPlotter. It has a default X and Y Axis. I need to add an extra X axis and two more Y axes. How can I achieve this in XAML and dynamically in code?

The data may be attached to any of these axes by the developers using these charts by providing the enum for the axis number, say, Y1, Y2, Y3 and so on or X1, X2. Currently I would like to have the above limited number of axes.

Could somebody help me out with a solution to this? I know to add Injected Plotter but would I then have to add multiple injected plotters? And if the number of axes does increase, how many more would I have to add? It feels a bit inefficient, hence the question on adding axes to the single ChartPlotter.


回答1:


In Dynamic Data Display, each ChartPlotter has a MainHorizontalAxis, and a MainVerticalAxis. On top of that you have the ability to add in new axes. You can create a new Axis object and add it to your plotter very easily. You would add the axis to the plotters children like so :

plotter.Children.Add(axis);

You would set up the axis object beforehand to match the behaviour you desire, and then add the axis to the plot.

EDIT

It looks to me like it's possible to create multiple Graph objects and add them to the plotters children as well. It looks like you are able to assign which axes are applied to which graph object, and then map them accordingly. Information taken from this discussion, and the code posted there.



来源:https://stackoverflow.com/questions/10696407/wpf-d3-dynamic-data-display-multiple-axes

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!