12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066 |
- using System;
- using System.IO;
- using System.Drawing;
- using System.Windows.Forms;
- using FastReport.Utils;
- using FastReport.Data;
- using FastReport.DataVisualization.Charting;
- namespace FastReport.MSChart
- {
- internal partial class ChartEditorControl : UserControl
- {
- private MSChartObject chart;
- private bool updating;
- public event EventHandler Changed;
- public MSChartObject Chart
- {
- get { return chart; }
- set
- {
- chart = value;
- UpdateControls();
- }
- }
- public int ActivePageIndex
- {
- get { return pageControl1.ActivePageIndex; }
- set { pageControl1.ActivePageIndex = value; }
- }
- private Chart MSChart
- {
- get { return chart.Chart; }
- }
- private Report Report
- {
- get { return chart.Report; }
- }
- private ChartArea ChartArea
- {
- get { return MSChart.ChartAreas.FindByName(cbxChartArea.SelectedItem.ToString()); }
- }
- private Axis Axis
- {
- get { return cbxAxis.Items.Count == 0 ? null : ChartArea.Axes[cbxAxis.SelectedIndex]; }
- }
- private Grid Grid
- {
- get
- {
- if (cbxAxisGrid.SelectedIndex == 0)
- return Axis.MajorGrid;
- return Axis.MinorGrid;
- }
- }
- private TickMark Tick
- {
- get
- {
- if (cbxAxisTick.SelectedIndex == 0)
- return Axis.MajorTickMark;
- return Axis.MinorTickMark;
- }
- }
- private StripLine Strip
- {
- get
- {
- if (lbAxisStrips.SelectedIndex != -1)
- return Axis.StripLines[lbAxisStrips.SelectedIndex];
- return null;
- }
- }
- private CustomLabel CustomLabel
- {
- get
- {
- if (lbCustomLabels.SelectedIndex != -1)
- return Axis.CustomLabels[lbCustomLabels.SelectedIndex];
- return null;
- }
- }
- private Legend Legend
- {
- get
- {
- return MSChart.Legends.Count > 0 ? MSChart.Legends[0] : null;
- }
- }
- private Title Title
- {
- get
- {
- return MSChart.Titles.Count > 0 ? MSChart.Titles[0] : null;
- }
- }
- private void UpdateControls()
- {
- updating = true;
- #region Data tab
- // data source
- cbxDataSource.Items.Clear();
- cbxDataSource.Items.Add(Res.Get("Misc,None"));
- cbxDataSource.SelectedIndex = 0;
- foreach (Base c in Report.Dictionary.AllObjects)
- {
- DataSourceBase ds = c as DataSourceBase;
- if (ds != null && ds.Enabled)
- {
- cbxDataSource.Items.Add(ds.Alias);
- if (Chart.DataSource == ds)
- cbxDataSource.SelectedIndex = cbxDataSource.Items.Count - 1;
- }
- }
- // filter
- tbFilter.Text = Chart.Filter;
- // autoseries
- cbxAutoSeriesData.Report = Report;
- cbxAutoSeriesData.Text = Chart.AutoSeriesColumn;
- cbxAutoSeriesColor.Report = Report;
- cbxAutoSeriesColor.Text = Chart.AutoSeriesColor;
- cbxAutoSeriesSort.SelectedIndex = (int)Chart.AutoSeriesSortOrder;
- // align X values
- cbAlignXValues.Checked = Chart.AlignXValues;
- cbAutoSeriesForce.Checked = Chart.AutoSeriesForce;
- #endregion
- #region Appearance tab
- // back color
- cbxBackColor.Color = MSChart.BackColor;
- cbxSecondaryColor.Color = MSChart.BackSecondaryColor;
- cbxGradient.SelectedIndex = (int)MSChart.BackGradientStyle;
- cbxHatchStyle.SelectedIndex = (int)MSChart.BackHatchStyle;
- // border
- cbxBorderSkin.SelectedIndex = (int)MSChart.BorderSkin.SkinStyle;
- cbxBorderColor.Color = MSChart.BorderlineColor;
- cbxBorderStyle.SelectedIndex = (int)MSChart.BorderlineDashStyle;
- udBorderWidth.Value = MSChart.BorderlineWidth;
- // palette
- cbxSeriesPalette.SelectedIndex = (int)MSChart.Palette;
- #endregion
- #region Legend tab
- if (Legend == null)
- pgLegend.Enabled = false;
- else
- {
- pgLegend.Enabled = true;
- cbLegendEnabled.Checked = Legend.Enabled;
- cbxLegendStyle.SelectedIndex = (int)Legend.LegendStyle;
- UpdateLegendDockButtons();
- cbLegendInsideChartArea.Checked = Legend.IsDockedInsideChartArea &&
- Legend.DockedToChartArea == "Default";
- cbxLegendBackColor.Color = Legend.BackColor;
- cbxLegendSecondaryColor.Color = Legend.BackSecondaryColor;
- cbxLegendGradient.SelectedIndex = (int)Legend.BackGradientStyle;
- cbxLegendHatchStyle.SelectedIndex = (int)Legend.BackHatchStyle;
- cbxLegendBorderColor.Color = Legend.BorderColor;
- cbxLegendBorderStyle.SelectedIndex = (int)Legend.BorderDashStyle;
- udLegendBorderWidth.Value = Legend.BorderWidth;
- cbxLegendShadowColor.Color = Legend.ShadowColor;
- udLegendShadowOffset.Value = Legend.ShadowOffset;
- tbLegendFont.Text = Converter.ToString(Legend.Font);
- cbxLegendForeColor.Color = Legend.ForeColor;
- }
- #endregion
- #region Title tab
- if (Title == null)
- pgTitle.Enabled = false;
- else
- {
- pgTitle.Enabled = true;
- cbTitleVisible.Checked = Title.Visible;
- tbTitleText.Text = Title.Text;
- cbxTitleTextOrientation.SelectedIndex = (int)Title.TextOrientation;
- cbxTitleTextStyle.SelectedIndex = (int)Title.TextStyle;
- UpdateTitleDockButtons();
- cbTitleInsideChartArea.Checked = Title.IsDockedInsideChartArea &&
- Title.DockedToChartArea == "Default";
- cbxTitleBackColor.Color = Title.BackColor;
- cbxTitleSecondaryColor.Color = Title.BackSecondaryColor;
- cbxTitleGradient.SelectedIndex = (int)Title.BackGradientStyle;
- cbxTitleHatchStyle.SelectedIndex = (int)Title.BackHatchStyle;
- cbxTitleBorderColor.Color = Title.BorderColor;
- cbxTitleBorderStyle.SelectedIndex = (int)Title.BorderDashStyle;
- udTitleBorderWidth.Value = Title.BorderWidth;
- cbxTitleShadowColor.Color = Title.ShadowColor;
- udTitleShadowOffset.Value = Title.ShadowOffset;
- tbTitleFont.Text = Converter.ToString(Title.Font);
- cbxTitleForeColor.Color = Title.ForeColor;
- }
- #endregion
- updating = false;
- }
- private void UpdateLegendDockButtons()
- {
- Button[] dockButtons = new Button[] {
- btnL1, btnL2, btnL3, btnL4, btnL5, btnL6, btnL7, btnL8, btnL9, btnL10, btnL11, btnL12 };
- int activeBtnTag = (int)Legend.Docking * 3 + (int)Legend.Alignment;
- foreach (Button btn in dockButtons)
- {
- btn.BackColor = int.Parse(btn.Tag.ToString()) == activeBtnTag ?
- Color.Orange : SystemColors.ButtonFace;
- }
- }
- private void UpdateTitleDockButtons()
- {
- Button[] dockButtons = new Button[] {
- btnT1, btnT2, btnT3, btnT4, btnT5, btnT6, btnT7, btnT8, btnT9, btnT10, btnT11, btnT12 };
- int titleAlign = 0;
- switch (Title.Alignment)
- {
- case ContentAlignment.TopLeft:
- case ContentAlignment.MiddleLeft:
- case ContentAlignment.BottomLeft:
- titleAlign = 0;
- break;
- case ContentAlignment.TopCenter:
- case ContentAlignment.MiddleCenter:
- case ContentAlignment.BottomCenter:
- titleAlign = 1;
- break;
- case ContentAlignment.TopRight:
- case ContentAlignment.MiddleRight:
- case ContentAlignment.BottomRight:
- titleAlign = 2;
- break;
- }
- int activeBtnTag = (int)Title.Docking * 3 + titleAlign;
- foreach (Button btn in dockButtons)
- {
- btn.BackColor = int.Parse(btn.Tag.ToString()) == activeBtnTag ?
- Color.Orange : SystemColors.ButtonFace;
- }
- }
- private void UpdateChartAreaControls()
- {
- updating = true;
- // appearance
- cbxAreaBackColor.Color = ChartArea.BackColor;
- cbxAreaSecondaryColor.Color = ChartArea.BackSecondaryColor;
- cbxAreaGradient.SelectedIndex = (int)ChartArea.BackGradientStyle;
- cbxAreaHatchStyle.SelectedIndex = (int)ChartArea.BackHatchStyle;
- cbxAreaBorderColor.Color = ChartArea.BorderColor;
- cbxAreaBorderStyle.SelectedIndex = (int)ChartArea.BorderDashStyle;
- udAreaBorderWidth.Value = ChartArea.BorderWidth;
- cbxAreaShadowColor.Color = ChartArea.ShadowColor;
- udAreaShadowOffset.Value = ChartArea.ShadowOffset;
- // 3d
- cb3DEnable.Checked = ChartArea.Area3DStyle.Enable3D;
- trb3DXRotation.Value = ChartArea.Area3DStyle.Inclination;
- ud3DXRotation.Value = ChartArea.Area3DStyle.Inclination;
- trb3DYRotation.Value = ChartArea.Area3DStyle.Rotation;
- ud3DYRotation.Value = ChartArea.Area3DStyle.Rotation;
- trb3DPerspective.Value = ChartArea.Area3DStyle.Perspective;
- ud3DPerspective.Value = ChartArea.Area3DStyle.Perspective;
- ud3DWallWidth.Value = ChartArea.Area3DStyle.WallWidth;
- ud3DAxisDepth.Value = ChartArea.Area3DStyle.PointDepth;
- cbx3DLightStyle.SelectedIndex = (int)ChartArea.Area3DStyle.LightStyle;
- cb3DClustered.Checked = ChartArea.Area3DStyle.IsClustered;
- updating = false;
- UpdateAxes();
- }
- private void UpdateAxisControls()
- {
- updating = true;
- #region General tab
- cbAxisEnabled.Checked = Axis.Enabled != AxisEnabled.False;
- cbAxisMargin.Checked = Axis.IsMarginVisible;
- cbAxisLogarithmic.Checked = Axis.IsLogarithmic;
- cbAxisReversed.Checked = Axis.IsReversed;
- udAxisInterval.Value = (decimal)Axis.Interval;
- cbxAxisIntervalType.SelectedIndex = (int)Axis.IntervalType;
- cbxAxisLineColor.Color = Axis.LineColor;
- cbxAxisLineStyle.SelectedIndex = (int)Axis.LineDashStyle;
- udAxisLineWidth.Value = Axis.LineWidth;
- cbAxisInterlaced.Checked = Axis.IsInterlaced;
- cbxAxisInterlacedColor.Color = Axis.InterlacedColor;
- #endregion
- #region Labels tab
- cbAxisLabelEnabled.Checked = Axis.LabelStyle.Enabled;
- tbAxisLabelFormat.Text = Axis.LabelStyle.Format;
- tbAxisLabelFont.Text = Converter.ToString(Axis.LabelStyle.Font);
- cbxAxisLabelForeColor.Color = Axis.LabelStyle.ForeColor;
- udAxisLabelAngle.Value = Axis.LabelStyle.Angle;
- tbAxisTitleText.Text = Axis.Title;
- tbAxisTitleFont.Text = Converter.ToString(Axis.TitleFont);
- cbxAxisTitleForeColor.Color = Axis.TitleForeColor;
- #endregion
- #region Grid tab
- cbxAxisGrid.SelectedIndex = 0;
- #endregion
- #region Ticks tab
- cbxAxisTick.SelectedIndex = 0;
- #endregion
- #region Custom labels tab
- lbCustomLabels.Items.Clear();
- foreach (CustomLabel label in Axis.CustomLabels)
- {
- lbCustomLabels.Items.Add(Res.Get("Forms,ChartEditor,ChartEditorControl,Axes,CustomLabels,Label"));
- }
- if (lbCustomLabels.Items.Count > 0)
- lbCustomLabels.SelectedIndex = 0;
- #endregion
- #region Strips tab
- lbAxisStrips.Items.Clear();
- foreach (StripLine strip in Axis.StripLines)
- {
- lbAxisStrips.Items.Add(Res.Get("Forms,ChartEditor,ChartEditorControl,Axes,Strips,Strip"));
- }
- if (lbAxisStrips.Items.Count > 0)
- lbAxisStrips.SelectedIndex = 0;
- #endregion
- updating = false;
- btnCopyFromXAxis.Visible = cbxAxis.SelectedIndex == 1;
- btnCopyFromPrimaryAxis.Visible = cbxAxis.SelectedIndex > 1;
- UpdateAxisGridControls();
- UpdateAxisTickControls();
- UpdateAxisStripControls();
- UpdateAxisCustomLabels();
- }
- private void UpdateAxisGridControls()
- {
- updating = true;
- cbAxisGridEnabled.Checked = Grid.Enabled;
- cbxAxisGridLineColor.Color = Grid.LineColor;
- cbxAxisGridLineStyle.SelectedIndex = (int)Grid.LineDashStyle;
- udAxisGridLineWidth.Value = Grid.LineWidth;
- updating = false;
- }
- private void UpdateAxisTickControls()
- {
- updating = true;
- cbAxisTickEnabled.Checked = Tick.Enabled;
- cbxAxisTickStyle.SelectedIndex = (int)Tick.TickMarkStyle;
- udAxisTickSize.Value = (decimal)Tick.Size;
- cbxAxisTickLineColor.Color = Tick.LineColor;
- cbxAxisTickLineStyle.SelectedIndex = (int)Tick.LineDashStyle;
- udAxisTickLineWidth.Value = Tick.LineWidth;
- updating = false;
- }
- private void UpdateAxisStripControls()
- {
- updating = true;
- if (Strip == null)
- tabStripSettings.Enabled = false;
- else
- {
- tabStripSettings.Enabled = true;
- udStripStart.Value = (decimal)Strip.IntervalOffset;
- udStripWidth.Value = (decimal)Strip.StripWidth;
- udStripInterval.Value = (decimal)Strip.Interval;
- cbxStripStartType.SelectedIndex = (int)Strip.IntervalOffsetType;
- cbxStripWidthType.SelectedIndex = (int)Strip.StripWidthType;
- cbxStripIntervalType.SelectedIndex = (int)Strip.IntervalType;
- cbxStripBackColor.Color = Strip.BackColor;
- cbxStripSecondaryColor.Color = Strip.BackSecondaryColor;
- cbxStripGradient.SelectedIndex = (int)Strip.BackGradientStyle;
- cbxStripHatchStyle.SelectedIndex = (int)Strip.BackHatchStyle;
- cbxStripBorderColor.Color = Strip.BorderColor;
- cbxStripBorderStyle.SelectedIndex = (int)Strip.BorderDashStyle;
- udStripBorderWidth.Value = Strip.BorderWidth;
- tbStripText.Text = Strip.Text;
- tbStripTextFont.Text = Converter.ToString(Strip.Font);
- cbxStripTextForeColor.Color = Strip.ForeColor;
- cbxStripTextHorzAlign.SelectedIndex = (int)Strip.TextAlignment;
- cbxStripTextVertAlign.SelectedIndex = (int)Strip.TextLineAlignment;
- cbxStripTextOrientation.SelectedIndex = (int)Strip.TextOrientation;
- }
- updating = false;
- }
- private void UpdateAxisCustomLabels()
- {
- updating = true;
- if (CustomLabel == null)
- pnCustomLabel.Enabled = false;
- else
- {
- pnCustomLabel.Enabled = true;
- tbCustomLabelText.Text = CustomLabel.Text;
- udCustomLabelStart.Value = (decimal)CustomLabel.FromPosition;
- udCustomLabelEnd.Value = (decimal)CustomLabel.ToPosition;
- udCustomLabelRow.Value = CustomLabel.RowIndex;
- cbxCustomLabelForeColor.Color = CustomLabel.ForeColor;
- cbxCustomLabelMarkColor.Color = CustomLabel.MarkColor;
- cbxCustomLabelMarkStyle.SelectedIndex = (int)CustomLabel.LabelMark;
- }
- updating = false;
- }
- public void UpdateChartAreas()
- {
- cbxChartArea.Items.Clear();
- foreach (ChartArea area in MSChart.ChartAreas)
- {
- cbxChartArea.Items.Add(area.Name);
- }
- cbxChartArea.SelectedIndex = 0;
- }
- private void UpdateAxes()
- {
- cbxAxis.Items.Clear();
- foreach (Axis axis in ChartArea.Axes)
- {
- cbxAxis.Items.Add(axis.Name);
- }
- pgAxes.Enabled = cbxAxis.Items.Count > 0;
- if (cbxAxis.Items.Count > 0)
- cbxAxis.SelectedIndex = 0;
- }
- private void OnChange()
- {
- if (Changed != null)
- Changed(this, EventArgs.Empty);
- }
- private void Init()
- {
- MyRes res = null;
- MyRes cmnRes = new MyRes("Forms,ChartEditor,Common");
- #region Comboboxes
- res = new MyRes("Forms,GroupBandEditor");
- cbxAutoSeriesSort.Items.Clear();
- cbxAutoSeriesSort.Items.AddRange(new string[] {
- res.Get("NoSort"), res.Get("Ascending"), res.Get("Descending") });
- cbxGradient.Items.Clear();
- cbxGradient.Items.AddRange(Enum.GetNames(typeof(GradientStyle)));
- cbxHatchStyle.Items.Clear();
- cbxHatchStyle.Items.AddRange(Enum.GetNames(typeof(ChartHatchStyle)));
- cbxBorderSkin.Items.Clear();
- cbxBorderSkin.Items.AddRange(Enum.GetNames(typeof(BorderSkinStyle)));
- cbxBorderStyle.Items.Clear();
- cbxBorderStyle.Items.AddRange(Enum.GetNames(typeof(ChartDashStyle)));
- cbxSeriesPalette.Items.Clear();
- cbxSeriesPalette.Items.AddRange(Enum.GetNames(typeof(ChartColorPalette)));
- lbTemplate.Items.Clear();
- lbTemplate.Items.AddRange(new string[] {
- "Custom", "Blue", "Gray", "Green", "Pink", "Sand", "Steel", "Light" });
- cbxAreaGradient.Items.Clear();
- cbxAreaGradient.Items.AddRange(Enum.GetNames(typeof(GradientStyle)));
- cbxAreaHatchStyle.Items.Clear();
- cbxAreaHatchStyle.Items.AddRange(Enum.GetNames(typeof(ChartHatchStyle)));
- cbxAreaBorderStyle.Items.Clear();
- cbxAreaBorderStyle.Items.AddRange(Enum.GetNames(typeof(ChartDashStyle)));
- cbx3DLightStyle.Items.Clear();
- cbx3DLightStyle.Items.AddRange(Enum.GetNames(typeof(LightStyle)));
- cbxAxisIntervalType.Items.Clear();
- cbxAxisIntervalType.Items.AddRange(Enum.GetNames(typeof(DateTimeIntervalType)));
- cbxAxisLineStyle.Items.Clear();
- cbxAxisLineStyle.Items.AddRange(Enum.GetNames(typeof(ChartDashStyle)));
- cbxCustomLabelMarkStyle.Items.Clear();
- cbxCustomLabelMarkStyle.Items.AddRange(Enum.GetNames(typeof(LabelMarkStyle)));
- res = new MyRes("Forms,ChartEditor,ChartEditorControl,Axes");
- cbxAxisGrid.Items.Clear();
- cbxAxisGrid.Items.AddRange(new string[] {
- res.Get("Major"), res.Get("Minor") });
- cbxAxisTick.Items.Clear();
- cbxAxisTick.Items.AddRange(new string[] {
- res.Get("Major"), res.Get("Minor") });
- cbxAxisGridLineStyle.Items.Clear();
- cbxAxisGridLineStyle.Items.AddRange(Enum.GetNames(typeof(ChartDashStyle)));
- cbxAxisTickStyle.Items.Clear();
- cbxAxisTickStyle.Items.AddRange(Enum.GetNames(typeof(TickMarkStyle)));
- cbxAxisTickLineStyle.Items.Clear();
- cbxAxisTickLineStyle.Items.AddRange(Enum.GetNames(typeof(ChartDashStyle)));
- cbxStripStartType.Items.Clear();
- cbxStripStartType.Items.AddRange(Enum.GetNames(typeof(IntervalType)));
- cbxStripWidthType.Items.Clear();
- cbxStripWidthType.Items.AddRange(Enum.GetNames(typeof(IntervalType)));
- cbxStripIntervalType.Items.Clear();
- cbxStripIntervalType.Items.AddRange(Enum.GetNames(typeof(IntervalType)));
- cbxStripGradient.Items.Clear();
- cbxStripGradient.Items.AddRange(Enum.GetNames(typeof(GradientStyle)));
- cbxStripHatchStyle.Items.Clear();
- cbxStripHatchStyle.Items.AddRange(Enum.GetNames(typeof(ChartHatchStyle)));
- cbxStripBorderStyle.Items.Clear();
- cbxStripBorderStyle.Items.AddRange(Enum.GetNames(typeof(ChartDashStyle)));
- cbxStripTextOrientation.Items.Clear();
- cbxStripTextOrientation.Items.AddRange(Enum.GetNames(typeof(TextOrientation)));
- cbxStripTextHorzAlign.Items.Clear();
- cbxStripTextHorzAlign.Items.AddRange(Enum.GetNames(typeof(StringAlignment)));
- cbxStripTextVertAlign.Items.Clear();
- cbxStripTextVertAlign.Items.AddRange(Enum.GetNames(typeof(StringAlignment)));
- res = new MyRes("Forms,ChartEditor,ChartEditorControl,Legend");
- cbxLegendStyle.Items.Clear();
- cbxLegendStyle.Items.AddRange(new string[] {
- res.Get("StyleColumn"), res.Get("StyleRow"), res.Get("StyleTable") });
- cbxLegendGradient.Items.Clear();
- cbxLegendGradient.Items.AddRange(Enum.GetNames(typeof(GradientStyle)));
- cbxLegendHatchStyle.Items.Clear();
- cbxLegendHatchStyle.Items.AddRange(Enum.GetNames(typeof(ChartHatchStyle)));
- cbxLegendBorderStyle.Items.Clear();
- cbxLegendBorderStyle.Items.AddRange(Enum.GetNames(typeof(ChartDashStyle)));
- cbxTitleTextOrientation.Items.Clear();
- cbxTitleTextOrientation.Items.AddRange(Enum.GetNames(typeof(TextOrientation)));
- cbxTitleTextStyle.Items.Clear();
- cbxTitleTextStyle.Items.AddRange(Enum.GetNames(typeof(TextStyle)));
- cbxTitleGradient.Items.Clear();
- cbxTitleGradient.Items.AddRange(Enum.GetNames(typeof(GradientStyle)));
- cbxTitleHatchStyle.Items.Clear();
- cbxTitleHatchStyle.Items.AddRange(Enum.GetNames(typeof(ChartHatchStyle)));
- cbxTitleBorderStyle.Items.Clear();
- cbxTitleBorderStyle.Items.AddRange(Enum.GetNames(typeof(ChartDashStyle)));
- #endregion
- #region Data
- res = new MyRes("Forms,ChartEditor,ChartEditorControl,Data");
- pgData.Text = res.Get("");
- lblDataSource.Text = res.Get("DataSource");
- lblFilter.Text = res.Get("Filter");
- lblAutoSeries.Text = res.Get("AutoSeries");
- lblAutoSeriesData.Text = res.Get("DataColumn");
- lblAutoSeriesColor.Text = res.Get("ColorColumn");
- lblAutoSeriesSort.Text = res.Get("SeriesSort");
- cbAlignXValues.Text = res.Get("AlignXValues");
- cbAutoSeriesForce.Text = res.Get("ForceAutoSeries");
- #endregion
- #region Appearance
- res = new MyRes("Forms,ChartEditor,ChartEditorControl,Appearance");
- pgAppearance.Text = res.Get("");
- lblTemplate.Text = res.Get("Template");
- btnLoadTemplate.Text = res.Get("Load");
- btnSaveTemplate.Text = res.Get("Save");
- lblSeriesPalette.Text = res.Get("SeriesPalette");
- lblBackColor.Text = cmnRes.Get("BackColor");
- lblSecondaryColor.Text = cmnRes.Get("SecondaryColor");
- lblGradient.Text = cmnRes.Get("Gradient");
- lblHatchStyle.Text = cmnRes.Get("HatchStyle");
- lblBorderSkin.Text = res.Get("BorderSkin");
- lblBorderColor.Text = cmnRes.Get("BorderColor");
- lblBorderStyle.Text = cmnRes.Get("BorderStyle");
- lblBorderWidth.Text = cmnRes.Get("BorderWidth");
- #endregion
- #region Chart area
- res = new MyRes("Forms,ChartEditor,ChartEditorControl,ChartArea");
- pgChartArea.Text = res.Get("");
- lblChartArea.Text = res.Get("Area");
- lblAreaBackColor.Text = cmnRes.Get("BackColor");
- lblAreaSecondaryColor.Text = cmnRes.Get("SecondaryColor");
- lblAreaGradient.Text = cmnRes.Get("Gradient");
- lblAreaHatchStyle.Text = cmnRes.Get("HatchStyle");
- lblAreaBorderColor.Text = cmnRes.Get("BorderColor");
- lblAreaBorderStyle.Text = cmnRes.Get("BorderStyle");
- lblAreaBorderWidth.Text = cmnRes.Get("BorderWidth");
- lblAreaShadowColor.Text = cmnRes.Get("ShadowColor");
- lblAreaShadowOffset.Text = cmnRes.Get("ShadowOffset");
- #endregion
- #region 3D
- res = new MyRes("Forms,ChartEditor,ChartEditorControl,ThreeD");
- pg3D.Text = res.Get("");
- cb3DEnable.Text = res.Get("Enable");
- lbl3DXRotation.Text = res.Get("XRotation");
- lbl3DYRotation.Text = res.Get("YRotation");
- lbl3DPerspective.Text = res.Get("Perspective");
- lbl3DWallWidth.Text = res.Get("WallWidth");
- lbl3DAxisDepth.Text = res.Get("AxisDepth");
- lbl3DLightStyle.Text = res.Get("LightStyle");
- cb3DClustered.Text = res.Get("ClusteredSeries");
- #endregion
- #region Axes
- res = new MyRes("Forms,ChartEditor,ChartEditorControl,Axes");
- pgAxes.Text = res.Get("");
- lblAxis.Text = res.Get("Axis");
- btnCopyFromXAxis.Text = res.Get("CopyFromX");
- btnCopyFromPrimaryAxis.Text = res.Get("CopyFromPrimary");
- #region General
- res = new MyRes("Forms,ChartEditor,ChartEditorControl,Axes,General");
- tabAxisGeneral.Text = res.Get("");
- cbAxisEnabled.Text = res.Get("Enabled");
- cbAxisMargin.Text = res.Get("MarginVisible");
- cbAxisLogarithmic.Text = res.Get("Logarithmic");
- cbAxisReversed.Text = res.Get("Reversed");
- lblAxisInterval.Text = res.Get("Interval");
- lblAxisLineColor.Text = cmnRes.Get("LineColor");
- lblAxisLineStyle.Text = cmnRes.Get("LineStyle");
- lblAxisLineWidth.Text = cmnRes.Get("LineWidth");
- cbAxisInterlaced.Text = res.Get("Interlaced");
- lblAxisInterlaceColor.Text = res.Get("InterlacedColor");
- #endregion
- #region Labels
- res = new MyRes("Forms,ChartEditor,ChartEditorControl,Axes,Labels");
- tabAxisLabels.Text = res.Get("");
- cbAxisLabelEnabled.Text = res.Get("Enabled");
- lblAxisLabelFormat.Text = cmnRes.Get("Format");
- lblAxisLabelFont.Text = cmnRes.Get("Font");
- lblAxisLabelForeColor.Text = cmnRes.Get("ForeColor");
- lblAxisLabelAngle.Text = res.Get("Angle");
- #endregion
- #region Title
- res = new MyRes("Forms,ChartEditor,ChartEditorControl,Axes,Title");
- tabAxisTitle.Text = res.Get("");
- lblAxisTitleText.Text = cmnRes.Get("Text");
- lblAxisTitleFont.Text = cmnRes.Get("Font");
- lblAxisTitleForeColor.Text = cmnRes.Get("ForeColor");
- #endregion
- #region Custom labels
- res = new MyRes("Forms,ChartEditor,ChartEditorControl,Axes,CustomLabels");
- tabAxisCustomLabels.Text = res.Get("");
- lblCustomLabelText.Text = cmnRes.Get("Text");
- lblCustomLabelStart.Text = res.Get("Start");
- lblCustomLabelEnd.Text = res.Get("End");
- lblCustomLabelRow.Text = res.Get("Row");
- lblCustomLabelForeColor.Text = cmnRes.Get("ForeColor");
- lblCustomLabelMarkColor.Text = res.Get("MarkColor");
- lblCustomLabelMarkStyle.Text = res.Get("MarkStyle");
- #endregion
- #region Grid
- res = new MyRes("Forms,ChartEditor,ChartEditorControl,Axes,Grid");
- tabAxisGrid.Text = res.Get("");
- lblAxisGrid.Text = res.Get("GridLine");
- cbAxisGridEnabled.Text = res.Get("Enabled");
- lblAxisGridLineColor.Text = cmnRes.Get("LineColor");
- lblAxisGridLineStyle.Text = cmnRes.Get("LineStyle");
- lblAxisGridLineWidth.Text = cmnRes.Get("LineWidth");
- #endregion
- #region Ticks
- res = new MyRes("Forms,ChartEditor,ChartEditorControl,Axes,Ticks");
- tabAxisTicks.Text = res.Get("");
- lblAxisTick.Text = res.Get("Ticks");
- cbAxisTickEnabled.Text = res.Get("Enabled");
- lblAxisTickStyle.Text = res.Get("TickStyle");
- lblAxisTickSize.Text = res.Get("TickSize");
- lblAxisTickLineColor.Text = cmnRes.Get("LineColor");
- lblAxisTickLineStyle.Text = cmnRes.Get("LineStyle");
- lblAxisTickLineWidth.Text = cmnRes.Get("LineWidth");
- #endregion
- #region Strips
- tabAxisStrips.Text = Res.Get("Forms,ChartEditor,ChartEditorControl,Axes,Strips");
- res = new MyRes("Forms,ChartEditor,ChartEditorControl,Axes,Strips,Interval");
- tabStripInterval.Text = res.Get("");
- lblStripStart.Text = res.Get("Start");
- lblStripWidth.Text = res.Get("Width");
- lblStripInterval.Text = res.Get("Interval");
- res = new MyRes("Forms,ChartEditor,ChartEditorControl,Axes,Strips,Appearance");
- tabStripAppearance.Text = res.Get("");
- lblStripBackColor.Text = cmnRes.Get("BackColor");
- lblStripSecondaryColor.Text = cmnRes.Get("SecondaryColor");
- lblStripGradient.Text = cmnRes.Get("Gradient");
- lblStripHatchStyle.Text = cmnRes.Get("HatchStyle");
- lblStripBorderColor.Text = cmnRes.Get("BorderColor");
- lblStripBorderStyle.Text = cmnRes.Get("BorderStyle");
- lblStripBorderWidth.Text = cmnRes.Get("BorderWidth");
- res = new MyRes("Forms,ChartEditor,ChartEditorControl,Axes,Strips,Text");
- tabStripText.Text = res.Get("");
- lblStripText.Text = cmnRes.Get("Text");
- lblStripFont.Text = cmnRes.Get("Font");
- lblStripTextForeColor.Text = cmnRes.Get("ForeColor");
- lblStripTextAlign.Text = res.Get("HorizontalAlign");
- lblStripLineAlign.Text = res.Get("VerticalAlign");
- lblStripTextOrientation.Text = res.Get("TextOrientation");
- #endregion
- #endregion
- #region Legend
- res = new MyRes("Forms,ChartEditor,ChartEditorControl,Legend");
- pgLegend.Text = res.Get("");
- cbLegendEnabled.Text = res.Get("Enabled");
- res = new MyRes("Forms,ChartEditor,ChartEditorControl,Legend,General");
- tabLegendGeneral.Text = res.Get("");
- lblLegendStyle.Text = res.Get("LegendStyle");
- lblLegendDock.Text = cmnRes.Get("Dock");
- cbLegendInsideChartArea.Text = cmnRes.Get("InsideChartArea");
- tabLegendAppearance.Text = Res.Get("Forms,ChartEditor,ChartEditorControl,Legend,Appearance");
- lblLegendBackColor.Text = cmnRes.Get("BackColor");
- lblLegendSecondaryColor.Text = cmnRes.Get("SecondaryColor");
- lblLegendGradient.Text = cmnRes.Get("Gradient");
- lblLegendHatchStyle.Text = cmnRes.Get("HatchStyle");
- lblLegendBorderColor.Text = cmnRes.Get("BorderColor");
- lblLegendBorderStyle.Text = cmnRes.Get("BorderStyle");
- lblLegendBorderWidth.Text = cmnRes.Get("BorderWidth");
- lblLegendShadowColor.Text = cmnRes.Get("ShadowColor");
- lblLegendShadowOffset.Text = cmnRes.Get("ShadowOffset");
- lblLegendFont.Text = cmnRes.Get("Font");
- lblLegendForeColor.Text = cmnRes.Get("ForeColor");
- #endregion
- #region Title
- res = new MyRes("Forms,ChartEditor,ChartEditorControl,Title");
- pgTitle.Text = res.Get("");
- cbTitleVisible.Text = res.Get("Visible");
- res = new MyRes("Forms,ChartEditor,ChartEditorControl,Title,General");
- tabTitleGeneral.Text = res.Get("");
- lblTitleText.Text = cmnRes.Get("Text");
- lblTitleTextOrientation.Text = res.Get("TextOrientation");
- lblTitleTextStyle.Text = res.Get("TextStyle");
- lblTitleDock.Text = cmnRes.Get("Dock");
- cbTitleInsideChartArea.Text = cmnRes.Get("InsideChartArea");
- tabTitleAppearance.Text = Res.Get("Forms,ChartEditor,ChartEditorControl,Title,Appearance");
- lblTitleBackColor.Text = cmnRes.Get("BackColor");
- lblTitleSecondaryColor.Text = cmnRes.Get("SecondaryColor");
- lblTitleGradient.Text = cmnRes.Get("Gradient");
- lblTitleHatchStyle.Text = cmnRes.Get("HatchStyle");
- lblTitleBorderColor.Text = cmnRes.Get("BorderColor");
- lblTitleBorderStyle.Text = cmnRes.Get("BorderStyle");
- lblTitleBorderWidth.Text = cmnRes.Get("BorderWidth");
- lblTitleShadowColor.Text = cmnRes.Get("ShadowColor");
- lblTitleShadowOffset.Text = cmnRes.Get("ShadowOffset");
- lblTitleFont.Text = cmnRes.Get("Font");
- lblTitleForeColor.Text = cmnRes.Get("ForeColor");
- #endregion
- }
- public void UpdateDpiDependencies()
- {
- lbTemplate.ItemHeight = this.LogicalToDevice(14);
- tbFilter.Image = this.GetImage(52);
- tbAxisLabelFont.Image = this.GetImage(59);
- tbAxisTitleFont.Image = this.GetImage(59);
- tbStripTextFont.Image = this.GetImage(59);
- tbLegendFont.Image = this.GetImage(59);
- tbTitleFont.Image = this.GetImage(59);
- }
- public ChartEditorControl()
- {
- InitializeComponent();
- Init();
- }
- #region Data tab
- private void cbxDataSource_SelectedIndexChanged(object sender, EventArgs e)
- {
- if (updating)
- return;
- DataSourceBase ds = Report.GetDataSource((string)cbxDataSource.Items[cbxDataSource.SelectedIndex]);
- Chart.DataSource = ds;
- cbxAutoSeriesData.DataSource = ds;
- cbxAutoSeriesColor.DataSource = ds;
- OnChange();
- }
- private void tbFilter_ButtonClick(object sender, EventArgs e)
- {
- tbFilter.Text = Editors.EditExpression(Report, tbFilter.Text);
- }
- private void tbFilter_Leave(object sender, EventArgs e)
- {
- if (updating)
- return;
- Chart.Filter = tbFilter.Text;
- OnChange();
- }
- private void cbxAutoSeriesData_Leave(object sender, EventArgs e)
- {
- Chart.AutoSeriesColumn = cbxAutoSeriesData.Text;
- OnChange();
- }
- private void cbxAutoSeriesColor_Leave(object sender, EventArgs e)
- {
- Chart.AutoSeriesColor = cbxAutoSeriesColor.Text;
- OnChange();
- }
- private void cbxAutoSeriesSort_Leave(object sender, EventArgs e)
- {
- Chart.AutoSeriesSortOrder = (SortOrder)cbxAutoSeriesSort.SelectedIndex;
- OnChange();
- }
- private void cbAlignXValues_Leave(object sender, EventArgs e)
- {
- Chart.AlignXValues = cbAlignXValues.Checked;
- OnChange();
- }
- #endregion
- #region Appearance tab
- private void LoadTemplate(Stream stream)
- {
- using (Chart tempChart = new Chart())
- {
- tempChart.Serializer.Content = SerializationContents.All;
- tempChart.Serializer.Load(stream);
- Helper.AssignChartAppearance(MSChart, tempChart);
- }
- UpdateControls();
- OnChange();
- }
- private void lbTemplate_SelectedIndexChanged(object sender, EventArgs e)
- {
- if (updating || lbTemplate.SelectedIndex == 0)
- return;
- string templateName = (string)lbTemplate.SelectedItem;
- using (Stream stream = ResourceLoader.GetStream("MSChart." + templateName + ".xml"))
- {
- LoadTemplate(stream);
- }
- }
- private void lbTemplate_DrawItem(object sender, DrawItemEventArgs e)
- {
- e.DrawBackground();
- string item = lbTemplate.Items[e.Index].ToString();
- item = Res.Get("Forms,ChartEditor,ChartEditorControl,Appearance,Templates," + item);
- TextRenderer.DrawText(e.Graphics, item, e.Font, e.Bounds.Location, e.ForeColor);
- }
- private void btnLoadTemplate_Click(object sender, EventArgs e)
- {
- using (OpenFileDialog dialog = new OpenFileDialog())
- {
- dialog.Filter = Res.Get("FileFilters,XmlFile");
- if (dialog.ShowDialog() == DialogResult.OK)
- {
- using (FileStream stream = new FileStream(dialog.FileName, FileMode.Open, FileAccess.Read))
- {
- LoadTemplate(stream);
- }
- }
- }
- }
- private void btnSaveTemplate_Click(object sender, EventArgs e)
- {
- using (SaveFileDialog dialog = new SaveFileDialog())
- {
- dialog.Filter = Res.Get("FileFilters,XmlFile");
- if (dialog.ShowDialog() == DialogResult.OK)
- {
- MSChart.Serializer.Content = SerializationContents.All;
- MSChart.Serializer.Save(dialog.FileName);
- }
- }
- }
- private void cbxBackColor_ColorSelected(object sender, EventArgs e)
- {
- if (updating)
- return;
- MSChart.BackColor = cbxBackColor.Color;
- OnChange();
- }
- private void cbxSecondaryColor_ColorSelected(object sender, EventArgs e)
- {
- if (updating)
- return;
- MSChart.BackSecondaryColor = cbxSecondaryColor.Color;
- OnChange();
- }
- private void cbxGradient_SelectedIndexChanged(object sender, EventArgs e)
- {
- if (updating)
- return;
- MSChart.BackGradientStyle = (GradientStyle)cbxGradient.SelectedIndex;
- OnChange();
- }
- private void cbxHatchStyle_SelectedIndexChanged(object sender, EventArgs e)
- {
- if (updating)
- return;
- MSChart.BackHatchStyle = (ChartHatchStyle)cbxHatchStyle.SelectedIndex;
- OnChange();
- }
- private void cbxBorderSkin_SelectedIndexChanged(object sender, EventArgs e)
- {
- if (updating)
- return;
- MSChart.BorderSkin.SkinStyle = (BorderSkinStyle)cbxBorderSkin.SelectedIndex;
- OnChange();
- }
- private void cbxBorderColor_ColorSelected(object sender, EventArgs e)
- {
- if (updating)
- return;
- MSChart.BorderlineColor = cbxBorderColor.Color;
- OnChange();
- }
- private void cbxBorderStyle_SelectedIndexChanged(object sender, EventArgs e)
- {
- if (updating)
- return;
- MSChart.BorderlineDashStyle = (ChartDashStyle)cbxBorderStyle.SelectedIndex;
- OnChange();
- }
- private void udBorderWidth_ValueChanged(object sender, EventArgs e)
- {
- if (updating)
- return;
- MSChart.BorderlineWidth = (int)udBorderWidth.Value;
- OnChange();
- }
- private void cbxSeriesPalette_SelectedIndexChanged(object sender, EventArgs e)
- {
- if (updating)
- return;
- MSChart.Palette = (ChartColorPalette)cbxSeriesPalette.SelectedIndex;
- OnChange();
- }
- #endregion
- #region Chart area tab
- private void cbxChartArea_SelectedIndexChanged(object sender, EventArgs e)
- {
- if (updating)
- return;
- UpdateChartAreaControls();
- }
- private void cbxAreaBackColor_ColorSelected(object sender, EventArgs e)
- {
- if (updating)
- return;
- ChartArea.BackColor = cbxAreaBackColor.Color;
- OnChange();
- }
- private void cbxAreaSecondaryColor_ColorSelected(object sender, EventArgs e)
- {
- if (updating)
- return;
- ChartArea.BackSecondaryColor = cbxAreaSecondaryColor.Color;
- OnChange();
- }
- private void cbxAreaGradient_SelectedIndexChanged(object sender, EventArgs e)
- {
- if (updating)
- return;
- ChartArea.BackGradientStyle = (GradientStyle)cbxAreaGradient.SelectedIndex;
- OnChange();
- }
- private void cbxAreaHatchStyle_SelectedIndexChanged(object sender, EventArgs e)
- {
- if (updating)
- return;
- ChartArea.BackHatchStyle = (ChartHatchStyle)cbxAreaHatchStyle.SelectedIndex;
- OnChange();
- }
- private void cbxAreaBorderColor_ColorSelected(object sender, EventArgs e)
- {
- if (updating)
- return;
- ChartArea.BorderColor = cbxAreaBorderColor.Color;
- OnChange();
- }
- private void cbxAreaBorderStyle_SelectedIndexChanged(object sender, EventArgs e)
- {
- if (updating)
- return;
- ChartArea.BorderDashStyle = (ChartDashStyle)cbxAreaBorderStyle.SelectedIndex;
- OnChange();
- }
- private void udAreaBorderWidth_ValueChanged(object sender, EventArgs e)
- {
- if (updating)
- return;
- ChartArea.BorderWidth = (int)udAreaBorderWidth.Value;
- OnChange();
- }
- private void cbxAreaShadowColor_ColorSelected(object sender, EventArgs e)
- {
- if (updating)
- return;
- ChartArea.ShadowColor = cbxAreaShadowColor.Color;
- OnChange();
- }
- private void cbxAreaShadowOffset_ValueChanged(object sender, EventArgs e)
- {
- if (updating)
- return;
- ChartArea.ShadowOffset = (int)udAreaShadowOffset.Value;
- OnChange();
- }
- #endregion
- #region 3D tab
- private void cb3DEnable_CheckedChanged(object sender, EventArgs e)
- {
- if (updating)
- return;
- ChartArea.Area3DStyle.Enable3D = cb3DEnable.Checked;
- OnChange();
- }
- private void trb3DXRotation_ValueChanged(object sender, EventArgs e)
- {
- if (updating)
- return;
- updating = true;
- if (sender == trb3DXRotation)
- ud3DXRotation.Value = trb3DXRotation.Value;
- else
- trb3DXRotation.Value = (int)ud3DXRotation.Value;
- ChartArea.Area3DStyle.Inclination = trb3DXRotation.Value;
- updating = false;
- OnChange();
- }
- private void trb3DYRotation_ValueChanged(object sender, EventArgs e)
- {
- if (updating)
- return;
- updating = true;
- if (sender == trb3DYRotation)
- ud3DYRotation.Value = trb3DYRotation.Value;
- else
- trb3DYRotation.Value = (int)ud3DYRotation.Value;
- ChartArea.Area3DStyle.Rotation = trb3DYRotation.Value;
- updating = false;
- OnChange();
- }
- private void trb3DPerspective_ValueChanged(object sender, EventArgs e)
- {
- if (updating)
- return;
- updating = true;
- if (sender == trb3DPerspective)
- ud3DPerspective.Value = trb3DPerspective.Value;
- else
- trb3DPerspective.Value = (int)ud3DPerspective.Value;
- ChartArea.Area3DStyle.Perspective = trb3DPerspective.Value;
- updating = false;
- OnChange();
- }
- private void ud3DWallWidth_ValueChanged(object sender, EventArgs e)
- {
- if (updating)
- return;
- ChartArea.Area3DStyle.WallWidth = (int)ud3DWallWidth.Value;
- OnChange();
- }
- private void ud3DAxisDepth_ValueChanged(object sender, EventArgs e)
- {
- if (updating)
- return;
- ChartArea.Area3DStyle.PointDepth = (int)ud3DAxisDepth.Value;
- OnChange();
- }
- private void cbx3DLightStyle_SelectedIndexChanged(object sender, EventArgs e)
- {
- if (updating)
- return;
- ChartArea.Area3DStyle.LightStyle = (LightStyle)cbx3DLightStyle.SelectedIndex;
- OnChange();
- }
- private void cb3DClustered_CheckedChanged(object sender, EventArgs e)
- {
- if (updating)
- return;
- ChartArea.Area3DStyle.IsClustered = cb3DClustered.Checked;
- OnChange();
- }
- #endregion
- #region Axes tab
- private void cbxAxis_SelectedIndexChanged(object sender, EventArgs e)
- {
- if (updating)
- return;
- UpdateAxisControls();
- }
- private void btnCopyFromXAxis_Click(object sender, EventArgs e)
- {
- Helper.AssignAxisAppearance(Axis, ChartArea.AxisX);
- UpdateAxisControls();
- OnChange();
- }
- private void btnCopyFromPrimaryAxis_Click(object sender, EventArgs e)
- {
- Axis primaryAxis = cbxAxis.SelectedIndex == 2 ? ChartArea.AxisX : ChartArea.AxisY;
- Helper.AssignAxisAppearance(Axis, primaryAxis);
- UpdateAxisControls();
- OnChange();
- }
- #region General tab
- private void cbAxisEnabled_CheckedChanged(object sender, EventArgs e)
- {
- if (updating)
- return;
- Axis.Enabled = cbAxisEnabled.Checked ? AxisEnabled.Auto : AxisEnabled.False;
- OnChange();
- }
- private void cbAxisMargin_CheckedChanged(object sender, EventArgs e)
- {
- if (updating)
- return;
- Axis.IsMarginVisible = cbAxisMargin.Checked;
- OnChange();
- }
- private void cbAxisLogarithmic_CheckedChanged(object sender, EventArgs e)
- {
- if (updating)
- return;
- Axis.IsLogarithmic = cbAxisLogarithmic.Checked;
- OnChange();
- }
- private void cbAxisReversed_CheckedChanged(object sender, EventArgs e)
- {
- if (updating)
- return;
- Axis.IsReversed = cbAxisReversed.Checked;
- OnChange();
- }
- private void udAxisInterval_ValueChanged(object sender, EventArgs e)
- {
- if (updating)
- return;
- Axis.Interval = (double)udAxisInterval.Value;
- OnChange();
- }
- private void cbxAxisIntervalType_SelectedIndexChanged(object sender, EventArgs e)
- {
- if (updating)
- return;
- Axis.IntervalType = (DateTimeIntervalType)cbxAxisIntervalType.SelectedIndex;
- OnChange();
- }
- private void cbAxisInterlaced_CheckedChanged(object sender, EventArgs e)
- {
- if (updating)
- return;
- Axis.IsInterlaced = cbAxisInterlaced.Checked;
- OnChange();
- }
- private void cbxAxisLineColor_ColorSelected(object sender, EventArgs e)
- {
- if (updating)
- return;
- Axis.LineColor = cbxAxisLineColor.Color;
- OnChange();
- }
- private void cbxAxisLineStyle_SelectedIndexChanged(object sender, EventArgs e)
- {
- if (updating)
- return;
- Axis.LineDashStyle = (ChartDashStyle)cbxAxisLineStyle.SelectedIndex;
- OnChange();
- }
- private void udAxisLineWidth_ValueChanged(object sender, EventArgs e)
- {
- if (updating)
- return;
- Axis.LineWidth = (int)udAxisLineWidth.Value;
- OnChange();
- }
- private void cbxAxisInterlacedColor_ColorSelected(object sender, EventArgs e)
- {
- if (updating)
- return;
- Axis.InterlacedColor = cbxAxisInterlacedColor.Color;
- OnChange();
- }
- #endregion
- #region Labels tab
- private void cbAxisLabelEnabled_CheckedChanged(object sender, EventArgs e)
- {
- if (updating)
- return;
- Axis.LabelStyle.Enabled = cbAxisLabelEnabled.Checked;
- OnChange();
- }
- private void tbAxisLabelFormat_Leave(object sender, EventArgs e)
- {
- if (updating)
- return;
- Axis.LabelStyle.Format = tbAxisLabelFormat.Text;
- OnChange();
- }
- private void tbAxisLabelFont_ButtonClick(object sender, EventArgs e)
- {
- using (FontDialog dialog = new FontDialog())
- {
- dialog.Font = Axis.LabelStyle.Font;
- if (dialog.ShowDialog() == DialogResult.OK)
- {
- Axis.LabelStyle.Font = dialog.Font;
- tbAxisLabelFont.Text = Converter.ToString(dialog.Font);
- OnChange();
- }
- }
- }
- private void cbxAxisLabelForeColor_ColorSelected(object sender, EventArgs e)
- {
- if (updating)
- return;
- Axis.LabelStyle.ForeColor = cbxAxisLabelForeColor.Color;
- OnChange();
- }
- private void udAxisLabelAngle_ValueChanged(object sender, EventArgs e)
- {
- if (updating)
- return;
- Axis.LabelStyle.Angle = (int)udAxisLabelAngle.Value;
- OnChange();
- }
- #endregion
- #region Title tab
- private void tbAxisTitleText_Leave(object sender, EventArgs e)
- {
- if (updating)
- return;
- Axis.Title = tbAxisTitleText.Text;
- OnChange();
- }
- private void tbAxisTitleFont_ButtonClick(object sender, EventArgs e)
- {
- using (FontDialog dialog = new FontDialog())
- {
- dialog.Font = Axis.TitleFont;
- if (dialog.ShowDialog() == DialogResult.OK)
- {
- Axis.TitleFont = dialog.Font;
- tbAxisTitleFont.Text = Converter.ToString(dialog.Font);
- OnChange();
- }
- }
- }
- private void cbxAxisTitleForeColor_ColorSelected(object sender, EventArgs e)
- {
- if (updating)
- return;
- Axis.TitleForeColor = cbxAxisTitleForeColor.Color;
- OnChange();
- }
- #endregion
- #region Custom labels tab
- private void lbCustomLabels_SelectedIndexChanged(object sender, EventArgs e)
- {
- if (updating)
- return;
- UpdateAxisCustomLabels();
- }
- private void btnAddCustomLabel_Click(object sender, EventArgs e)
- {
- CustomLabel label = new CustomLabel();
- Axis.CustomLabels.Add(label);
- lbCustomLabels.Items.Add(Res.Get("Forms,ChartEditor,ChartEditorControl,Axes,CustomLabels,Label"));
- lbCustomLabels.SelectedIndex = lbCustomLabels.Items.Count - 1;
- OnChange();
- }
- private void btnDeleteCustomLabel_Click(object sender, EventArgs e)
- {
- int index = lbCustomLabels.SelectedIndex;
- lbCustomLabels.Items.RemoveAt(index);
- Axis.CustomLabels.RemoveAt(index);
- if (index >= lbCustomLabels.Items.Count)
- index--;
- if (index >= 0)
- lbCustomLabels.SelectedIndex = index;
- OnChange();
- }
- private void tbCustomLabelText_Leave(object sender, EventArgs e)
- {
- if (updating)
- return;
- CustomLabel.Text = tbCustomLabelText.Text;
- OnChange();
- }
- private void udCustomLabelStart_ValueChanged(object sender, EventArgs e)
- {
- if (updating)
- return;
- CustomLabel.FromPosition = (double)udCustomLabelStart.Value;
- OnChange();
- }
- private void udCustomLabelEnd_ValueChanged(object sender, EventArgs e)
- {
- if (updating)
- return;
- CustomLabel.ToPosition = (double)udCustomLabelEnd.Value;
- OnChange();
- }
- private void udCustomLabelRow_ValueChanged(object sender, EventArgs e)
- {
- if (updating)
- return;
- CustomLabel.RowIndex = (int)udCustomLabelRow.Value;
- OnChange();
- }
- private void cbxCustomLabelForeColor_ColorSelected(object sender, EventArgs e)
- {
- if (updating)
- return;
- CustomLabel.ForeColor = cbxCustomLabelForeColor.Color;
- OnChange();
- }
- private void cbxCustomLabelMarkColor_ColorSelected(object sender, EventArgs e)
- {
- if (updating)
- return;
- CustomLabel.MarkColor = cbxCustomLabelMarkColor.Color;
- OnChange();
- }
- private void cbxCustomLabelMarkStyle_SelectedIndexChanged(object sender, EventArgs e)
- {
- if (updating)
- return;
- CustomLabel.LabelMark = (LabelMarkStyle)cbxCustomLabelMarkStyle.SelectedIndex;
- OnChange();
- }
- #endregion
- #region Grid tab
- private void cbxAxisGrid_SelectedIndexChanged(object sender, EventArgs e)
- {
- if (updating)
- return;
- UpdateAxisGridControls();
- }
- private void cbAxisGridEnabled_CheckedChanged(object sender, EventArgs e)
- {
- if (updating)
- return;
- Grid.Enabled = cbAxisGridEnabled.Checked;
- OnChange();
- }
- private void cbxAxisGridLineColor_ColorSelected(object sender, EventArgs e)
- {
- if (updating)
- return;
- Grid.LineColor = cbxAxisGridLineColor.Color;
- OnChange();
- }
- private void cbxAxisGridLineStyle_SelectedIndexChanged(object sender, EventArgs e)
- {
- if (updating)
- return;
- Grid.LineDashStyle = (ChartDashStyle)cbxAxisGridLineStyle.SelectedIndex;
- OnChange();
- }
- private void udAxisGridLineWidth_ValueChanged(object sender, EventArgs e)
- {
- if (updating)
- return;
- Grid.LineWidth = (int)udAxisGridLineWidth.Value;
- OnChange();
- }
- #endregion
- #region Ticks tab
- private void cbxAxisTick_SelectedIndexChanged(object sender, EventArgs e)
- {
- if (updating)
- return;
- UpdateAxisTickControls();
- }
- private void cbAxisTickEnabled_CheckedChanged(object sender, EventArgs e)
- {
- if (updating)
- return;
- Tick.Enabled = cbAxisTickEnabled.Checked;
- OnChange();
- }
- private void cbxAxisTickStyle_SelectedIndexChanged(object sender, EventArgs e)
- {
- if (updating)
- return;
- Tick.TickMarkStyle = (TickMarkStyle)cbxAxisTickStyle.SelectedIndex;
- OnChange();
- }
- private void udAxisTickSize_ValueChanged(object sender, EventArgs e)
- {
- if (updating)
- return;
- Tick.Size = (float)udAxisTickSize.Value;
- OnChange();
- }
- private void cbxAxisTickLineColor_ColorSelected(object sender, EventArgs e)
- {
- if (updating)
- return;
- Tick.LineColor = cbxAxisTickLineColor.Color;
- OnChange();
- }
- private void cbxAxisTickLineStyle_SelectedIndexChanged(object sender, EventArgs e)
- {
- if (updating)
- return;
- Tick.LineDashStyle = (ChartDashStyle)cbxAxisTickLineStyle.SelectedIndex;
- OnChange();
- }
- private void udAxisTickLineWidth_ValueChanged(object sender, EventArgs e)
- {
- if (updating)
- return;
- Tick.LineWidth = (int)udAxisTickLineWidth.Value;
- OnChange();
- }
- #endregion
- #region Strips tab
- private void lbAxisStrips_SelectedIndexChanged(object sender, EventArgs e)
- {
- if (updating)
- return;
- UpdateAxisStripControls();
- }
- private void btnAddStrip_Click(object sender, EventArgs e)
- {
- StripLine strip = new StripLine();
- Axis.StripLines.Add(strip);
- lbAxisStrips.Items.Add(Res.Get("Forms,ChartEditor,ChartEditorControl,Axes,Strips,Strip"));
- lbAxisStrips.SelectedIndex = lbAxisStrips.Items.Count - 1;
- OnChange();
- }
- private void btnDeleteStrip_Click(object sender, EventArgs e)
- {
- int index = lbAxisStrips.SelectedIndex;
- lbAxisStrips.Items.RemoveAt(index);
- Axis.StripLines.RemoveAt(index);
- if (index >= lbAxisStrips.Items.Count)
- index--;
- if (index >= 0)
- lbAxisStrips.SelectedIndex = index;
- OnChange();
- }
- private void udStripStart_ValueChanged(object sender, EventArgs e)
- {
- if (updating)
- return;
- Strip.IntervalOffset = (double)udStripStart.Value;
- OnChange();
- }
- private void udStripWidth_ValueChanged(object sender, EventArgs e)
- {
- if (updating)
- return;
- Strip.StripWidth = (double)udStripWidth.Value;
- OnChange();
- }
- private void udStripInterval_ValueChanged(object sender, EventArgs e)
- {
- if (updating)
- return;
- Strip.Interval = (double)udStripInterval.Value;
- OnChange();
- }
- private void cbxStripStartType_SelectedIndexChanged(object sender, EventArgs e)
- {
- if (updating)
- return;
- Strip.IntervalOffsetType = (DateTimeIntervalType)cbxStripStartType.SelectedIndex;
- OnChange();
- }
- private void cbxStripWidthType_SelectedIndexChanged(object sender, EventArgs e)
- {
- if (updating)
- return;
- Strip.StripWidthType = (DateTimeIntervalType)cbxStripWidthType.SelectedIndex;
- OnChange();
- }
- private void cbxStripIntervalType_SelectedIndexChanged(object sender, EventArgs e)
- {
- if (updating)
- return;
- Strip.IntervalType = (DateTimeIntervalType)cbxStripIntervalType.SelectedIndex;
- OnChange();
- }
- private void cbxStripBackColor_ColorSelected(object sender, EventArgs e)
- {
- if (updating)
- return;
- Strip.BackColor = cbxStripBackColor.Color;
- OnChange();
- }
- private void cbxStripSecondaryColor_ColorSelected(object sender, EventArgs e)
- {
- if (updating)
- return;
- Strip.BackSecondaryColor = cbxStripSecondaryColor.Color;
- OnChange();
- }
- private void cbxStripGradient_SelectedIndexChanged(object sender, EventArgs e)
- {
- if (updating)
- return;
- Strip.BackGradientStyle = (GradientStyle)cbxStripGradient.SelectedIndex;
- OnChange();
- }
- private void cbxStripHatchStyle_SelectedIndexChanged(object sender, EventArgs e)
- {
- if (updating)
- return;
- Strip.BackHatchStyle = (ChartHatchStyle)cbxStripHatchStyle.SelectedIndex;
- OnChange();
- }
- private void cbxStripBorderColor_ColorSelected(object sender, EventArgs e)
- {
- if (updating)
- return;
- Strip.BorderColor = cbxStripBorderColor.Color;
- OnChange();
- }
- private void cbxStripBorderStyle_SelectedIndexChanged(object sender, EventArgs e)
- {
- if (updating)
- return;
- Strip.BorderDashStyle = (ChartDashStyle)cbxStripBorderStyle.SelectedIndex;
- OnChange();
- }
- private void udStripBorderWidth_ValueChanged(object sender, EventArgs e)
- {
- if (updating)
- return;
- Strip.BorderWidth = (int)udStripBorderWidth.Value;
- OnChange();
- }
- private void tbStripText_Leave(object sender, EventArgs e)
- {
- if (updating)
- return;
- Strip.Text = tbStripText.Text;
- OnChange();
- }
- private void tbStripTextFont_ButtonClick(object sender, EventArgs e)
- {
- using (FontDialog dialog = new FontDialog())
- {
- dialog.Font = Strip.Font;
- if (dialog.ShowDialog() == DialogResult.OK)
- {
- Strip.Font = dialog.Font;
- tbStripTextFont.Text = Converter.ToString(dialog.Font);
- OnChange();
- }
- }
- }
- private void cbxStripTextForeColor_ColorSelected(object sender, EventArgs e)
- {
- if (updating)
- return;
- Strip.ForeColor = cbxStripTextForeColor.Color;
- OnChange();
- }
- private void cbxStripTextHorzAlign_SelectedIndexChanged(object sender, EventArgs e)
- {
- if (updating)
- return;
- Strip.TextAlignment = (StringAlignment)cbxStripTextHorzAlign.SelectedIndex;
- OnChange();
- }
- private void cbxStripTextVertAlign_SelectedIndexChanged(object sender, EventArgs e)
- {
- if (updating)
- return;
- Strip.TextLineAlignment = (StringAlignment)cbxStripTextVertAlign.SelectedIndex;
- OnChange();
- }
- private void cbxStripTextOrientation_SelectedIndexChanged(object sender, EventArgs e)
- {
- if (updating)
- return;
- Strip.TextOrientation = (TextOrientation)cbxStripTextOrientation.SelectedIndex;
- OnChange();
- }
- #endregion
- #endregion
- #region Legend tab
- private void cbLegendEnabled_CheckedChanged(object sender, EventArgs e)
- {
- if (updating)
- return;
- Legend.Enabled = cbLegendEnabled.Checked;
- OnChange();
- }
- private void cbxLegendStyle_SelectedIndexChanged(object sender, EventArgs e)
- {
- if (updating)
- return;
- Legend.LegendStyle = (LegendStyle)cbxLegendStyle.SelectedIndex;
- OnChange();
- }
- private void btnL12_Click(object sender, EventArgs e)
- {
- if (updating)
- return;
- int dock = int.Parse((sender as Button).Tag.ToString());
- Legend.Docking = (Docking)(dock / 3);
- Legend.Alignment = (StringAlignment)(dock % 3);
- UpdateLegendDockButtons();
- OnChange();
- }
- private void cbLegendInsideChartArea_CheckedChanged(object sender, EventArgs e)
- {
- if (updating)
- return;
- Legend.IsDockedInsideChartArea = cbLegendInsideChartArea.Checked;
- Legend.DockedToChartArea = Legend.IsDockedInsideChartArea ? "Default" : "";
- OnChange();
- }
- private void cbxLegendBackColor_ColorSelected(object sender, EventArgs e)
- {
- if (updating)
- return;
- Legend.BackColor = cbxLegendBackColor.Color;
- OnChange();
- }
- private void cbxLegendSecondaryColor_ColorSelected(object sender, EventArgs e)
- {
- if (updating)
- return;
- Legend.BackSecondaryColor = cbxLegendSecondaryColor.Color;
- OnChange();
- }
- private void cbxLegendGradient_SelectedIndexChanged(object sender, EventArgs e)
- {
- if (updating)
- return;
- Legend.BackGradientStyle = (GradientStyle)cbxLegendGradient.SelectedIndex;
- OnChange();
- }
- private void cbxLegendHatchStyle_SelectedIndexChanged(object sender, EventArgs e)
- {
- if (updating)
- return;
- Legend.BackHatchStyle = (ChartHatchStyle)cbxLegendHatchStyle.SelectedIndex;
- OnChange();
- }
- private void cbxLegendBorderColor_ColorSelected(object sender, EventArgs e)
- {
- if (updating)
- return;
- Legend.BorderColor = cbxLegendBorderColor.Color;
- OnChange();
- }
- private void cbxLegendBorderStyle_SelectedIndexChanged(object sender, EventArgs e)
- {
- if (updating)
- return;
- Legend.BorderDashStyle = (ChartDashStyle)cbxLegendBorderStyle.SelectedIndex;
- OnChange();
- }
- private void udLegendBorderWidth_ValueChanged(object sender, EventArgs e)
- {
- if (updating)
- return;
- Legend.BorderWidth = (int)udLegendBorderWidth.Value;
- OnChange();
- }
- private void cbxLegendShadowColor_ColorSelected(object sender, EventArgs e)
- {
- if (updating)
- return;
- Legend.ShadowColor = cbxLegendShadowColor.Color;
- OnChange();
- }
- private void udLegendShadowOffset_ValueChanged(object sender, EventArgs e)
- {
- if (updating)
- return;
- Legend.ShadowOffset = (int)udLegendShadowOffset.Value;
- OnChange();
- }
- private void tbLegendFont_ButtonClick(object sender, EventArgs e)
- {
- using (FontDialog dialog = new FontDialog())
- {
- dialog.Font = Legend.Font;
- if (dialog.ShowDialog() == DialogResult.OK)
- {
- Legend.Font = dialog.Font;
- tbLegendFont.Text = Converter.ToString(dialog.Font);
- OnChange();
- }
- }
- }
- private void cbxLegendForeColor_ColorSelected(object sender, EventArgs e)
- {
- if (updating)
- return;
- Legend.ForeColor = cbxLegendForeColor.Color;
- OnChange();
- }
- #endregion
- #region Title tab
- private void lblTitleVisible_CheckedChanged(object sender, EventArgs e)
- {
- if (updating)
- return;
- Title.Visible = cbTitleVisible.Checked;
- OnChange();
- }
- private void tbTitleText_Leave(object sender, EventArgs e)
- {
- if (updating)
- return;
- Title.Text = tbTitleText.Text;
- OnChange();
- }
- private void cbxTitleTextOrientation_SelectedIndexChanged(object sender, EventArgs e)
- {
- if (updating)
- return;
- Title.TextOrientation = (TextOrientation)cbxTitleTextOrientation.SelectedIndex;
- OnChange();
- }
- private void cbxTitleTextStyle_SelectedIndexChanged(object sender, EventArgs e)
- {
- if (updating)
- return;
- Title.TextStyle = (TextStyle)cbxTitleTextStyle.SelectedIndex;
- OnChange();
- }
- private void btnT12_Click(object sender, EventArgs e)
- {
- if (updating)
- return;
- int dock = int.Parse((sender as Button).Tag.ToString());
- Title.Docking = (Docking)(dock / 3);
- switch (dock % 3)
- {
- case 0:
- Title.Alignment = ContentAlignment.TopLeft;
- break;
- case 1:
- Title.Alignment = ContentAlignment.TopCenter;
- break;
- case 2:
- Title.Alignment = ContentAlignment.TopRight;
- break;
- }
- UpdateTitleDockButtons();
- OnChange();
- }
- private void cbTitleDockInsideChartArea_CheckedChanged(object sender, EventArgs e)
- {
- if (updating)
- return;
- Title.IsDockedInsideChartArea = cbTitleInsideChartArea.Checked;
- Title.DockedToChartArea = Title.IsDockedInsideChartArea ? "Default" : "";
- OnChange();
- }
- private void cbxTitleBackColor_ColorSelected(object sender, EventArgs e)
- {
- if (updating)
- return;
- Title.BackColor = cbxTitleBackColor.Color;
- OnChange();
- }
- private void cbxTitleSecondaryColor_ColorSelected(object sender, EventArgs e)
- {
- if (updating)
- return;
- Title.BackSecondaryColor = cbxTitleSecondaryColor.Color;
- OnChange();
- }
- private void cbxTitleGradient_SelectedIndexChanged(object sender, EventArgs e)
- {
- if (updating)
- return;
- Title.BackGradientStyle = (GradientStyle)cbxTitleGradient.SelectedIndex;
- OnChange();
- }
- private void cbxTitleHatchStyle_SelectedIndexChanged(object sender, EventArgs e)
- {
- if (updating)
- return;
- Title.BackHatchStyle = (ChartHatchStyle)cbxTitleHatchStyle.SelectedIndex;
- OnChange();
- }
- private void cbxTitleBorderColor_ColorSelected(object sender, EventArgs e)
- {
- if (updating)
- return;
- Title.BorderColor = cbxTitleBorderColor.Color;
- OnChange();
- }
- private void cbxTitleBorderStyle_SelectedIndexChanged(object sender, EventArgs e)
- {
- if (updating)
- return;
- Title.BorderDashStyle = (ChartDashStyle)cbxTitleBorderStyle.SelectedIndex;
- OnChange();
- }
- private void udTitleBorderWidth_ValueChanged(object sender, EventArgs e)
- {
- if (updating)
- return;
- Title.BorderWidth = (int)udTitleBorderWidth.Value;
- OnChange();
- }
- private void cbxTitleShadowColor_ColorSelected(object sender, EventArgs e)
- {
- if (updating)
- return;
- Title.ShadowColor = cbxTitleShadowColor.Color;
- OnChange();
- }
- private void udTitleShadowOffset_ValueChanged(object sender, EventArgs e)
- {
- if (updating)
- return;
- Title.ShadowOffset = (int)udTitleShadowOffset.Value;
- OnChange();
- }
- private void tbTitleFont_ButtonClick(object sender, EventArgs e)
- {
- using (FontDialog dialog = new FontDialog())
- {
- dialog.Font = Title.Font;
- if (dialog.ShowDialog() == DialogResult.OK)
- {
- Title.Font = dialog.Font;
- tbTitleFont.Text = Converter.ToString(dialog.Font);
- OnChange();
- }
- }
- }
- private void cbxTitleForeColor_ColorSelected(object sender, EventArgs e)
- {
- if (updating)
- return;
- Title.ForeColor = cbxTitleForeColor.Color;
- OnChange();
- }
- #endregion
- private void cbForceAutoSeries_Leave(object sender, EventArgs e)
- {
- Chart.AutoSeriesForce = cbAutoSeriesForce.Checked;
- OnChange();
- }
- }
- }
|