Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/275.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 更改和设置DynamicDataDisplay的未来图例(线条图)_C#_Wpf_Dynamic Data Display - Fatal编程技术网

C# 更改和设置DynamicDataDisplay的未来图例(线条图)

C# 更改和设置DynamicDataDisplay的未来图例(线条图),c#,wpf,dynamic-data-display,C#,Wpf,Dynamic Data Display,我正在使用这个很棒的库来绘制一些2D图形 在旧的D3中,我使用以下方式设置图例: graf = plotter.AddLineGraph(new CompositeDataSource(xSrc, plot), new Pen(brush, 4), new PenDescription("myText" )); 但我不知道如何在未来的D3中获得同样的效果。有人能让我看到光明吗 浏览源代码我发现了这一点,但无法理

我正在使用这个很棒的库来绘制一些2D图形

在旧的D3中,我使用以下方式设置图例:

graf = plotter.AddLineGraph(new CompositeDataSource(xSrc, plot),
                     new Pen(brush, 4),
                     new PenDescription("myText" ));
但我不知道如何在未来的D3中获得同样的效果。有人能让我看到光明吗

浏览源代码我发现了这一点,但无法理解如何访问和更改默认字符串“LineGraph”:


将线形图添加到绘图仪(
AddLineGraph(…)
)时,其中一个参数是描述字符串。

v0.4.0使用以下语法:

// For access to the Legend class
using Microsoft.Research.DynamicDataDisplay.Charts;

... snip ...
LineGraph lineGraph = new LineGraph(dataSource);
lineGraph.LinePen = new Pen(Brushed.Green, 1.0);
Legend.SetDescription(lineGraph, "The line label");
plotter.Children.Add(lineGraph);
... snip ...
plotter.AddLineGraph(dataSource, pen, marker, new PenDescription("The line label"));
v0.3.0使用了以下语法:

// For access to the Legend class
using Microsoft.Research.DynamicDataDisplay.Charts;

... snip ...
LineGraph lineGraph = new LineGraph(dataSource);
lineGraph.LinePen = new Pen(Brushed.Green, 1.0);
Legend.SetDescription(lineGraph, "The line label");
plotter.Children.Add(lineGraph);
... snip ...
plotter.AddLineGraph(dataSource, pen, marker, new PenDescription("The line label"));

WGW是正确的!我竖起大拇指

我发现用稍微不同的方式做比较容易理解:

<Page 

...

xmlns:d3="http://research.microsoft.com/DynamicDataDisplay/1.0"

... >

... 

<Grid Name="GridOne" Grid.Column="0" Grid.Row="0" Margin="13" />

</Page>

希望这能有所帮助。

重复@xmedeko这个问题是两年前提出的