Example #1
0
        public FlotChartOptions XAxis(Action <XAxisOptions> xaxisBuilder)
        {
            if (_xaxisOptions == null)
            {
                _xaxisOptions = new XAxisOptions();
            }

            xaxisBuilder(_xaxisOptions);

            return(this);
        }
Example #2
0
        /// <summary>
        /// Setup the form
        /// </summary>
        /// <param name="tabName"></param>

        void Setup(string tabName)
        {
            QueryColumn qc;

            InSetup = true;

            // Select initial tab

            Tpi = -1;

            if (Lex.Eq(tabName, "General"))
            {
                Tpi = GeneralTpi;
            }
            else if (Lex.Eq(tabName, "X-Axis"))
            {
                Tpi = XAxisTpi;
            }
            else if (Lex.Eq(tabName, "Y-Axis"))
            {
                Tpi = YAxisTpi;
            }
            else if (Lex.Eq(tabName, "Z-Axis"))
            {
                Tpi = ZAxisTpi;
            }
            else if (Lex.Eq(tabName, "Axes"))
            {
                Tpi = AxesTpi;
            }
            else if (Lex.Eq(tabName, "Colors"))
            {
                Tpi = ColorsTpi;
            }
            else if (Lex.Eq(tabName, "Shape"))
            {
                Tpi = ShapeTpi;
            }
            else if (Lex.Eq(tabName, "Size"))
            {
                Tpi = SizeTpi;
            }
            else if (Lex.Eq(tabName, "Labels"))
            {
                Tpi = LabelsTpi;
            }
            else if (Lex.Eq(tabName, "Tootip"))
            {
                Tpi = TooltipTpi;
            }
            else if (Lex.Eq(tabName, "Legend"))
            {
                Tpi = LegendTpi;
            }
            else if (Lex.Eq(tabName, "Surface"))
            {
                Tpi = SurfaceTpi;
            }
            else if (Lex.Eq(tabName, "Trellis"))
            {
                Tpi = TrellisTpi;
            }
            else if (Lex.Eq(tabName, "Misc"))
            {
                MiscTpi = 11;
            }

            if (Tpi >= 0 && Tpi < Tabs.TabPages.Count)
            {
                Tabs.SelectedTabPageIndex = Tpi;
            }

            // Default visible tabs

            GeneralTab.PageVisible = true;
            XAxisTab.PageVisible   = YAxisTab.PageVisible = true;
            ZAxisTab.PageVisible   = false;
            ColorsTab.PageVisible  = SizeTab.PageVisible = ShapeTab.PageVisible = LabelsTab.PageVisible = true;
            SurfaceTab.PageVisible = false;
            TrellisTab.PageVisible = false;
            AxesTab.PageVisible    = false;          // radar axes

            // Setup for specific char type

            if (View.ViewType == ViewTypeMx.ScatterPlot)
            {
                Text = "Bubble Chart Properties";
            }

            else if (View.ViewType == ViewTypeMx.Heatmap)
            {
                Text = "Heat Map Properties";

                SizeTab.PageVisible   = ShapeTab.PageVisible = LabelsTab.PageVisible = false;
                ZAxisTab.PageVisible  = false;
                LabelsTab.PageVisible = false;
            }

            else if (View.ViewType == ViewTypeMx.RadarPlot)
            {
                Text = "Radar Plot Properties";
                XAxisTab.PageVisible  = YAxisTab.PageVisible = ZAxisTab.PageVisible = false;
                AxesTab.PageVisible   = true;
                LabelsTab.PageVisible = false;
            }

            else if (View.ViewType == ViewTypeMx.BarChart)
            {
                Text = "Bar Chart Properties";
                XAxisTab.PageVisible = YAxisTab.PageVisible = ZAxisTab.PageVisible = false;
                AxesTab.PageVisible  = true;
            }

            // Setup General tab

            Title.Text        = View.Title;
            ShowTitle.Checked = View.ShowTitle;
            Description.Text  = View.Description;

            // Setup X-axis tab

            XColumnSelector.Setup(View.BaseQuery, View.XAxisMx.QueryColumn);
            XAxisOptions.Setup(View.XAxisMx);
            ShowXAxisTitle.Checked = View.ShowAxesTitles;
            RotateAxesX.Checked    = View.RotateAxes;

            // Setup Y-axis tab

            YColumnSelector.Setup(View.BaseQuery, View.YAxisMx.QueryColumn);
            YColumnSelector.ExcludedDataTypes[MetaColumnType.Date] = true;             // dates not allowed on XYDiagram Y axis
            YAxisOptions.Setup(View.YAxisMx);
            ShowYAxisTitle.Checked = View.ShowAxesTitles;
            RotateAxesY.Checked    = View.RotateAxes;

            // Setup Z-axis tab

            ZColumnSelector.Setup(View.BaseQuery, View.ZAxisMx.QueryColumn);
            ZAxisOptions.Setup(View.ZAxisMx);
            ShowZAxisTitle.Checked = View.ShowAxesTitles;
            ZAxisOptions.ShowZoomSlider.Enabled = false;             // no zoomslider for Z axis

            // Setup Axes Tab

            SetupAxesFieldList();

            ShowAxesTitles2.Checked      = View.ShowAxesTitles;
            ShowAxesScaleLabels2.Checked = View.ShowAxesScaleLabels;

            // Setup Colors tab

            ColorBySelector.Setup(View, View.MarkerColor);

            // Setup Size tab

            SizeBySelector.Setup(View, View.MarkerSize);

            // Setup Shape tab

            ShapeBySelector.Setup(View, View.MarkerShape, MarkerShapePopup);

            // Setup Labels tab

            LabelColumnSelector.Setup(View.BaseQuery, View.MarkerLabel.QueryColumn);
            LabelColumnSelector.ExcludedDataTypes[MetaColumnType.Structure] = true;             // structs not allowed on labels

            if (View.MarkerLabel.VisibilityMode == LabelVisibilityModeEnum.AllRows)
            {
                LabelsAll.Checked = true;
            }
            else if (View.MarkerLabel.VisibilityMode == LabelVisibilityModeEnum.MarkedRows)
            {
                LabelsSelected.Checked = true;
            }

            if (View.MarkerLabel.Position == LabelPositionEnum.Center)
            {
                LabelsCenter.Checked = true;
            }
            else
            {
                LabelsOutside.Checked = true;
            }

            IncludeStructureInLabel.Checked = View.MarkerLabel.IncludeStructure;

            MaxLabels.Value = View.MaxLabels;

            // Setup Tooltip tab

            TooltipFieldListControl.Setup(View.BaseQuery, View.MarkerTooltip.Fields);
            IncludeStructureInTooltip.Checked = View.MarkerTooltip.IncludeStructure;

            // Setup Legend tab

            ShowLegend.Checked             = View.ShowLegend;
            LegendAlignmentHorizontal.Text = Lex.ExpandCapitalizedName(View.LegendAlignmentHorizontal.ToString(), true);
            LegendAlignmentVertical.Text   = Lex.ExpandCapitalizedName(View.LegendAlignmentVertical.ToString(), true);
            MaxHorizontalPercentage.Text   = View.LegendMaxHorizontalPercentage.ToString() + "%";
            MaxVerticalPercentage.Text     = View.LegendMaxVerticalPercentage.ToString() + "%";
            LegendItemOrder.Text           = Lex.ExpandCapitalizedName(View.LegendItemOrder.ToString(), true);

            // Setup Surface tab

            FillModeComboBox.SelectedIndex  = (int)View.SurfaceFillMode;
            FrameModeComboBox.SelectedIndex = (int)View.SurfaceFrameMode;
            SmoothPalette.Checked           = View.SmoothPalette;
            SmoothShading.Checked           = View.SmoothShading;
            SemitransparentSurface.Checked  = View.SemiTransparent;
            DrawFlat.Checked = View.DrawFlat;

            // Setup Trellis tab

            TrellisByRowsAndCols.Checked = View.TrellisFlowQc == null;
            TrellisColumnSelector.Setup(View.BaseQuery, View.TrellisColQc);
            TrellisRowSelector.Setup(View.BaseQuery, View.TrellisRowQc);
            TrellisPageSelector.Setup(View.BaseQuery, View.TrellisPageQc);

            TrellisByPanels.Checked = View.TrellisFlowQc != null;
            TrellisFlowBySelector.Setup(View.BaseQuery, View.TrellisFlowQc);

            View.TrellisManual = TrellisManualLayout.Checked;
            SetTrellisManualLayoutEnableds();
            TrellisMaxRows.Text = View.TrellisMaxRows.ToString();
            TrellisMaxCols.Text = View.TrellisMaxCols.ToString();

            ShowAxesTitles.Checked      = View.ShowAxesTitles;
            ShowAxesScaleLabels.Checked = View.ShowAxesScaleLabels;

            // Setup Misc tab

            BackgroundImageFileName.Text             = View.BackgroundImageFile;
            ShowLegend.Checked                       = View.ShowLegend;
            StretchChart.Checked                     = View.JitterTheSameForXandY;
            ShapeRenderingModeComboBox.SelectedIndex = (int)View.ShapeRenderingMode;
            Jittering.Value = View.JitterX;

            InSetup = false;
            return;
        }
Example #3
0
        public FlotChartOptions XAxis(Action<XAxisOptions> xaxisBuilder)
        {
            if (_xaxisOptions == null)
                _xaxisOptions = new XAxisOptions();

            xaxisBuilder(_xaxisOptions);

            return this;
        }