我尝试在wpf工具包中更改磅值
<charting:Chart Name="Charts" Margin="87,48,0,0" Grid.Column="1">
<charting:LineSeries Name="ChartOne" DependentValuePath="Y" IndependentValuePath="X" Title="График функции" AnimationSequence="FirstToLast"/>
<charting:Chart.Axes>
<charting:LinearAxis Orientation="Y" Title="Y" ShowGridLines="True" Minimum="0"/>
<charting:LinearAxis Orientation="X" Title="X" ShowGridLines="True" Minimum="0"/>
</charting:Chart.Axes>
<charting:LineSeries.DataPointStyle>
<Style TargetType="chartingToolkit:LineDataPoint">
<Setter Property="Width" Value="20"/>
<Setter Property="Height" Value="20"/>
</Style>
</charting:LineSeries.DataPointStyle>
</charting:Chart>
但我有一个错误&#34;可附加属性&#39; DataPointStyle&#39;没有找到类型&#39; LineSeries&#39;&#34; 我做错了什么?
答案 0 :(得分:3)
此代码适用于我
<Window x:Class="WpfApplication1.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:charting="clr-namespace:System.Windows.Controls.DataVisualization.Charting;assembly=System.Windows.Controls.DataVisualization.Toolkit"
Title="MainWindow" Height="350" Width="525">
<Grid>
<charting:Chart Name="Charts" Margin="87,48,0,0" Grid.Column="1">
<charting:Chart.Axes>
<charting:LinearAxis Orientation="Y" Title="Y" ShowGridLines="True" Minimum="0"/>
<charting:LinearAxis Orientation="X" Title="X" ShowGridLines="True" Minimum="0"/>
</charting:Chart.Axes>
<charting:LineSeries Name="ChartOne" DependentValuePath="Y" IndependentValuePath="X"
Title="График функции" AnimationSequence="FirstToLast">
<charting:LineSeries.DataPointStyle>
<Style TargetType="{x:Type charting:LineDataPoint}">
<Setter Property="Width" Value="20"/>
<Setter Property="Height" Value="20"/>
</Style>
</charting:LineSeries.DataPointStyle>
</charting:LineSeries>
</charting:Chart>
</Grid>