C1chart柱状图想设置标签为百分比,如何操作?目前做出的效果如下-->
前台代码:
- <local:ChartPointConverter x:Key="pc"/>
- <DataTemplate x:Key="cake">
- <Grid c1:PlotElement.LabelAlignment="TopCenter">
- <TextBlock FontSize="10" Margin="0,0,0,-20" Foreground="DarkRed" Text="{Binding Converter={StaticResource pc}}" />
- </Grid>
- </DataTemplate>
- <c1:C1Chart Margin="0,20,0,0" x:Name="cakeChart" Grid.Row="0" ChartType="ColumnStacked">
- </c1:C1Chart>
复制代码 后台代码:
- DataTemplate tipTop = (DataTemplate)Resources["cake"];
- this.cakeChart.Data.Children[0].PointLabelTemplate = tipTop;
复制代码
想实现的效果如下-->
|