/************************************************************************/ #region Constructor /// <summary> /// Initializes new instance of the <see cref="ChartNavigation"/> class. /// </summary> /// <param name="owner">The chart that owns this navigation panel</param> internal ChartNavigation(ChartContainer owner) { this.owner = owner ?? throw new ArgumentNullException(nameof(owner)); // need a background to intercept mouse wheel and clicks. Background = Brushes.Transparent; FocusVisualStyle = null; IsNavigationEnabled = IsNavigationEnabledDefault; IsKeyboardNavigationEnabled = IsKeyboardNavigationEnabledDefault; }
public void LoadOverviewChart(string filter, string title) { HttpResponse response = HttpContext.Current.Response; try { Page page = new ContainerPage(); ChartContainer chart = (ChartContainer)page.LoadControl("~/UserControls/ChartContainer.ascx"); Dictionary <string, object> dic = new Dictionary <string, object>(); dic[ChartConfigurationKeys.QUERY.ToString()] = string.Format(Constants.GenerateDrilldownChart, filter); dic[ChartConfigurationKeys.HEIGHT.ToString()] = 350; dic[ChartConfigurationKeys.WIDTH.ToString()] = 250; dic[ChartConfigurationKeys.XVALARRAY.ToString()] = "NAME"; dic[ChartConfigurationKeys.YVALARRAY.ToString()] = new List <string> { "PCOUNT" }; dic[ChartConfigurationKeys.XTITLE.ToString()] = "Diesease"; dic[ChartConfigurationKeys.YTITLE.ToString()] = "Patients"; dic[ChartConfigurationKeys.TYPE.ToString()] = SeriesChartType.Pie; dic[ChartConfigurationKeys.LEGEND.ToString()] = "Diesease"; dic[ChartConfigurationKeys.TITLE.ToString()] = title; dic[ChartConfigurationKeys.VIEWLEGEND.ToString()] = true; dic[ChartConfigurationKeys.DISABLELABELS.ToString()] = false; dic[ChartConfigurationKeys.PIELABELSTYLE.ToString()] = "Outside"; dic[ChartConfigurationKeys.NOOFCHARTSERIES.ToString()] = 1; dic[ChartConfigurationKeys.SERIESNAMES.ToString()] = new List <string> { "DieseasesVsPatients" }; chart.ChartConfigurations = dic; page.Controls.Add(chart); StringBuilder text = new StringBuilder(); StringWriter writer = new StringWriter(text); HtmlTextWriter htmlWriter = new HtmlTextWriter(writer); //page.RenderControl(htmlWriter); HttpContext.Current.Server.Execute(page, writer, false); response.Output.Write(text.ToString()); } catch (Exception e) { response.Output.Write(e.Message); } finally { response.Output.Flush(); response.Output.Close(); } }
/************************************************************************/ #region Constructors /// <summary> /// Initializes new instance of the <see cref="AxisGrid"/> class. /// </summary> internal AxisGrid(ChartContainer owner) { this.owner = owner ?? throw new ArgumentNullException(nameof(owner)); // AxisGrid doesn't get its data from this collection, // but it needs to be non null for CreateChildren to be called. Data = DataSeries.Create(); gridPen = new Pen(DefaultGridBrush, 1.0); minEdgeDistance = 3.0; IsGridVisible = true; IsHitTestVisible = false; }
/************************************************************************/ #region Constructor /// <summary> /// Initializes a new instance of <see cref="Axis"/> class. /// </summary> internal Axis(ChartContainer owner, AxisType axisType) { this.owner = owner ?? throw new ArgumentNullException(nameof(owner)); AxisType = axisType; MajorTicks = new MajorTickCollection(); MinorTicks = new MinorTickCollection(); Range = Range.EmptyRange(); majorTickPath = new Path() { Stroke = DefaultMajorTickBrush, StrokeThickness = 1.0, }; minorTickPath = new Path() { Stroke = DefaultMinorTickBrush, StrokeThickness = 1.0, }; Children.Add(majorTickPath); Children.Add(minorTickPath); }