找回密码
 立即注册

QQ登录

只需一步,快速开始

不停息的翔龙

论坛元老

19

主题

107

帖子

1万

积分

论坛元老

积分
18259

活字格认证

不停息的翔龙
论坛元老   /  发表于:2014-8-4 14:09  /   查看:12195  /  回复:16

16 个回复

倒序浏览
Alice
社区贡献组   /  发表于:2014-8-4 15:46:00
沙发
回复 1楼不停息的翔龙的帖子

1.使用如下Xmal code在Chart中显示标题。
  1.         <c1:C1Chart HorizontalAlignment="Stretch" Margin="10,10,10,10" Name="c1Chart1" VerticalAlignment="Stretch">
  2.             <c1:C1Chart.Data>
  3.                 <c1:ChartData ItemNames="企业1 企业2 企业3 企业4 企业5">
  4.                     <c1:DataSeries Label="Series 1" RenderMode="Default" Values="20 22 19 24 25" />
  5.                 </c1:ChartData>
  6.             </c1:C1Chart.Data>
  7.             <c1:C1ChartLegend DockPanel.Dock="Right" />
  8.             <TextBlock DockPanel.Dock="Top" Text="2013年度报表" HorizontalAlignment="Center"/>
  9.         </c1:C1Chart>
复制代码

具体方法参考博客:
http://blog.gcpowertools.com.cn/ ... ustomize_title.aspx
2.打印chart:使用C1Chart.SaveImage方法将C1Chart存储成图片,然后就可以添加到C1Report或是C1PrintDocument,进行打印。
请点击评分,对我的服务做出评价!  5分为非常满意!

葡萄城控件服务团队

官方网站: http://www.gcpowertools.com.cn
回复 使用道具 举报
不停息的翔龙
论坛元老   /  发表于:2014-8-4 16:03:00
板凳
回复 2楼Alice的帖子

标题不居中 如何破?
回复 使用道具 举报
Alice
社区贡献组   /  发表于:2014-8-4 17:17:00
地板
请点击评分,对我的服务做出评价!  5分为非常满意!

葡萄城控件服务团队

官方网站: http://www.gcpowertools.com.cn
回复 使用道具 举报
不停息的翔龙
论坛元老   /  发表于:2014-8-4 18:07:00
5#
。。。标题放在Chart 外面 导出Chart图片 还能有 标题了吗??
回复 使用道具 举报
不停息的翔龙
论坛元老   /  发表于:2014-8-4 18:07:00
6#
回复 4楼Alice的帖子

。。。标题放在Chart 外面 导出Chart图片 还能有 标题了吗??
回复 使用道具 举报
Alice
社区贡献组   /  发表于:2014-8-4 19:32:00
7#
回复 6楼不停息的翔龙的帖子

可以自己写Convert,把标题放到中间。
Xmalcode参考:
  1. <Grid>
  2.         <Grid.Resources>
  3.             <Data:TitileAlignmentConvert x:Key="widthConverter"/>        
  4.         </Grid.Resources>
  5.         <DockPanel>
  6.             
  7.             <c1:C1Chart   HorizontalAlignment="Stretch"  Name="c1Chart1" VerticalAlignment="Stretch">
  8.                 <c1:C1Chart.Data>
  9.                     <c1:ChartData ItemNames="P1 P2 P3 P4 P5">
  10.                         <c1:DataSeries Label="Series 1" RenderMode="Default" Values="20 22 19 24 25" />
  11.                         <c1:DataSeries Label="Series 2" RenderMode="Default" Values="8 12 10 12 15" />
  12.                     </c1:ChartData>
  13.                 </c1:C1Chart.Data>
  14.                 <TextBlock  DockPanel.Dock="Top" Text="2013年度报表"  HorizontalAlignment="Center">
  15.                     <TextBlock.RenderTransform>
  16.                         <TranslateTransform X="{Binding Path=ActualWidth,ElementName=c1Chart1,Converter={StaticResource widthConverter}}"/>
  17.                     </TextBlock.RenderTransform>
  18.                 </TextBlock>
  19.                 <c1:C1ChartLegend />
  20.             </c1:C1Chart>
  21.         </DockPanel>      
  22.     </Grid>
复制代码

Converter代码:
  1. [ValueConversion(typeof(double), typeof(double))]
  2.     public class TitileAlignmentConvert : IValueConverter
  3.     {
  4.         public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
  5.         {
  6.             double width = 0;
  7.             if (double.TryParse(value.ToString(), out width))
  8.             {
  9.                 width = width  / 2;
  10.             }
  11.             return width;
  12.         }

  13.         public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
  14.         {
  15.             return value;
  16.         }
  17.     }
复制代码
请点击评分,对我的服务做出评价!  5分为非常满意!

葡萄城控件服务团队

官方网站: http://www.gcpowertools.com.cn
回复 使用道具 举报
不停息的翔龙
论坛元老   /  发表于:2014-8-5 09:45:00
8#
回复 7楼Alice的帖子

有Demo么 给我一份
回复 使用道具 举报
Alice
社区贡献组   /  发表于:2014-8-5 10:03:00
9#
回复 8楼不停息的翔龙的帖子

这个是我自己写的,没有Demo。代码复制到本地可以使用。
请点击评分,对我的服务做出评价!  5分为非常满意!

葡萄城控件服务团队

官方网站: http://www.gcpowertools.com.cn
回复 使用道具 举报
不停息的翔龙
论坛元老   /  发表于:2014-8-5 10:14:00
10#
回复 9楼Alice的帖子


本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有帐号?立即注册

x
回复 使用道具 举报
12下一页
您需要登录后才可以回帖 登录 | 立即注册
返回顶部