Esempio n. 1
0
        /// <summary>
        /// 创建选项数组.
        /// </summary>
        /// <returns>选项数组.</returns>
        public Option[] CreateOptions( )
        {
            if (this.RendererOptions == "{}" && null != this.rendererSetting)
            {
                this.RendererOptions = JQueryUI.MakeOptionExpression(this.rendererSetting.CreateOptions( ));
            }

            if (this.TickOptions == "{}" && null != this.tickRendererSetting)
            {
                this.TickOptions = JQueryUI.MakeOptionExpression(this.tickRendererSetting.CreateOptions( ));
            }

            if (this.LabelOptions == "{}" && null != this.lableRendererSetting)
            {
                this.LabelOptions = JQueryUI.MakeOptionExpression(this.lableRendererSetting.CreateOptions( ));
            }

            return(this.settingHelper.CreateOptions( ));
        }
Esempio n. 2
0
        /// <summary>
        /// 创建选项数组.
        /// </summary>
        /// <returns>选项数组.</returns>
        public Option[] CreateOptions( )
        {
            if (this.XAxis == string.Empty && null != this.xAxisSetting)
            {
                this.XAxis = JQueryUI.MakeOptionExpression(this.xAxisSetting.CreateOptions( ));
            }

            if (this.X2Axis == string.Empty && null != this.x2AxisSetting)
            {
                this.X2Axis = JQueryUI.MakeOptionExpression(this.x2AxisSetting.CreateOptions( ));
            }

            if (this.YAxis == string.Empty && null != this.yAxisSetting)
            {
                this.YAxis = JQueryUI.MakeOptionExpression(this.yAxisSetting.CreateOptions( ));
            }

            if (this.Y2Axis == string.Empty && null != this.y2AxisSetting)
            {
                this.Y2Axis = JQueryUI.MakeOptionExpression(this.y2AxisSetting.CreateOptions( ));
            }

            return(this.settingHelper.CreateOptions( ));
        }
Esempio n. 3
0
        protected override void renderJQuery(JQueryUI jquery)
        {
            //! Cannot write these codes in PlotSetting.Recombine, because PlotSetting has no Title attributes

            if (this.Axes == string.Empty && null != this.axesSetting)
            {
                this.Axes = JQueryUI.MakeOptionExpression(this.axesSetting.CreateOptions( ));
            }

            if (this.AxesDefaults == string.Empty && null != this.axesDefaultsSetting)
            {
                this.AxesDefaults = JQueryUI.MakeOptionExpression(this.axesDefaultsSetting.CreateOptions( ));
            }

            if (this.Cursor == string.Empty && null != this.cursorSetting)
            {
                this.Cursor = JQueryUI.MakeOptionExpression(this.cursorSetting.CreateOptions( ));
            }

            if (this.Dragable == string.Empty && null != this.dragableSetting)
            {
                this.Dragable = JQueryUI.MakeOptionExpression(this.dragableSetting.CreateOptions( ));
            }

            if (this.Grid == string.Empty && null != this.gridSetting)
            {
                this.Grid = JQueryUI.MakeOptionExpression(this.gridSetting.CreateOptions( ));
            }

            if (this.Legend == string.Empty && null != this.legendSetting)
            {
                this.Legend = JQueryUI.MakeOptionExpression(this.legendSetting.CreateOptions( ));
            }

            if (this.Title == string.Empty && null != this.titleSetting)
            {
                this.Title = JQueryUI.MakeOptionExpression(this.titleSetting.CreateOptions( ));
            }

            if (this.Series == "[]" && null != this.seriesSetting)
            {
                string setting = string.Empty;

                foreach (Series series in this.seriesSetting.SeriesList)
                {
                    if (null != series)
                    {
                        setting += JQueryUI.MakeOptionExpression(series.CreateOptions( )) + ",";
                    }
                }

                this.Series = string.Format("[{0}]", setting.TrimEnd(','));
            }

            if (this.SeriesDefaults == string.Empty && null != this.seriesDefaultsSetting)
            {
                this.SeriesDefaults = JQueryUI.MakeOptionExpression(this.seriesDefaultsSetting.CreateOptions( ));
            }

            if (this.Options == string.Empty)
            {
                this.Options = JQueryUI.MakeOptionExpression(this.settingHelper.CreateOptions( ));
            }

            if (this.Data == "[]" && null != this.dataSetting)
            {
                string dataExpression = string.Empty;

                foreach (Data data in this.dataSetting.DataList)
                {
                    if (null != data)
                    {
                        string pointExpression = string.Empty;

                        foreach (Point point in data.PointList)
                        {
                            if (null != point)
                            {
                                pointExpression += string.Format(",[{0},{1},{2},{3}]",
                                                                 string.IsNullOrEmpty(point.Param1) ? "null" : point.Param1,
                                                                 string.IsNullOrEmpty(point.Param2) ? "null" : point.Param2,
                                                                 string.IsNullOrEmpty(point.Param3) ? "null" : point.Param3,
                                                                 string.IsNullOrEmpty(point.Param4) ? "null" : point.Param4
                                                                 );
                            }
                        }

                        dataExpression += ",[" + pointExpression.TrimStart(',') + "]";
                    }
                }

                this.Data = "[" + dataExpression.TrimStart(',') + "]";
            }

            base.renderJQuery(jquery);
        }