我与葡萄城的故事

---从C1到葡萄城

记得2008年的时候,我开始接触.Net控件,当时试用过C1、NetAdvantage等工具,由于C1文章比较少,缺乏支持,我们最后采用了NetAdvantage。
2014年的时候,公司需要用WPF开发大屏幕展示,我找来找去又找到了C1,才发现有个论坛,里面都是C1的疑难解答样例,我才知道,C1已经属于葡萄城控件的一员了。
前期我们先做示例开发,中间碰到各种问题,不能解决的基本都在论坛里面提出问题,提供demo,这样的支持真是其他国外控件不能做到的。
要说心得的话,那就是那段时间我在考虑C1的时候还考察了另一个控件Visifire,在使用过程中我慢慢发现,二者有一个重要的区别。


比如一个线图,如果有三条线的话需要展示,对于C1来说,需要做3个数据集合,并一个一个的加入到的数据源里面去。如下:
            chartInternalPrice.Data.Children.Add(new C1.WPF.C1Chart.DataSeries()
            {
                ChartType = C1.WPF.C1Chart.ChartType.LineSymbols,
                ValuesSource = listWTI,
                ConnectionStrokeThickness = 5,
                Label = FindResource("wti_text").ToString(),
                ConnectionStroke = new SolidColorBrush(Colors.Orange)
            });
            chartInternalPrice.Data.Children.Add(new C1.WPF.C1Chart.DataSeries()
            {
                ChartType = C1.WPF.C1Chart.ChartType.LineSymbols,
                ValuesSource = listBLT,
                ConnectionStrokeThickness = 5,
                Label = FindResource("blt_text").ToString(),
                ConnectionStroke = new SolidColorBrush(Colors.Gray)
            });
            chartInternalPrice.Data.Children.Add(new C1.WPF.C1Chart.DataSeries()
            {
                ChartType = C1.WPF.C1Chart.ChartType.LineSymbols,
                ValuesSource = listDB,
                ConnectionStrokeThickness = 5,
                Label = FindResource("db_text").ToString(),
                ConnectionStroke = new SolidColorBrush(Colors.Gainsboro)
            });
而对于visifire,就不是这样,他的数据源需要一个集合就行,也就是一个list就可以,当然这个list需要用字段来区分开不同的线数据。抓住了这点,再用C1其他类型的控件就可以根据情况提供数据了。

我与葡萄城的故事

posted on 2014-11-13 09:37  catvi  阅读(473)  评论(2编辑  收藏  举报

导航