1
我使用的是winrt xaml工具包列表图表,我想为度数创建图表,因此我需要为列表中的每个名称设置最小值和最大值,为此找到一条途径。这里是我的代码:如何在UWP图表上设置两值列
的XAML:
<charting:Chart x:Name="chart" FlowDirection="RightToLeft" HorizontalAlignment="Center" Width="800" VerticalAlignment="Top" Height="500" >
<charting:ColumnSeries Title="month" IndependentValuePath="Name" DependentValuePath="Amount" IsSelectionEnabled="True"/>
</charting:Chart>
C#
private void LoadChart()
{
List<weather> list = new List<weather>();
list.Add(new weather() { Name = "s1", Amount = 5.5 });
(chart.Series[0] as ColumnSeries).ItemsSource = list;
}
你不能做到这一点与'ColumnSeries'。完成此操作的_hackish_方法是使用带有两个'SeriesDefinition'的StackedColumnSeries',并将其中一个的颜色设置为透明。 – jsanalytics