2

我使用 D3 DynamicDataDisplay 来满足我的图表需求,但​​是当我尝试为LineGraph元素设置图例描述时,它给了我错误:

The TypeConverter for "Description" does not support converting from string

好的,但是如何设置呢?我试过了:

<d3:LineGraph DataSource="{Binding Path=AvgWaitingTimes}" Stroke="Blue"
              Description="Some description"/>

它给出了我写的错误。我也试过这个:

<d3:LineGraph DataSource="{Binding Path=AvgConnectedTimes}" Stroke="Green">
    <d3:ViewportElement2D.Description>
        ??
    </d3:ViewportElement2D.Description>
</d3:LineGraph>

问题是我没有什么可以代替??. 如何处理?图书馆真的很棒,但我坚持这个。

4

2 回答 2

3

有趣的是,有时在 SO 上写问题会导致我自己很快找到答案:]

看来第二个代码没问题,你只需要添加:

<d3:PenDescription DescriptionString="Description is great!"/>

我不知道为什么我以前没有注意到它。

于 2014-02-20T09:22:44.813 回答
1
    <d3:ChartPlotter>
        <d3:LineGraph Stroke="Green" x:Name="line">
            <d3:ViewportElement2D.Description >
                <d3:PenDescription DescriptionString="Test"/>
            </d3:ViewportElement2D.Description>
        </d3:LineGraph>
    </d3:ChartPlotter>
于 2014-02-20T13:14:17.670 回答