Пример #1
0
        protected virtual void Serialize(IDictionary <string, object> options)
        {
            SerializeData("chartArea", ChartArea.CreateSerializer().Serialize(), options);
            SerializeData("plotArea", PlotArea.CreateSerializer().Serialize(), options);

            SerializeTheme(options);

            if (RenderAs.HasValue)
            {
                options.Add("renderAs", RenderAs.ToString().ToLowerInvariant());
            }

            SerializeData("title", Title.CreateSerializer().Serialize(), options);

            SerializeData("legend", Legend.CreateSerializer().Serialize(), options);

            SerializeSeries(options);

            SerializePanes(options);

            SerializeData("seriesDefaults", SeriesDefaults.CreateSerializer().Serialize(), options);

            SerializeData("axisDefaults", AxisDefaults.CreateSerializer().Serialize(), options);

            SerializeAxes("categoryAxis", CategoryAxes, options);

            SerializeAxes("valueAxis", ValueAxes, options);

            SerializeAxes("xAxis", XAxes, options);

            SerializeAxes("yAxis", YAxes, options);

            SerializeTransitions(options);

            SerializeDataSource(options);

            SerializeSeriesColors(options);

            SerializeData("tooltip", Tooltip.CreateSerializer().Serialize(), options);

            if (AutoBind.HasValue)
            {
                options.Add("autoBind", AutoBind.Value);
            }
        }
Пример #2
0
 public Chart(ViewContext viewContext, IJavaScriptInitializer initializer, IUrlGenerator urlGenerator)
     : base(viewContext, initializer)
 {
     UrlGenerator             = urlGenerator;
     Title                    = new ChartTitle();
     ChartArea                = new ChartArea();
     PlotArea                 = new PlotArea();
     Legend                   = new ChartLegend();
     Series                   = new List <IChartSeries>();
     Panes                    = new List <ChartPane>();
     CategoryAxes             = new List <IChartCategoryAxis>();
     ValueAxes                = new List <IChartValueAxis>();
     XAxes                    = new List <IChartValueAxis>();
     YAxes                    = new List <IChartValueAxis>();
     SeriesDefaults           = new ChartSeriesDefaults <T>();
     AxisDefaults             = new ChartAxisDefaults <T>(this);
     Tooltip                  = new ChartTooltip();
     Transitions              = true;
     DataSource               = new DataSource();
     DataSource.Schema.Data   = "";
     DataSource.Schema.Total  = "";
     DataSource.Schema.Errors = "";
     DataSource.ModelType(typeof(T));
 }
Пример #3
0
 public PlotAreaSerializer(PlotArea plotArea)
 {
     this.plotArea = plotArea;
 }
Пример #4
0
 public PlotAreaSerializer(PlotArea plotArea)
 {
     this.plotArea = plotArea;
 }