internal Hashtable ToHashtable(JQChart chart)
 {
     Hashtable hashtable = new Hashtable();
     if (this.Align != ChartHorizontalAlign.Center)
     {
         hashtable.Add("align", this.Align.ToString().ToLower());
     }
     if (!string.IsNullOrEmpty(this.Color))
     {
         hashtable.Add("color", this.Color);
     }
     if (this.Enabled)
     {
         hashtable.Add("enabled", true);
     }
     if (!string.IsNullOrEmpty(this.Formatter))
     {
         hashtable.Add("formatter", this.Formatter);
         chart.ReplaceTable.Add(string.Format("\"{0}\":\"{1}\"", "formatter", this.Formatter), string.Format("{0}:{1}", "formatter", this.Formatter));
     }
     if (this.Rotation != 0)
     {
         hashtable.Add("rotation", this.Rotation);
     }
     if (this.X != 0)
     {
         hashtable.Add("x", this.X);
     }
     if (this.Y != -6)
     {
         hashtable.Add("y", this.Y);
     }
     return hashtable;
 }
Exemple #2
0
        internal Hashtable ToHashtable(JQChart chart)
        {
            Hashtable hashtable = new Hashtable();

            if (this.X.HasValue || this.XDate.HasValue || this.Text != null)
            {
                hashtable.Add("x", this.GetXJson(chart));
                hashtable.Add("name", this.GetXJson(chart));
            }
            if (this.Y.HasValue)
            {
                hashtable.Add("y", this.GetYJson(chart));
            }
            if (this.Marker.IsSet())
            {
                hashtable.Add("marker", this.Marker.ToHashtable());
            }
            if (this.Sliced)
            {
                hashtable.Add("sliced", true);
            }
            if (this.Selected)
            {
                hashtable.Add("selected", true);
            }
            if (!string.IsNullOrEmpty(this.Color))
            {
                hashtable.Add("color", this.Color);
            }
            return(hashtable);
        }
Exemple #3
0
        internal Hashtable ToHashtable(JQChart chart)
        {
            Hashtable hashtable = new Hashtable();

            if (this.Align != ChartHorizontalAlign.Center)
            {
                hashtable.Add("align", this.Align.ToString().ToLower());
            }
            if (!string.IsNullOrEmpty(this.Color))
            {
                hashtable.Add("color", this.Color);
            }
            if (this.Enabled)
            {
                hashtable.Add("enabled", true);
            }
            if (!string.IsNullOrEmpty(this.Formatter))
            {
                hashtable.Add("formatter", this.Formatter);
                chart.ReplaceTable.Add(string.Format("\"{0}\":\"{1}\"", "formatter", this.Formatter), string.Format("{0}:{1}", "formatter", this.Formatter));
            }
            if (this.Rotation != 0)
            {
                hashtable.Add("rotation", this.Rotation);
            }
            if (this.X != 0)
            {
                hashtable.Add("x", this.X);
            }
            if (this.Y != -6)
            {
                hashtable.Add("y", this.Y);
            }
            return(hashtable);
        }
Exemple #4
0
 internal object GetYJson(JQChart chart)
 {
     if (this.YDate.HasValue)
     {
         string text = string.Format("Date.UTC({0},{1},{2})", this.YDate.Value.Year, this.YDate.Value.Month - 1, this.YDate.Value.Day);
         chart.AddJsonReplacement(string.Format("\"{0}\"", text), text);
         return(text);
     }
     return(this.Y);
 }
Exemple #5
0
        internal Hashtable ToHashtable(JQChart chart)
        {
            Hashtable hashtable = new Hashtable();

            if (!string.IsNullOrEmpty(this.Name))
            {
                hashtable.Add("name", this.Name);
            }
            if (this.Type != ChartType.Line)
            {
                hashtable.Add("type", this.Type.ToString().ToLower());
            }
            if (!string.IsNullOrEmpty(this.Color))
            {
                hashtable.Add("color", this.Color);
            }
            if (this.Marker.IsSet())
            {
                hashtable.Add("marker", this.Marker.ToHashtable());
            }
            if (!string.IsNullOrEmpty(this.Stack))
            {
                hashtable.Add("stack", this.Stack);
            }
            if (this.DataLabels.IsSet(chart))
            {
                hashtable.Add("dataLabels", this.DataLabels.ToHashtable(chart));
            }
            if (!this.Size.IsEmpty)
            {
                if (this.Size.Type != UnitType.Percentage)
                {
                    hashtable.Add("size", this.Size.Value.ToString());
                }
                else
                {
                    hashtable.Add("size", this.Size.ToString());
                }
            }
            if (!this.InnerSize.IsEmpty)
            {
                if (this.InnerSize.Type != UnitType.Percentage)
                {
                    hashtable.Add("innerSize", this.InnerSize.Value.ToString());
                }
                else
                {
                    hashtable.Add("innerSize", this.InnerSize.ToString());
                }
            }
            return(hashtable);
        }
        internal Hashtable ToHashtable(JQChart chart)
        {
            return(new Hashtable
            {
                {
                    "area",
                    this.Area.ToHashtable(chart)
                },

                {
                    "areaspline",
                    this.AreaSpline.ToHashtable(chart)
                },

                {
                    "bar",
                    this.Bar.ToHashtable(chart)
                },

                {
                    "column",
                    this.Column.ToHashtable(chart)
                },

                {
                    "line",
                    this.Line.ToHashtable(chart)
                },

                {
                    "pie",
                    this.Pie.ToHashtable(chart)
                },

                {
                    "series",
                    this.Series.ToHashtable()
                },

                {
                    "scatter",
                    this.Scatter.ToHashtable(chart)
                },

                {
                    "spline",
                    this.Spline.ToHashtable(chart)
                }
            });
        }
Exemple #7
0
 internal object GetXJson(JQChart chart)
 {
     if (this.XDate.HasValue)
     {
         string text = string.Format("Date.UTC({0},{1},{2})", this.XDate.Value.Year, this.XDate.Value.Month - 1, this.XDate.Value.Day);
         chart.AddJsonReplacement(string.Format("\"{0}\"", text), text);
         return(text);
     }
     if (!string.IsNullOrEmpty(this.Text))
     {
         return(this.Text);
     }
     return(this.X);
 }
 public static string ToJSON(this List<ChartXAxisSettings> settings, JQChart chart)
 {
     string text = "";
     int num = 0;
     foreach (ChartXAxisSettings current in settings)
     {
         if (num > 0)
         {
             text += ",";
         }
         text += current.ToJSON(chart);
         num++;
     }
     if (num > 1)
     {
         text = "[" + text + "]";
     }
     return text;
 }
Exemple #9
0
        public static string ToJSON(this List <ChartXAxisSettings> settings, JQChart chart)
        {
            string text = "";
            int    num  = 0;

            foreach (ChartXAxisSettings current in settings)
            {
                if (num > 0)
                {
                    text += ",";
                }
                text += current.ToJSON(chart);
                num++;
            }
            if (num > 1)
            {
                text = "[" + text + "]";
            }
            return(text);
        }
 internal Hashtable ToHashtable(JQChart chart)
 {
     Hashtable hashtable = new Hashtable();
     if (!string.IsNullOrEmpty(this.Name))
     {
         hashtable.Add("name", this.Name);
     }
     if (this.Type != ChartType.Line)
     {
         hashtable.Add("type", this.Type.ToString().ToLower());
     }
     if (!string.IsNullOrEmpty(this.Color))
     {
         hashtable.Add("color", this.Color);
     }
     if (this.Marker.IsSet())
     {
         hashtable.Add("marker", this.Marker.ToHashtable());
     }
     if (!string.IsNullOrEmpty(this.Stack))
     {
         hashtable.Add("stack", this.Stack);
     }
     if (this.DataLabels.IsSet(chart))
     {
         hashtable.Add("dataLabels", this.DataLabels.ToHashtable(chart));
     }
     if (!this.Size.IsEmpty)
     {
         if (this.Size.Type != UnitType.Percentage)
         {
             hashtable.Add("size", this.Size.Value.ToString());
         }
         else
         {
             hashtable.Add("size", this.Size.ToString());
         }
     }
     if (!this.InnerSize.IsEmpty)
     {
         if (this.InnerSize.Type != UnitType.Percentage)
         {
             hashtable.Add("innerSize", this.InnerSize.Value.ToString());
         }
         else
         {
             hashtable.Add("innerSize", this.InnerSize.ToString());
         }
     }
     return hashtable;
 }
Exemple #11
0
        internal string ToJSON(JQChart chart)
        {
            Hashtable            hashtable            = new Hashtable();
            JavaScriptSerializer javaScriptSerializer = new JavaScriptSerializer();

            if (!this.AllowDecimals)
            {
                hashtable.Add("allowDecimals", false);
            }
            if (!string.IsNullOrEmpty(this.AlternateGridColor))
            {
                hashtable.Add("alternateGridColor", this.AlternateGridColor);
            }
            if (this.Categories.Count > 0)
            {
                hashtable.Add("categories", this.Categories.ToList());
            }
            if (this.EndOnTick)
            {
                hashtable.Add("endOnTick", true);
            }
            if (this.GridLineColor != "#C0C0C0")
            {
                hashtable.Add("gridLineColor", this.GridLineColor);
            }
            if (this.GridLineDashStyle != ChartLineDashStyle.ShortDot)
            {
                hashtable.Add("gridLineDashStyle", this.GridLineDashStyle.ToString().ToLower());
            }
            if (this.GridLineWidth != 0)
            {
                hashtable.Add("gridLineWidth", this.GridLineWidth);
            }
            if (!string.IsNullOrEmpty(this.ID))
            {
                hashtable.Add("id", this.ID);
            }
            hashtable.Add("labels", this.Labels.ToHashtable(chart));
            if (this.LineColor != "#C0D0E0")
            {
                hashtable.Add("lineColor", this.LineColor);
            }
            if (this.LineWidth != 1)
            {
                hashtable.Add("lineWidth", this.LineWidth);
            }
            if (this.LinkedTo != 0)
            {
                hashtable.Add("linkedTo", this.LinkedTo);
            }
            if (this.Max != double.PositiveInfinity)
            {
                hashtable.Add("max", this.Max);
            }
            if (this.MaxPadding != 0.01)
            {
                hashtable.Add("maxPadding", this.MaxPadding);
            }
            if (this.MaxZoom != 0)
            {
                hashtable.Add("maxZoom", this.MaxZoom);
            }
            if (this.Min != double.NegativeInfinity)
            {
                hashtable.Add("min", this.Min);
            }
            if (this.MinorGridLineColor != "#E0E0E0")
            {
                hashtable.Add("minorGridLineColor", this.MinorGridLineColor);
            }
            if (this.MinorGridLineWidth != 1)
            {
                hashtable.Add("minorGridLineWidth", this.MinorGridLineWidth);
            }
            if (this.Opposite)
            {
                hashtable.Add("opposite", true);
            }
            if (!this.Reversed)
            {
                hashtable.Add("reversed", false);
            }
            if (!this.ShowFirstLabel)
            {
                hashtable.Add("showFirstLabel", false);
            }
            if (this.ShowLastLabel)
            {
                hashtable.Add("showLastLabel", true);
            }
            hashtable.Add("title", this.Title.ToHashtable());
            if (this.TickInterval.HasValue)
            {
                hashtable.Add("tickInterval", this.TickInterval);
            }
            if (this.TickmarkPlacement != TickmarkPlacement.Between)
            {
                hashtable.Add("tickmarkPlacement", this.TickmarkPlacement.ToString().ToLower());
            }
            if (this.TickWidth != 1)
            {
                hashtable.Add("tickWidth", this.TickWidth);
            }
            if (this.Type != ChartAxisType.Linear)
            {
                hashtable.Add("type", this.Type.ToString().ToLower());
            }
            return(javaScriptSerializer.Serialize(hashtable));
        }
Exemple #12
0
 public JQChartRenderer(JQChart chart)
 {
     this._chart = chart;
 }
        internal Hashtable ToHashtable(JQChart chart)
        {
            return new Hashtable
            {

                {
                    "area",
                    this.Area.ToHashtable(chart)
                },

                {
                    "areaspline",
                    this.AreaSpline.ToHashtable(chart)
                },

                {
                    "bar",
                    this.Bar.ToHashtable(chart)
                },

                {
                    "column",
                    this.Column.ToHashtable(chart)
                },

                {
                    "line",
                    this.Line.ToHashtable(chart)
                },

                {
                    "pie",
                    this.Pie.ToHashtable(chart)
                },

                {
                    "series",
                    this.Series.ToHashtable()
                },

                {
                    "scatter",
                    this.Scatter.ToHashtable(chart)
                },

                {
                    "spline",
                    this.Spline.ToHashtable(chart)
                }
            };
        }
Exemple #14
0
        internal Hashtable ToHashtable(JQChart chart)
        {
            Hashtable hashtable = new Hashtable();

            if (this.AllowPointSelect)
            {
                hashtable.Add("allowPointSelect", true);
            }
            if (!this.Animation)
            {
                hashtable.Add("animation", false);
            }
            if (!string.IsNullOrEmpty(this.Color))
            {
                hashtable.Add("color", this.Color);
            }
            if (!string.IsNullOrEmpty(this.Cursor))
            {
                hashtable.Add("cursor", this.Cursor);
            }
            if (this.DashStyle != ChartLineDashStyle.Solid)
            {
                hashtable.Add("dashStyle", this.DashStyle.ToString().ToLower());
            }
            hashtable.Add("dataLabels", this.DataLabels.ToHashtable(chart));
            if (!this.EnableMouseTracking)
            {
                hashtable.Add("enableMouseTracking", false);
            }
            if (!string.IsNullOrEmpty(this.ID))
            {
                hashtable.Add("id", this.ID);
            }
            if (this.LineWidth != 2)
            {
                hashtable.Add("lineWidth", 2);
            }
            hashtable.Add("marker", this.Marker.ToHashtable());
            hashtable.Add("markerHover", this.MarkerHover.ToHashtable());
            hashtable.Add("markerSelect", this.MarkerSelect.ToHashtable());
            if (this.PointStart != 0)
            {
                hashtable.Add("pointStart", 0);
            }
            if (this.PointInterval != 1)
            {
                hashtable.Add("pointInterval", 1);
            }
            if (this.Selected)
            {
                hashtable.Add("selected", true);
            }
            if (!this.Shadow)
            {
                hashtable.Add("shadow", false);
            }
            if (this.ShowCheckBox)
            {
                hashtable.Add("showCheckBox", true);
            }
            if (!this.ShowInLegend)
            {
                hashtable.Add("showInLegend", false);
            }
            if (this.Stacking != ChartSeriesStacking.None)
            {
                hashtable.Add("stacking", this.Stacking.ToString().ToLower());
            }
            if (!this.StickyTracking)
            {
                hashtable.Add("stickTracking", false);
            }
            if (!this.Visible)
            {
                hashtable.Add("visible", false);
            }
            if (this.ZIndex != 0)
            {
                hashtable.Add("zIndex", this.ZIndex);
            }
            return(hashtable);
        }
 internal Hashtable ToHashtable(JQChart chart)
 {
     Hashtable hashtable = new Hashtable();
     if (this.AllowPointSelect)
     {
         hashtable.Add("allowPointSelect", true);
     }
     if (!this.Animation)
     {
         hashtable.Add("animation", false);
     }
     if (!string.IsNullOrEmpty(this.Color))
     {
         hashtable.Add("color", this.Color);
     }
     if (!string.IsNullOrEmpty(this.Cursor))
     {
         hashtable.Add("cursor", this.Cursor);
     }
     if (this.DashStyle != ChartLineDashStyle.Solid)
     {
         hashtable.Add("dashStyle", this.DashStyle.ToString().ToLower());
     }
     hashtable.Add("dataLabels", this.DataLabels.ToHashtable(chart));
     if (!this.EnableMouseTracking)
     {
         hashtable.Add("enableMouseTracking", false);
     }
     if (!string.IsNullOrEmpty(this.ID))
     {
         hashtable.Add("id", this.ID);
     }
     if (this.LineWidth != 2)
     {
         hashtable.Add("lineWidth", 2);
     }
     hashtable.Add("marker", this.Marker.ToHashtable());
     hashtable.Add("markerHover", this.MarkerHover.ToHashtable());
     hashtable.Add("markerSelect", this.MarkerSelect.ToHashtable());
     if (this.PointStart != 0)
     {
         hashtable.Add("pointStart", 0);
     }
     if (this.PointInterval != 1)
     {
         hashtable.Add("pointInterval", 1);
     }
     if (this.Selected)
     {
         hashtable.Add("selected", true);
     }
     if (!this.Shadow)
     {
         hashtable.Add("shadow", false);
     }
     if (this.ShowCheckBox)
     {
         hashtable.Add("showCheckBox", true);
     }
     if (!this.ShowInLegend)
     {
         hashtable.Add("showInLegend", false);
     }
     if (this.Stacking != ChartSeriesStacking.None)
     {
         hashtable.Add("stacking", this.Stacking.ToString().ToLower());
     }
     if (!this.StickyTracking)
     {
         hashtable.Add("stickTracking", false);
     }
     if (!this.Visible)
     {
         hashtable.Add("visible", false);
     }
     if (this.ZIndex != 0)
     {
         hashtable.Add("zIndex", this.ZIndex);
     }
     return hashtable;
 }
 public JQChartRenderer(JQChart chart)
 {
     this._chart = chart;
 }
 internal bool IsSet(JQChart chart)
 {
     return this.ToHashtable(chart).Count > 0;
 }
Exemple #18
0
 internal object GetXJson(JQChart chart)
 {
     if (this.XDate.HasValue)
     {
         string text = string.Format("Date.UTC({0},{1},{2})", this.XDate.Value.Year, this.XDate.Value.Month - 1, this.XDate.Value.Day);
         chart.AddJsonReplacement(string.Format("\"{0}\"", text), text);
         return text;
     }
     if (!string.IsNullOrEmpty(this.Text))
     {
         return this.Text;
     }
     return this.X;
 }
Exemple #19
0
 internal string ToJSON(JQChart chart)
 {
     return(new JavaScriptSerializer().Serialize(this.ToHashtable(chart)));
 }
Exemple #20
0
 internal object GetYJson(JQChart chart)
 {
     if (this.YDate.HasValue)
     {
         string text = string.Format("Date.UTC({0},{1},{2})", this.YDate.Value.Year, this.YDate.Value.Month - 1, this.YDate.Value.Day);
         chart.AddJsonReplacement(string.Format("\"{0}\"", text), text);
         return text;
     }
     return this.Y;
 }
 internal string ToJSON(JQChart chart)
 {
     Hashtable hashtable = new Hashtable();
     JavaScriptSerializer javaScriptSerializer = new JavaScriptSerializer();
     if (!this.AllowDecimals)
     {
         hashtable.Add("allowDecimals", false);
     }
     if (!string.IsNullOrEmpty(this.AlternateGridColor))
     {
         hashtable.Add("alternateGridColor", this.AlternateGridColor);
     }
     if (this.Categories.Count > 0)
     {
         hashtable.Add("categories", this.Categories.ToList());
     }
     if (this.EndOnTick)
     {
         hashtable.Add("endOnTick", true);
     }
     if (this.GridLineColor != "#C0C0C0")
     {
         hashtable.Add("gridLineColor", this.GridLineColor);
     }
     if (this.GridLineDashStyle != ChartLineDashStyle.ShortDot)
     {
         hashtable.Add("gridLineDashStyle", this.GridLineDashStyle.ToString().ToLower());
     }
     if (this.GridLineWidth != 0)
     {
         hashtable.Add("gridLineWidth", this.GridLineWidth);
     }
     if (!string.IsNullOrEmpty(this.ID))
     {
         hashtable.Add("id", this.ID);
     }
     hashtable.Add("labels", this.Labels.ToHashtable(chart));
     if (this.LineColor != "#C0D0E0")
     {
         hashtable.Add("lineColor", this.LineColor);
     }
     if (this.LineWidth != 1)
     {
         hashtable.Add("lineWidth", this.LineWidth);
     }
     if (this.LinkedTo != 0)
     {
         hashtable.Add("linkedTo", this.LinkedTo);
     }
     if (this.Max != double.PositiveInfinity)
     {
         hashtable.Add("max", this.Max);
     }
     if (this.MaxPadding != 0.01)
     {
         hashtable.Add("maxPadding", this.MaxPadding);
     }
     if (this.MaxZoom != 0)
     {
         hashtable.Add("maxZoom", this.MaxZoom);
     }
     if (this.Min != double.NegativeInfinity)
     {
         hashtable.Add("min", this.Min);
     }
     if (this.MinorGridLineColor != "#E0E0E0")
     {
         hashtable.Add("minorGridLineColor", this.MinorGridLineColor);
     }
     if (this.MinorGridLineWidth != 1)
     {
         hashtable.Add("minorGridLineWidth", this.MinorGridLineWidth);
     }
     if (this.Opposite)
     {
         hashtable.Add("opposite", true);
     }
     if (!this.Reversed)
     {
         hashtable.Add("reversed", false);
     }
     if (!this.ShowFirstLabel)
     {
         hashtable.Add("showFirstLabel", false);
     }
     if (this.ShowLastLabel)
     {
         hashtable.Add("showLastLabel", true);
     }
     hashtable.Add("title", this.Title.ToHashtable());
     if (this.TickInterval.HasValue)
     {
         hashtable.Add("tickInterval", this.TickInterval);
     }
     if (this.TickmarkPlacement != TickmarkPlacement.Between)
     {
         hashtable.Add("tickmarkPlacement", this.TickmarkPlacement.ToString().ToLower());
     }
     if (this.TickWidth != 1)
     {
         hashtable.Add("tickWidth", this.TickWidth);
     }
     if (this.Type != ChartAxisType.Linear)
     {
         hashtable.Add("type", this.Type.ToString().ToLower());
     }
     return javaScriptSerializer.Serialize(hashtable);
 }
Exemple #22
0
 internal Hashtable ToHashtable(JQChart chart)
 {
     Hashtable hashtable = new Hashtable();
     if (this.X.HasValue || this.XDate.HasValue || this.Text != null)
     {
         hashtable.Add("x", this.GetXJson(chart));
         hashtable.Add("name", this.GetXJson(chart));
     }
     if (this.Y.HasValue)
     {
         hashtable.Add("y", this.GetYJson(chart));
     }
     if (this.Marker.IsSet())
     {
         hashtable.Add("marker", this.Marker.ToHashtable());
     }
     if (this.Sliced)
     {
         hashtable.Add("sliced", true);
     }
     if (this.Selected)
     {
         hashtable.Add("selected", true);
     }
     if (!string.IsNullOrEmpty(this.Color))
     {
         hashtable.Add("color", this.Color);
     }
     return hashtable;
 }
 internal string ToJSON(JQChart chart)
 {
     return new JavaScriptSerializer().Serialize(this.ToHashtable(chart));
 }
 internal bool IsSet(JQChart chart)
 {
     return(this.ToHashtable(chart).Count > 0);
 }