C# Dynamicdatadisplay字符绘图仪集标题(代码中)

C# Dynamicdatadisplay字符绘图仪集标题(代码中),c#,C#,如何在代码中设置图表绘图仪轴标题 plotterTotal.HorizontalAxis = new HorizontalDateTimeAxis() { Name = "dateAxis" }; plotterTotal.VerticalAxis = new VerticalIntegerAxis() { Name = "powerAxis" }; 模拟此xaml //<d3:Header Content="Count

如何在代码中设置图表绘图仪轴标题

plotterTotal.HorizontalAxis = new HorizontalDateTimeAxis() { Name = "dateAxis" };
                        plotterTotal.VerticalAxis = new VerticalIntegerAxis() { Name =         "powerAxis" };
模拟此xaml

 //<d3:Header  Content="Counter power"/>
                        //<d3:VerticalAxisTitle Content="Power" Name="valueAxis"/>
                        //<d3:HorizontalAxisTitle Content="Date"/>
//
//
//

这篇老文章,但它到底是怎么回事。。。

基本上,如果在xaml中设置了图表绘图仪,则需要为图表设置标题并为其指定Name属性


然后在代码中,引用属性并设置其内容。

试试这个,它对我有用

HorizontalAxisTitle horizontalAxisTitle = new HorizontalAxisTitle();
horizontalAxisTitle.Content = "abc";

VerticalAxisTitle verticalAxisTitle = new VerticalAxisTitle();
verticalAxisTitle.Content = "def";

plotterTotal.Children.Add(horizontalAxisTitle );
plotterTotal.Children.Add(verticalAxisTitle  );

欢迎来到堆栈溢出。回答问题时,最好包含相关链接中的信息。如果从该站点删除,您的答案仍然是完整的。