0

我正在 visifire 中制作条形图,我想制作一个自定义图例。我已经实现了自定义图例,但我想垂直堆叠它。

这是我的代码:

                    <visifire:Chart.PlotArea>
                        <visifire:PlotArea ShadowEnabled="false"></visifire:PlotArea>
                    </visifire:Chart.PlotArea>
                    <visifire:Chart.Legends>
                        <visifire:Legend x:Name="Legend0" Height="30" Width="50" HorizontalAlignment="Right" VerticalAlignment="Top" EntryMargin="5"
                        FontSize="10" FontWeight="Bold" ShadowEnabled="False" BorderThickness="0" Background="Transparent" LightingEnabled="False" />
                    </visifire:Chart.Legends>
                    <visifire:Chart.Series>
                        <visifire:DataSeries RenderAs="Column" LabelEnabled="True" Margin="-1,0,1,0" ShowInLegend="True" HorizontalAlignment="Right" VerticalAlignment="Top" LegendText="Candidates" DataSource="{Binding PositionLevelRecruitmentList}">
                            <visifire:DataSeries.DataMappings>
                                <visifire:DataMapping MemberName="AxisXLabel" Path="FullCodeAndLevel"></visifire:DataMapping>
                                <visifire:DataMapping MemberName="YValue" Path="ApplicantCount"></visifire:DataMapping>
                            </visifire:DataSeries.DataMappings>
                        </visifire:DataSeries>
                        <visifire:DataSeries RenderAs="Column" LabelEnabled="True" Margin="5,0,1,0" ShowInLegend="True" HorizontalAlignment="Right" VerticalAlignment="Top" LegendText="Required" DataSource="{Binding PositionLevelRecruitmentList}">
                            <visifire:DataSeries.DataMappings>
                                <visifire:DataMapping MemberName="YValue" Path="RequiredCount"></visifire:DataMapping>
                            </visifire:DataSeries.DataMappings>
                        </visifire:DataSeries>
                        <visifire:DataSeries RenderAs="Column" LabelEnabled="True" Margin="5,0,1,0" ShowInLegend="True" HorizontalAlignment="Right" VerticalAlignment="Top" LegendText="Fulfilled" DataSource="{Binding PositionLevelRecruitmentList}">
                            <visifire:DataSeries.DataMappings>
                                <visifire:DataMapping MemberName="YValue" Path="FulfilledCount"></visifire:DataMapping>
                            </visifire:DataSeries.DataMappings>
                        </visifire:DataSeries>
                    </visifire:Chart.Series>
                </visifire:Chart>
4

1 回答 1

1

尝试在 Legend 中设置 MaxWidth="100"。

http://www.visifire.com/documentation/Visifire_Documentation/Charts/Reference/Attribute_Reference/maxwidth.htm

于 2011-07-21T07:39:26.863 回答