chart控件基礎設置

1.chart圖顯示點和數值:
      <dxc:LineSeries2D AxisY="{Binding ElementName=axisy1}" DisplayName="Ratio" ArgumentDataMember="UserName" ValueDataMember="DefectRatio" CrosshairLabelPattern="{}{S}: {V:0.00%}" LabelsVisibility="False" MarkerVisible="True">
                                        <dxc:LineSeries2D.LineStyle>
                                            <dxc:LineStyle Thickness="3"/>
                                        </dxc:LineSeries2D.LineStyle>
                                    </dxc:LineSeries2D>

 

LabelsVisibility :是否顯示數值
MarkerVisible:是否顯示點
 
2.設置Y軸不從0開始顯示:
 <dxc:XYDiagram2D.AxisY>
                                        <dxc:AxisY2D>
                                            <dxc:AxisY2D.Label>
                                                <dxc:AxisLabel TextPattern="{}{V:p}"/>
                                            </dxc:AxisY2D.Label>
                                            <dxc:AxisY2D.WholeRange>
                                                <dxc:Range dxc:AxisY2D.AlwaysShowZeroLevel="False"/>
                                            </dxc:AxisY2D.WholeRange>
                                        </dxc:AxisY2D>
                                    </dxc:XYDiagram2D.AxisY>

3.設置Line:app

<dxc:LineSeries2D DisplayName="Dwell Yield Target" AxisY="{Binding ElementName=axisy0}" ArgumentDataMember="X" 
                                      ValueDataMember="Y5" Brush="#9D3D3A" MarkerVisible="False"  LabelsVisibility="True" CrosshairLabelPattern="{}{S}: {V:0.00%}">
                                            <dxc:LineSeries2D.MarkerModel>
                                                <dxc:SquareMarker2DModel/>
                                            </dxc:LineSeries2D.MarkerModel>
                                            <dxc:LineSeries2D.Label>
                                                <dxc:SeriesLabel TextPattern="{}{V:0.0%}" ConnectorVisible="False" ResolveOverlappingMode="HideOverlapped">
                                                    <dxc:SeriesLabel.ElementTemplate>
                                                        <DataTemplate>
                                                            <Border>
                                                                <Label Content="{Binding Path=Text}" Foreground="Black" FontSize="10"/>
                                                            </Border>
                                                        </DataTemplate>
                                                    </dxc:SeriesLabel.ElementTemplate>
                                                </dxc:SeriesLabel>
                                            </dxc:LineSeries2D.Label>
                                            <dxc:LineSeries2D.LineStyle>
                                                <dxc:LineStyle Thickness="2">
                                                    <dxc:LineStyle.DashStyle>
                                                        <DashStyle Dashes="3" Offset="0">
                                                        </DashStyle>
                                                    </dxc:LineStyle.DashStyle>
                                                </dxc:LineStyle>
                                            </dxc:LineSeries2D.LineStyle>
                                        </dxc:LineSeries2D>

Thickness:設置Line的寬度ssh

Dashes:點與線以前的長度ide

相關文章
相關標籤/搜索