コード例 #1
0
        public ChartPieSeriesSerializerTests()
        {
            var chart = ChartTestHelper.CreateChart <SalesData>();

            chart.DataSource = SalesDataBuilder.GetCollection();
            series           = new ChartPieSeries <SalesData, decimal>(chart, s => s.RepSales, s => s.RepName, s => s.Color, s => s.Explode);
        }
コード例 #2
0
        public ChartPieSeriesBuilderTests()
        {
            var chart = ChartTestHelper.CreateChart <SalesData>();

            series  = new ChartPieSeries <SalesData, decimal>(chart, s => s.RepSales, s => s.RepName, null, null);
            builder = new ChartPieSeriesBuilder <SalesData>(series);
        }
コード例 #3
0
        /// <summary>
        /// Defines pie series bound to inline data.
        /// </summary>
        /// <param name="data">
        /// The data to bind to
        /// </param>
        public virtual ChartPieSeriesBuilder <TModel> Pie(IEnumerable data)
        {
            ChartPieSeries <TModel, object> pieSeries = new ChartPieSeries <TModel, object>(data);

            Container.Series.Add(pieSeries);

            return(new ChartPieSeriesBuilder <TModel>(pieSeries));
        }
コード例 #4
0
        /// <summary>
        /// Defines pie series bound to inline data.
        /// </summary>
        /// <param name="data">
        /// The data to bind to
        /// </param>
        public virtual ChartPieSeriesBuilder <TModel> Pie(IEnumerable data)
        {
            Guard.IsNotNull(data, "data");

            ChartPieSeries <TModel, object> pieSeries = new ChartPieSeries <TModel, object>(Container, data);

            Container.Series.Add(pieSeries);

            return(new ChartPieSeriesBuilder <TModel>(pieSeries));
        }
コード例 #5
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ChartSeriesDefaults{T}" /> class.
 /// </summary>
 /// <param name="chart">The chart.</param>
 public ChartSeriesDefaults(Chart <T> chart)
     : base(chart)
 {
     Bar         = new ChartBarSeries <T, object>(chart);
     Column      = new ChartBarSeries <T, object>(chart);
     Line        = new ChartLineSeries <T, object>(chart);
     Pie         = new ChartPieSeries <T, object>(chart);
     Scatter     = new ChartScatterSeries <T, object>(chart);
     ScatterLine = new ChartScatterLineSeries <T, object>(chart);
 }
コード例 #6
0
        /// <summary>
        /// Defines bound pie series.
        /// </summary>
        /// <param name="expressionValue">
        /// The expression used to extract the series value from the chart model
        /// </param>
        public virtual ChartPieSeriesBuilder <TModel> Pie <TValue>(Expression <Func <TModel, TValue> > expressionValue, Expression <Func <TModel, string> > expressionCategory)
        {
            Guard.IsNotNull(expressionValue, "expressionValue");
            Guard.IsNotNull(expressionCategory, "expressionCategory");

            ChartPieSeries <TModel, TValue> pieSeries = new ChartPieSeries <TModel, TValue>(Container, expressionValue, expressionCategory, null, null);

            Container.Series.Add(pieSeries);

            return(new ChartPieSeriesBuilder <TModel>(pieSeries));
        }
コード例 #7
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ChartSeriesDefaults{T}" /> class.
 /// </summary>
 public ChartSeriesDefaults()
 {
     Bar          = new ChartBarSeries <T, object>();
     Column       = new ChartBarSeries <T, object>();
     Line         = new ChartLineSeries <T, object>();
     VerticalLine = new ChartLineSeries <T, object>();
     Pie          = new ChartPieSeries <T, object>();
     Scatter      = new ChartScatterSeries <T, object, object>();
     ScatterLine  = new ChartScatterLineSeries <T, object, object>();
     Area         = new ChartAreaSeries <T, object>();
     VerticalArea = new ChartAreaSeries <T, object>();
     OHLC         = new ChartOHLCSeries <T, object>();
 }
コード例 #8
0
        /// <summary>
        /// Defines bound pie series.
        /// </summary>
        public virtual ChartPieSeriesBuilder <TModel> Pie <TValue>(
            Expression <Func <TModel, TValue> > expressionValue,
            Expression <Func <TModel, string> > expressionCategory,
            Expression <Func <TModel, string> > expressionColor         = null,
            Expression <Func <TModel, bool> > expressionExplode         = null,
            Expression <Func <TModel, bool> > expressionVisibleInLegend = null
            )
        {
            ChartPieSeries <TModel, TValue> pieSeries = new ChartPieSeries <TModel, TValue>(expressionValue, expressionCategory, expressionColor, expressionExplode, expressionVisibleInLegend);

            Container.Series.Add(pieSeries);

            return(new ChartPieSeriesBuilder <TModel>(pieSeries));
        }
コード例 #9
0
ファイル: ChartSeriesDefaults.cs プロジェクト: wanaxe/Study
 /// <summary>
 /// Initializes a new instance of the <see cref="ChartSeriesDefaults{T}" /> class.
 /// </summary>
 public ChartSeriesDefaults()
 {
     Bar            = new ChartBarSeries <T, object>();
     Column         = new ChartBarSeries <T, object>();
     Line           = new ChartLineSeries <T, object>();
     VerticalLine   = new ChartLineSeries <T, object>();
     Pie            = new ChartPieSeries <T, object>();
     Donut          = new ChartDonutSeries <T, object>();
     Scatter        = new ChartScatterSeries <T, object, object>();
     ScatterLine    = new ChartScatterLineSeries <T, object, object>();
     Area           = new ChartAreaSeries <T, object>();
     VerticalArea   = new ChartAreaSeries <T, object>();
     OHLC           = new ChartOHLCSeries <T, object, string>();
     Bullet         = new ChartBulletSeries <T, object, string>();
     VerticalBullet = new ChartBulletSeries <T, object, string>();
     RadarArea      = new ChartRadarAreaSeries <T, object>();
     RadarColumn    = new ChartRadarColumnSeries <T, object>();
     RadarLine      = new ChartRadarLineSeries <T, object>();
     PolarArea      = new ChartPolarAreaSeries <T, object, object>();
     PolarLine      = new ChartPolarLineSeries <T, object, object>();
     PolarScatter   = new ChartPolarScatterSeries <T, object, object>();
 }
コード例 #10
0
ファイル: ChartTest.cs プロジェクト: xhanb/ECharts.Net
        public void ChartPieTest()
        {
            ChartPieSeries cps = new ChartPieSeries();

            cps.name       = "pie demo";
            cps.radius     = 90;
            cps.startAngle = 300;
            cps.type       = "pie";

            ChartSeriesData csd_pc = new ChartSeriesData();

            csd_pc.name  = "电脑";
            csd_pc.value = "23";

            ChartSeriesData csd_phone = new ChartSeriesData();

            csd_phone.name  = "手机";
            csd_phone.value = "88";

            List <object> data = new List <object>();

            data.Add(csd_pc);
            data.Add(csd_phone);

            cps.data = data;

            List <string> legend = new List <string>(4);

            legend.Add("电脑");
            legend.Add("手机");

            List <ChartPieSeries> cpss = new List <ChartPieSeries>();

            cpss.Add(cps);
            var str = ChartOpertation.ChartPieDataProcess(cpss, legend, true, "pie demo", "subtext", true);

            Assert.NotNull(str);
        }
コード例 #11
0
 public ChartPieSeriesBuilderTests()
 {
     var chart = ChartTestHelper.CreateChart<SalesData>();
     series = new ChartPieSeries<SalesData, decimal>(chart, s => s.RepSales, s => s.RepName, null, null);
     builder = new ChartPieSeriesBuilder<SalesData>(series);
 }
コード例 #12
0
 public ChartPieSeriesSerializerTests()
 {
     var chart = ChartTestHelper.CreateChart<SalesData>();
     chart.DataSource = SalesDataBuilder.GetCollection();
     pieSeries = new ChartPieSeries<SalesData, decimal>(chart, s => s.RepSales, s => s.RepName, s => s.Color, s => s.Explode);
 }