この 1 週間、非常に多くの資料を読み、非常に多くのことを試しましたが、これではうまくいきません。
MainWindowView
以下に定義されているチェックボックスがあるメインウィンドウがあります。
<CheckBox IsChecked="{Binding Path=ocv_checkbox, Mode=TwoWay}" Margin="0, 0, 0, 2" Content="OCV"/>
<CheckBox IsChecked="{Binding Path=battery_temperature_checkbox, Mode=TwoWay}" Margin="0, 0, 0, 2" Content="Battery Temperture"/>
<CheckBox IsChecked="{Binding Path=slope_checkbox, Mode=TwoWay}" Margin="0, 0, 0, 2" Content="Slope"/>
どのボックスがチェックされているかに応じて、ユーザーが をクリックしたときにグラフに線をプロットしたいと考えていますButton
。同じグラフ上のすべての線が必要です。
問題は、クリックしたボックスによっては、プロットする追加の軸が必要になる場合があることです。たとえば、1 2 と 3 の 3 つのチェックボックスがあるとします。番号 1 と 2 の単位はインチで、チェックボックス 3 の単位はガロンです。3 つすべてがチェックされている場合、左側 (または右側) のインチの垂直軸と右側のガロンの軸が必要になります (プロット 3)。
D3を使用してプログラムでそれを行うにはどうすればよいですか? ドキュメントはほとんどなく、オンラインで明確な回答が必要です。
現在私は持っています:
<d3:ChartPlotter Name="plotter" Margin="10,10,20,10">
<d3:ChartPlotter.HorizontalAxis>
<d3:HorizontalIntegerAxis Name="dateAxis"/>
</d3:ChartPlotter.HorizontalAxis>
<d3:ChartPlotter.VerticalAxis>
<d3:VerticalIntegerAxis Name="countAxis"/>
</d3:ChartPlotter.VerticalAxis>
<d3:Header FontFamily="Arial" Content="{Binding ElementName=ThisGraphWindowInstance, Path=title}"/>
<d3:VerticalAxisTitle FontFamily="Arial" Content="{Binding ElementName=ThisGraphWindowInstance, Path=yAxis}"/>
<d3:HorizontalAxisTitle FontFamily="Arial" Content="{Binding ElementName=ThisGraphWindowInstance, Path=xAxis}"/>
</d3:ChartPlotter>
明らかにGraphWindowView.xaml
2つの軸しかありません。可能であれば、コードビハインドを使用して追加したいと思います。
ありがとう、リッチ