コード例 #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
ファイル: Chart.cs プロジェクト: hazzik/telerikaspnetmvc
        /// <summary>
        /// Writes the initialization script.
        /// </summary>
        /// <param name="writer">The writer object.</param>
        public override void WriteInitializationScript(TextWriter writer)
        {
            var objectWriter = ClientSideObjectWriterFactory.Create(Id, "tChart", writer);

            objectWriter.Start();

            SerializeData("chartArea", ChartArea.CreateSerializer().Serialize(), objectWriter);
            SerializeData("plotArea", PlotArea.CreateSerializer().Serialize(), objectWriter);

            SerializeTheme(objectWriter);

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

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

            SerializeSeries(objectWriter);

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

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

            SerializeData("categoryAxis", CategoryAxis.CreateSerializer().Serialize(), objectWriter);

            SerializeData("valueAxis", ValueAxis.CreateSerializer().Serialize(), objectWriter);

            SerializeData("xAxis", XAxis.CreateSerializer().Serialize(), objectWriter);

            SerializeData("yAxis", YAxis.CreateSerializer().Serialize(), objectWriter);

            SerializeTransitions(objectWriter);

            SerializeDataBinding(objectWriter);

            SerializeSeriesColors(objectWriter);

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

            ClientEvents.SerializeTo(objectWriter);

            objectWriter.Complete();

            base.WriteInitializationScript(writer);
        }