Beispiel #1
0
        private void UpdateSettings()
        {
            ChartSettings settings = ChartManager.Settings;

            settings.CurrentCulture = PCAxis.Web.Core.Management.LocalizationManager.CurrentCulture;
            settings.ChartType      = ChartSettings.ConvertToChartType(GetLayout(), settings.ChartType);
            //settings.Title = txtTitle.Text;
            int t;

            settings.Width            = int.TryParse(txtWidth.Text, out t) ? t : settings.Width;
            settings.Height           = int.TryParse(txtHeight.Text, out t) ? t : settings.Height;
            settings.LineThickness    = int.TryParse(txtLineThickness.Text, out t) ? t : settings.LineThickness;
            settings.LabelOrientation = ChartSettings.ConvertToLabelOrientation(rblLabelOrientation.SelectedValue, settings.LabelOrientation);
            settings.Guidelines       = ChartSettings.GuidelinesType.None;
            if (chkVerticalGuidelines.Checked)
            {
                settings.Guidelines = settings.Guidelines | ChartSettings.GuidelinesType.Vertical;
            }
            if (chkHorizontalGuidelines.Checked)
            {
                settings.Guidelines = settings.Guidelines | ChartSettings.GuidelinesType.Horizontal;
            }
            settings.ShowLegend   = chkShowLegend.Checked;
            settings.LegendHeight = int.TryParse(txtLegendHeight.Text, out t) ? t : settings.LegendHeight;
        }
Beispiel #2
0
        public override void Render(string format, PCAxis.Query.SavedQuery query, PCAxis.Paxiom.PXModel model, bool safe)
        {
            if (query.Output.Params["layout"] == ChartTypes.CHART_COLUMNLINE)
            {
                ChartManager.Settings.IsColumnLine = true;
            }
            ChartManager.Settings.ChartType       = ChartSettings.ConvertToChartType(query.Output.Params["layout"], System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Column);
            ChartManager.Settings.UseSettingTitle = true;
            //Custom chart title only works for the language that was selected when the saved query was created.
            if (query.Sources[0].Language.ToLower() == model.Meta.CurrentLanguage.ToLower())
            {
                ChartManager.Settings.Title = CheckParameter(query, "chart_title") ? query.Output.Params["chart_title"] : ChartManager.Settings.Title;
            }
            else
            {
                ChartManager.Settings.Title = model.Meta.Title;
            }
            ChartManager.Settings.Width            = CheckParameter(query, "chart_width") ? int.Parse(query.Output.Params["chart_width"]) : ChartManager.Settings.Width;
            ChartManager.Settings.Height           = CheckParameter(query, "chart_height") ? int.Parse(query.Output.Params["chart_height"]) : ChartManager.Settings.Height;
            ChartManager.Settings.LineThickness    = CheckParameter(query, "chart_linethickness") ? int.Parse(query.Output.Params["chart_linethickness"]) : ChartManager.Settings.LineThickness;
            ChartManager.Settings.TimeSortOrder    = CheckParameter(query, "chart_timesortorder") ? (ChartSettings.SortType)Enum.Parse(typeof(ChartSettings.SortType), query.Output.Params["chart_timesortorder"], true) : ChartManager.Settings.TimeSortOrder;
            ChartManager.Settings.LabelOrientation = CheckParameter(query, "chart_labelorientation") ? (ChartSettings.OrientationType)Enum.Parse(typeof(ChartSettings.OrientationType), query.Output.Params["chart_labelorientation"], true) : ChartManager.Settings.LabelOrientation;
            ChartManager.Settings.Guidelines       = CheckParameter(query, "chart_guidelines") ? (ChartSettings.GuidelinesType)Enum.Parse(typeof(ChartSettings.GuidelinesType), query.Output.Params["chart_guidelines"], true) : ChartManager.Settings.Guidelines;
            ChartManager.Settings.ShowLegend       = CheckParameter(query, "chart_showlegend") ? bool.Parse(query.Output.Params["chart_showlegend"]) : ChartManager.Settings.ShowLegend;
            ChartManager.Settings.LegendHeight     = CheckParameter(query, "chart_legendheight") ? int.Parse(query.Output.Params["chart_legendheight"]) : ChartManager.Settings.LegendHeight;

            base.Render(format, query, model, safe, GetFileExtension(format), GetMimeType(format));
        }
Beispiel #3
0
        /// <summary>
        /// Initializes chart
        /// </summary>
        private void InitializeChart()
        {
            //pnlSettings.Visible = false;

            // Default values for user settings
            ChartSettings settings = ChartManager.Settings;

            settings.ChartType = ChartSettings.ConvertToChartType(GetLayout(), settings.ChartType);

            if (GetLayout().Equals(Plugins.Views.CHART_COLUMNLINE))
            {
                settings.IsColumnLine = true;
            }
            else
            {
                settings.IsColumnLine = false;
            }
            if (settings.UseSettingTitle && !string.IsNullOrEmpty(settings.Title))
            {
                txtTitle.Text = settings.Title;
            }
            else if (PCAxis.Web.Core.Management.PaxiomManager.PaxiomModel != null)
            {
                SetTitle();
            }

            txtHeight.Text                    = settings.Height.ToString();
            txtWidth.Text                     = settings.Width.ToString();
            rblSortTime.SelectedValue         = settings.TimeSortOrder.ToString();
            txtLineThickness.Text             = settings.LineThickness.ToString();
            chkShowLegend.Checked             = settings.ShowLegend;
            txtLegendHeight.Text              = settings.LegendHeight.ToString();
            chkHorizontalGuidelines.Checked   = ((settings.Guidelines & ChartSettings.GuidelinesType.Horizontal) == ChartSettings.GuidelinesType.Horizontal);
            chkVerticalGuidelines.Checked     = ((settings.Guidelines & ChartSettings.GuidelinesType.Vertical) == ChartSettings.GuidelinesType.Vertical);
            rblLabelOrientation.SelectedValue = settings.LabelOrientation.ToString();

            LegendSettings();

            ShowLineThickness();
            ShowSortTime();
            ShowLabelOrientation();
            ShowGuidelines();

            SortTime();
            CreateChart();

            //lnkChartSettings.Text = Master.GetLocalizedString("PxWebChartUserSettingsShow");
        }
Beispiel #4
0
        public override void Render(string format, PCAxis.Query.SavedQuery query, PCAxis.Paxiom.PXModel model, bool safe)
        {
            ChartManager.Settings.ChartType        = ChartSettings.ConvertToChartType(query.Output.Params["layout"], System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Column);
            ChartManager.Settings.UseSettingTitle  = true;
            ChartManager.Settings.Title            = CheckParameter(query, "chart_title") ? query.Output.Params["chart_title"] : ChartManager.Settings.Title;
            ChartManager.Settings.Width            = CheckParameter(query, "chart_width") ? int.Parse(query.Output.Params["chart_width"]) : ChartManager.Settings.Width;
            ChartManager.Settings.Height           = CheckParameter(query, "chart_height") ? int.Parse(query.Output.Params["chart_height"]) : ChartManager.Settings.Height;
            ChartManager.Settings.LineThickness    = CheckParameter(query, "chart_linethickness") ? int.Parse(query.Output.Params["chart_linethickness"]) : ChartManager.Settings.LineThickness;
            ChartManager.Settings.TimeSortOrder    = CheckParameter(query, "chart_timesortorder") ? (ChartSettings.SortType)Enum.Parse(typeof(ChartSettings.SortType), query.Output.Params["chart_timesortorder"], true) : ChartManager.Settings.TimeSortOrder;
            ChartManager.Settings.LabelOrientation = CheckParameter(query, "chart_labelorientation") ? (ChartSettings.OrientationType)Enum.Parse(typeof(ChartSettings.OrientationType), query.Output.Params["chart_labelorientation"], true) : ChartManager.Settings.LabelOrientation;
            ChartManager.Settings.Guidelines       = CheckParameter(query, "chart_guidelines") ? (ChartSettings.GuidelinesType)Enum.Parse(typeof(ChartSettings.GuidelinesType), query.Output.Params["chart_guidelines"], true) : ChartManager.Settings.Guidelines;
            ChartManager.Settings.ShowLegend       = CheckParameter(query, "chart_showlegend") ? bool.Parse(query.Output.Params["chart_showlegend"]) : ChartManager.Settings.ShowLegend;
            ChartManager.Settings.LegendHeight     = CheckParameter(query, "chart_legendheight") ? int.Parse(query.Output.Params["chart_legendheight"]) : ChartManager.Settings.LegendHeight;

            base.Render(format, query, model, safe, GetFileExtension(format), GetMimeType(format));
        }