Example #1
0
        /// <summary>
        /// 속성들을 Xml Attribute로 생성합니다.
        /// </summary>
        /// <param name="writer">Attribute를 쓸 Writer</param>
        public override void GenerateXmlAttributes(System.Xml.XmlWriter writer)
        {
            base.GenerateXmlAttributes(writer);

            if (SeriesName.IsNotWhiteSpace())
            {
                writer.WriteAttributeString("seriesName", SeriesName);
            }
            if (Color.HasValue)
            {
                writer.WriteAttributeString("color", Color.Value.ToHexString());
            }
            if (Alpha.IsNotWhiteSpace())
            {
                writer.WriteAttributeString("alpha", Alpha);
            }
            if (Ratio.IsNotWhiteSpace())
            {
                writer.WriteAttributeString("ratio", Ratio);
            }
            if (ShowValues.HasValue)
            {
                writer.WriteAttributeString("showValues", ShowValues.GetHashCode().ToString());
            }
            if (Dashed.HasValue)
            {
                writer.WriteAttributeString("dashed", Dashed.GetHashCode().ToString());
            }
            if (IncludeInLegend.HasValue)
            {
                writer.WriteAttributeString("includeInLegend", IncludeInLegend.GetHashCode().ToString());
            }

            if (RenderAs.HasValue)
            {
                writer.WriteAttributeString("renderAs", RenderAs.ToString());
            }
            if (ParentYAxis.HasValue)
            {
                writer.WriteAttributeString("parentYAxis", ParentYAxis.ToString());
            }

            if (_anchorAttr != null)
            {
                _anchorAttr.GenerateXmlAttributes(writer);
            }
            if (_lineAttr != null)
            {
                _lineAttr.GenerateXmlAttributes(writer);
            }
        }
Example #2
0
        public override void WriteInitializationScript(System.IO.TextWriter writer)
        {
            if (ErrorCorrection != DefaultErrorCorrection)
            {
                Options["errorCorrection"] = ErrorCorrection.ToString();
            }

            if (Encoding != DefaultEncoding)
            {
                Options["encoding"] = Encoding.ToString();
            }

            if (!string.IsNullOrEmpty(Value))
            {
                Options["value"] = Value;
            }

            if (RenderAs.HasValue)
            {
                Options["renderAs"] = RenderAs.ToString().ToLowerInvariant();
            }

            if (!string.IsNullOrEmpty(Background))
            {
                Options["background"] = Background;
            }

            if (!string.IsNullOrEmpty(Color))
            {
                Options["color"] = Color;
            }

            if (this.Size.HasValue)
            {
                Options["size"] = Size;
            }

            if (this.Border.ShouldSerialize())
            {
                Options["border"] = Border.ToJson();
            }

            if (Padding.HasValue)
            {
                Options["padding"] = Padding;
            }

            writer.Write(Initializer.Initialize(Selector, "QRCode", Options));
            base.WriteInitializationScript(writer);
        }
Example #3
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);
            }
        }
Example #4
0
        public override void WriteInitializationScript(TextWriter writer)
        {
            var options = new Dictionary <string, object>();

            SerializeData("gaugeArea", this.GaugeArea.CreateSerializer().Serialize(), options);
            SerializeData("pointer", this.Pointer.CreateSerializer().Serialize(), options);
            SerializeData("scale", this.Scale.CreateSerializer().Serialize(), options);

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

            SerializeTheme(options);
            SerializeTransitions(options);

            writer.Write(Initializer.Initialize(Selector, "LinearGauge", options));
            base.WriteInitializationScript(writer);
        }
Example #5
0
        public override void WriteInitializationScript(TextWriter writer)
        {
            var options = new Dictionary <string, object>(Events);

            options["type"] = this.Encoding;

            if (this.Encoding == BarcodeSymbology.GS1128)
            {
                options["type"] = "gs1-128";
            }

            if (this.Checksum == false)
            {
                options["checksum"] = this.Checksum;
            }

            if (Value.HasValue())
            {
                options["value"] = Value;
            }

            if (RenderAs.HasValue)
            {
                options["renderAs"] = RenderAs.ToString().ToLowerInvariant();
            }

            if (Background.HasValue())
            {
                options["background"] = Background;
            }

            if (Color.HasValue())
            {
                options["color"] = Color;
            }

            if (Height.HasValue)
            {
                options["height"] = Height;
            }

            if (Width.HasValue)
            {
                options["width"] = Width;
            }

            if (this.Border.Color.HasValue() || this.Border.DashType != null ||
                this.Border.Width.HasValue)
            {
                options["border"] = new BarcodeElementBorderSerializer(this.Border).Serialize();
            }

            if (this.Padding.ShouldSerialize())
            {
                options["padding"] = this.Padding.CreateSerializer().Serialize();
            }

            if (this.Text.ShouldSerialize())
            {
                options["text"] = this.Text.ToJson();
            }

            writer.Write(Initializer.Initialize(Selector, "Barcode", options));

            base.WriteInitializationScript(writer);
        }