维西火查询
我正在 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>
I am making a bar graph in visifire and I want to make a custom legend.
I already achieved the custom legend but I want to stack it vertically.
Here is my code:
<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>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
尝试在图例中设置 MaxWidth="100"。
http://www.visifire.com/documentation/Visifire_Documentation/Charts /Reference/Attribute_Reference/maxwidth.htm
Try setting MaxWidth="100" in Legend.
http://www.visifire.com/documentation/Visifire_Documentation/Charts/Reference/Attribute_Reference/maxwidth.htm