Esempio n. 1
0
        /// <summary>
        /// 返回MakeLine字符串 不包含 markLine :
        /// </summary>
        /// <returns></returns>
        public string GetMakeLineString()
        {
            //StringBuilder sb = new StringBuilder();
            //sb.Append("            {");

            //sb.Append("                  smooth:" + smooth.ToString().ToLower() + ",");
            //if(effect!=null)
            //{
            //    sb.Append("                  effect:" + effect.GetEffectString() + ",");
            //}
            //sb.Append("                  symbol:" + symbol + ",");
            //sb.Append("                  itemStyle : " + itemStyle + ",");
            //sb.Append("                  data : " + GetLineDataString());

            //sb.Append("            }");

            //return sb.ToString();

            return(Util.Format(mlFmt,
                               smooth,
                               effect.GetEffectString(),
                               symbol,
                               itemStyle,
                               GetLineDataString()));
        }
Esempio n. 2
0
        /// <summary>
        /// 获得MakePointString 不包含markPoint :
        /// </summary>
        /// <returns></returns>
        public string GetMakePointString()
        {
            StringBuilder sb1 = new StringBuilder();

            foreach (PointItem point in this.data)
            {
                sb1.Append(point.GetMakePointString() + ",");
            }

            string data = sb1.ToString();

            //  避免报错
            if (data.Length == 0)
            {
                data = " ";
            }

            data = data.Substring(0, data.Length - 1);

            //StringBuilder sb = new StringBuilder();
            //sb.Append("            {");
            //sb.Append("                symbol : '"+symbol+"',");
            //sb.Append("                symbolSize : "+symbolSize+",");
            //sb.Append("                effect : "+effect.GetEffectString()+",");
            //sb.Append("                data : [");
            //sb.Append("                    "+data);
            //sb.Append("                ]");
            //sb.Append("            }");

            string strEff = "";

            if (effect != null)
            {
                strEff = "effect : " + effect.GetEffectString() + ",";
            }

            string mpString = @"
            {
                symbol : '{0}',
                symbolSize : {1},
                {2}
                data : [
                    {3}
                ]
            }
";

            return(Util.Format(mpString, symbol, symbolSize, strEff, data));
        }