감사 필립에서 라인 시리즈 색상을 얻을하는 방법, 마지막으로 나는 색상을 설정하는 방법을 발견했다. Background
속성을 DataPointStyle
에 추가하면됩니다. 나는 나의 대답을 여기 올리고있다. 또한 기본 툴팁을 수정하는 방법을 발견했습니다.
<charting:LineSeries.DataPointStyle>
<Style TargetType="charting:LineDataPoint">
<Setter Property="Width" Value="17" />
<Setter Property="Height" Value="17" />
<Setter Property="Background" Value="Lime"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="charting:LineDataPoint">
<Grid>
<ToolTipService.ToolTip>
<ContentControl Content="{Binding Value,Converter={StaticResource MyConv},ConverterParameter=TEST}"/>
</ToolTipService.ToolTip>
<Ellipse Fill="Lime" Stroke="Lime" StrokeThickness="3" />
</Grid>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</charting:LineSeries.DataPointStyle>
Using a custom ToolTip in Silverlight charting
Showing lines with different colors on a Silverlight Toolkit’s LineChart?
질문 1
I 차트에서 여러 라인 차트 시리즈를 만드는 오전. 이제 WinRT XAML Toolkit은 각 계열에 임의의 방식으로 색상을 지정합니다. 데이터 포인트에 사용자 지정 스타일을 사용하고 있으므로 색상의 임의성이 사라지는 사용자 지정 스타일을 사용할 때. 그렇다면이 시리즈의 임의의 색상을 어떻게 설정하거나 얻을 수 있습니까? 색상을 얻을 수 있다면 데이터 포인트에 해당 색상을 사용할 수 있습니다. 색상을 설정할 수 있으면 직접 임의의 색상을 생성합니다.
질문 2
또한 데이터 포인트 위로 마우스를 이동하는 동안 도구 설명에 따라 값을 보여줍니다,하지만 난 그것을 달성하는 방법에 대한 자세한 내용을 보여주고 싶어?
여기 내 코드는 맞춤 스타일이 있습니다. 랜덤 컬러
<charting:Chart x:Name="LineChart" Title="Line Chart" Margin="70,0">
<charting:LineSeries
Title="Population 1"
IndependentValueBinding="{Binding Name}"
DependentValueBinding="{Binding Value}"
IsSelectionEnabled="True">
<charting:LineSeries.DataPointStyle>
<Style TargetType="charting:LineDataPoint">
<Setter Property="Width" Value="17" />
<Setter Property="Height" Value="17" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="charting:LineDataPoint">
<Ellipse Fill="Green" Stroke="Green" StrokeThickness="3" />
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</charting:LineSeries.DataPointStyle>
</charting:LineSeries>
<charting:LineSeries
Title="Population 2"
IndependentValueBinding="{Binding Name}"
DependentValueBinding="{Binding Value}"
IsSelectionEnabled="True" Foreground="Blue">
<charting:LineSeries.DataPointStyle>
<Style TargetType="charting:LineDataPoint">
<Setter Property="Width" Value="17" />
<Setter Property="Height" Value="17" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="charting:LineDataPoint">
<Ellipse Fill="Red" Stroke="Red" StrokeThickness="3" />
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</charting:LineSeries.DataPointStyle>
</charting:LineSeries>
</charting:Chart>
표 (NO CUSTOM 데이터 포인트 스타일) (CUSTOM 데이터 포인트 스타일) NO 랜덤 컬러
차트 [둘 다 광고를 볼 수 황색 갖는다]
을