/// <summary>
        /// Get serries settings.
        /// </summary>
        /// <param name="id">ID</param>
        /// <returns>Settings.</returns>
        public GraphSeriesSettings GetSeriesSettings(string id)
        {
            var settings = (from c in this._seriesSettings where c.Id == id select c).FirstOrDefault();

            if (settings == null)
            {
                settings    = new GraphSeriesSettings();
                settings.Id = id;

                this._seriesSettings.Add(settings);
            }

            return(settings);
        }
Example #2
0
        /// <summary>
        /// Draw graph according passed configuration
        /// </summary>
        /// <param name="configuration">Graph configuration</param>
        /// <param name="ownerSize">Owner size.</param>
        /// <param name="context">Configuration context.</param>
        public void SetConfiguration(GraphConfiguration configuration, Size ownerSize, object context)
        {
            this.chart.Series.Clear();

            this.SetupGraph(configuration);

            switch (configuration.GraphType.Value)
            {
            case GraphTypeEnum.NameDateStackedColumn:
            case GraphTypeEnum.NameDateLine:
                this.DrawNameDateGraph(new GraphData(configuration, context), configuration);
                break;

            case GraphTypeEnum.NamedLine:
                this.DrawNamedGraph(new GraphData(configuration, context), configuration);
                break;

            case GraphTypeEnum.GanttDiagram:
                this.DrawGantt(new GanttGraphData(configuration, context), configuration);
                break;

            default:
                this.DrawSimpleGraph(new GraphData(configuration, context), configuration);
                break;
            }

            foreach (Series series in this.chart.Series)
            {
                GraphSeriesSettings seriesState = this._stateSettings.GetSeriesSettings(series.Name);

                series.Enabled = seriesState.Visible;

                if (!seriesState.Visible && configuration.GraphType.Value == GraphTypeEnum.GanttDiagram)
                {
                    this.RevalueAxisY(series);
                }
            }

            if (configuration.GraphType == GraphTypeEnum.NameDateStackedColumn ||
                configuration.GraphType == GraphTypeEnum.NameDateLine ||
                configuration.GraphType == GraphTypeEnum.NamedLine
                )
            {
                this.HideUnnecessaryXAxisZeroLabel();
            }
        }
		/// <summary>
		/// Get serries settings.
		/// </summary>
		/// <param name="id">ID</param>
		/// <returns>Settings.</returns>
		public GraphSeriesSettings GetSeriesSettings(string id)
		{
			var settings = (from c in this._seriesSettings where c.Id == id select c).FirstOrDefault();

			if (settings == null)
			{
				settings = new GraphSeriesSettings();
				settings.Id = id;

				this._seriesSettings.Add(settings);
			}

			return settings;
		}