簡體   English   中英

具有多個Y軸的動態數據顯示

[英]Dynamic Data Display with multiple Y-axis

我必須在一個繪圖中顯示多個折線圖。 由於Y范圍值相差很大,我想為每條線分配一個特定的y軸。 我已經發現可以通過使用InjectionPlooter並為它們分配折線圖來做到這一點,但是每個y軸的比例都是相同的。

我正在使用ObservableDataSource作為值。

我的XAML代碼:

<d3:ChartPlotter x:Name="Plotter" Height="400" Grid.Row="1">
    <d3:InjectedPlotter Name="y2" Background="Aqua">
        <d3:VerticalAxis Placement="Left"/>
        <d3:VerticalAxisTitle Content="y2" Placement="Left" />
    </d3:InjectedPlotter>
    <d3:InjectedPlotter Name="y3" Background="Aqua">
        <d3:VerticalAxis Placement="Left"/>
        <d3:VerticalAxisTitle Content="y3" Placement="Left"/>
    </d3:InjectedPlotter>
    <d3:InjectedPlotter Name="y4" Background="Aqua">
        <d3:VerticalAxis Placement="Left"/>
        <d3:VerticalAxisTitle Content="y4" Placement="Left"/>
    </d3:InjectedPlotter>
</d3:ChartPlotter>

在y2-plotter中添加了一個折線圖的我的代碼

var data = new ObservableDataSource<Point>();

for (int i = 0; i < xvalues.Count(); i++)
{
data.Collection.Add(new Point(Convert.ToDouble(xvalues[i].Replace('.', ','), new CultureInfo("de-DE")) + xoffset, Convert.ToDouble(yaxes4Values[i].Replace('.', ','), new CultureInfo("de-DE"))));
}

LineGraph line = new LineGraph(data);
this.y2.Children.Add(line);

圖像: 具有4個y軸的多個折線圖

我真的希望有人可以幫助我縮放Y軸,因為某些折線圖僅顯示為水平線,而不顯示為整個高度的圖。

問候,Caipigott

我終於找到了解決方案。 我發現我正在使用的d3版本是V0.4,這是DynamicDataDisplay項目( d3future )的新Future。 在D3.Current內部,有一個很好的示例,稱為TwoIndependentAxes。

問候,Caipigott

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM