我已将DATAPOINT样式应用于我在代码后面构建的散点图。 我希望分散点更大"尺寸和颜色"颜色"要大胆。我怎样才能做到这一点?这是我到目前为止编写的代码:
在后面的代码中创建系列:
ScatterSeries series;
chart1.Series.Clear();
for (int i = 0; i < model.CDFResults.Count; i++)
{
series = new ScatterSeries();
series.DependentValuePath = "Value";
series.IndependentValuePath = "Key";
series.ItemsSource = model.CDFResults[i].FinalResult1;
series.Title = model.CDFResults[i].categoryname;
series.LegendItemStyle = (Style)Layout.Resources["LegendItemStyle1"];
series.DataPointStyle = (Style)Layout.Resources["Datapointstyle1"];
chart1.Series.Add(series);
}
在XAML中:
<Style x:Key="Datapointstyle1" TargetType="chartingToolkit:ScatterDataPoint">
<Setter Property="Width" Value="20" />
<Setter Property="Height" Value="20" />
<Setter Property="FontWeight" Value="Bold" />
</Style>
<chartingToolkit:Chart Name="chart1" Background ="White" Title="Cumulative Distributed Function Plot" FontFamily="Tahoma" >
<chartingToolkit:Chart.Axes>
<chartingToolkit:LinearAxis Orientation="Y" ShowGridLines="True" FontSize="10" FontFamily="Tahoma" Title="Cumulative Probability"/>
<chartingToolkit:LinearAxis Orientation="X" ShowGridLines="True" FontSize="10" FontFamily="Tahoma"/>
</chartingToolkit:Chart.Axes>
</chartingToolkit:Chart>
下图描述了我想要实现的目标! enter image description here