├── .github └── FUNDING.yml ├── .gitignore ├── .hgignore ├── .hgtags ├── Doc ├── ChartDistance.JPG ├── CursorDropDownMenu.jpg ├── CursorSnapToNearestData.JPG ├── DLTTB.docx ├── Images │ ├── ChartTheme.png │ ├── ContextMenu.png │ ├── DualCursors.PNG │ └── Theme.PNG ├── MSChartExtension.mdj ├── MSChartExtension.vsdx ├── Sampling.pdn └── Sampling.png ├── LICENSE ├── MSChartExtension -FxCop.FxCop ├── MSChartExtension.NET ├── MSChartExtension.NET.csproj ├── MSChartExtensionLogo.ico ├── Properties │ ├── Resources.Designer.cs │ └── Resources.resx └── Resources │ ├── AboutDlgBackground.jpg │ ├── CAELogoSmall.png │ ├── FacebookIcon.png │ ├── GithubIcon.png │ └── MSChartExtensionLogo.png ├── MSChartExtension.NETDemo ├── MSChartExtension.NETDemo.csproj └── Program.cs ├── MSChartExtension.sln ├── MSChartExtension.userprefs ├── MSChartExtension ├── AboutDialog.Designer.cs ├── AboutDialog.cs ├── AboutDialog.resx ├── ChartCursor.cs ├── ChartCursorLabel.cs ├── ChartData.cs ├── ChartOption.cs ├── ConfigurationDialog.Designer.cs ├── ConfigurationDialog.cs ├── ConfigurationDialog.resx ├── DataPointCollectionExtension.cs ├── DownSampling.cs ├── Extensions.cs ├── LICENSE ├── LabelFormatControl.Designer.cs ├── LabelFormatControl.cs ├── LabelFormatControl.resx ├── MSChartExtension.cs ├── MSChartExtension.csproj ├── MSChartExtension.csproj.user ├── MSChartExtension.ruleset ├── MSChartExtensionLogo.ico ├── MSChartExtensionZoomDialog.Designer.cs ├── MSChartExtensionZoomDialog.cs ├── MSChartExtensionZoomDialog.resx ├── Properties │ ├── AssemblyInfo.cs │ ├── Resources.Designer.cs │ └── Resources.resx ├── ResourceSeries.cs ├── Resources │ ├── AboutDlgBackground.jpg │ ├── AboutDlgBackground.pdn │ ├── CAELogoSmall.png │ ├── FacebookIcon.png │ ├── GithubIcon.png │ ├── MSChartExtensionLogo.ico │ └── MSChartExtensionLogo.png ├── SeriesDataBuffer.cs ├── Theme │ ├── DarkTheme.cs │ ├── Futuristic.cs │ ├── NightVision.cs │ ├── ThemeBase.cs │ ├── ThemeManager.cs │ └── WindowsTheme.cs ├── WindowMessagesNativeMethods.cs └── packages.config ├── MSChartExtensionDemo ├── ChartForm.Designer.cs ├── ChartForm.cs ├── ChartForm.resx ├── Form1.Designer.cs ├── Form1.cs ├── Form1.resx ├── MSChartExtensionDemo.csproj ├── MSChartExtensionLogo.ico ├── Properties │ ├── AssemblyInfo.cs │ ├── Resources.Designer.cs │ ├── Resources.resx │ ├── Settings.Designer.cs │ └── Settings.settings ├── app.config └── packages.config ├── README.md ├── Release.bat └── packages └── NuPack.3.4.2 └── NuPack.3.4.2.nupkg /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | # These are supported funding model platforms 2 | 3 | github: Code-Artist 4 | patreon: # Replace with a single Patreon username 5 | open_collective: # Replace with a single Open Collective username 6 | ko_fi: # Replace with a single Ko-fi username 7 | tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel 8 | community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry 9 | liberapay: # Replace with a single Liberapay username 10 | issuehunt: # Replace with a single IssueHunt username 11 | otechie: # Replace with a single Otechie username 12 | lfx_crowdfunding: # Replace with a single LFX Crowdfunding project-name e.g., cloud-foundry 13 | custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2'] 14 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | ################# 2 | ## Eclipse 3 | ################# 4 | 5 | *.pydevproject 6 | .project 7 | .metadata 8 | bin/ 9 | tmp/ 10 | *.tmp 11 | *.bak 12 | *.swp 13 | *~.nib 14 | local.properties 15 | .classpath 16 | .settings/ 17 | .loadpath 18 | 19 | # External tool builders 20 | .externalToolBuilders/ 21 | 22 | # Locally stored "Eclipse launch configurations" 23 | *.launch 24 | 25 | # CDT-specific 26 | .cproject 27 | 28 | # PDT-specific 29 | .buildpath 30 | 31 | 32 | ################# 33 | ## Visual Studio 34 | ################# 35 | 36 | ## Ignore Visual Studio temporary files, build results, and 37 | ## files generated by popular Visual Studio add-ons. 38 | 39 | # User-specific files 40 | *.suo 41 | *.user 42 | *.sln.docstates 43 | 44 | # Build results 45 | 46 | [Dd]ebug/ 47 | [Rr]elease/ 48 | x64/ 49 | build/ 50 | [Bb]in/ 51 | [Oo]bj/ 52 | packages/ 53 | 54 | # MSTest test Results 55 | [Tt]est[Rr]esult*/ 56 | [Bb]uild[Ll]og.* 57 | 58 | *_i.c 59 | *_p.c 60 | *.ilk 61 | *.meta 62 | *.obj 63 | *.pch 64 | *.pdb 65 | *.pgc 66 | *.pgd 67 | *.rsp 68 | *.sbr 69 | *.tlb 70 | *.tli 71 | *.tlh 72 | *.tmp 73 | *.tmp_proj 74 | *.log 75 | *.vspscc 76 | *.vssscc 77 | .builds 78 | *.pidb 79 | *.log 80 | *.scc 81 | 82 | # Visual C++ cache files 83 | ipch/ 84 | *.aps 85 | *.ncb 86 | *.opensdf 87 | *.sdf 88 | *.cachefile 89 | 90 | # Visual Studio profiler 91 | *.psess 92 | *.vsp 93 | *.vspx 94 | 95 | # Guidance Automation Toolkit 96 | *.gpState 97 | 98 | # ReSharper is a .NET coding add-in 99 | _ReSharper*/ 100 | *.[Rr]e[Ss]harper 101 | 102 | # TeamCity is a build add-in 103 | _TeamCity* 104 | 105 | # DotCover is a Code Coverage Tool 106 | *.dotCover 107 | 108 | # NCrunch 109 | *.ncrunch* 110 | .*crunch*.local.xml 111 | 112 | # Installshield output folder 113 | [Ee]xpress/ 114 | 115 | # DocProject is a documentation generator add-in 116 | DocProject/buildhelp/ 117 | DocProject/Help/*.HxT 118 | DocProject/Help/*.HxC 119 | DocProject/Help/*.hhc 120 | DocProject/Help/*.hhk 121 | DocProject/Help/*.hhp 122 | DocProject/Help/Html2 123 | DocProject/Help/html 124 | 125 | # Click-Once directory 126 | publish/ 127 | 128 | # Publish Web Output 129 | *.Publish.xml 130 | *.pubxml 131 | 132 | # NuGet Packages Directory 133 | ## TODO: If you have NuGet Package Restore enabled, uncomment the next line 134 | #packages/ 135 | 136 | # Windows Azure Build Output 137 | csx 138 | *.build.csdef 139 | 140 | # Windows Store app package directory 141 | AppPackages/ 142 | 143 | # Others 144 | sql/ 145 | *.Cache 146 | ClientBin/ 147 | [Ss]tyle[Cc]op.* 148 | ~$* 149 | *~ 150 | *.dbmdl 151 | *.[Pp]ublish.xml 152 | *.pfx 153 | *.publishsettings 154 | 155 | # RIA/Silverlight projects 156 | Generated_Code/ 157 | 158 | # Backup & report files from converting an old project file to a newer 159 | # Visual Studio version. Backup files are not needed, because we have git ;-) 160 | _UpgradeReport_Files/ 161 | Backup*/ 162 | UpgradeLog*.XML 163 | UpgradeLog*.htm 164 | 165 | # SQL Server files 166 | App_Data/*.mdf 167 | App_Data/*.ldf 168 | 169 | ############# 170 | ## Windows detritus 171 | ############# 172 | 173 | # Windows image file caches 174 | Thumbs.db 175 | ehthumbs.db 176 | 177 | # Folder config file 178 | Desktop.ini 179 | 180 | # Recycle Bin used on file shares 181 | $RECYCLE.BIN/ 182 | 183 | # Mac crap 184 | .DS_Store 185 | 186 | 187 | ############# 188 | ## Python 189 | ############# 190 | 191 | *.py[co] 192 | 193 | # Packages 194 | *.egg 195 | *.egg-info 196 | dist/ 197 | build/ 198 | eggs/ 199 | parts/ 200 | var/ 201 | sdist/ 202 | develop-eggs/ 203 | .installed.cfg 204 | 205 | # Installer logs 206 | pip-log.txt 207 | 208 | # Unit test / coverage reports 209 | .coverage 210 | .tox 211 | 212 | #Translations 213 | *.mo 214 | 215 | #Mr Developer 216 | .mr.developer.cfg 217 | 218 | #TortoiseHg (Mercurial) 219 | .hg* 220 | NUGet Packages/MSChartExtension.1.4.1.nupkg 221 | .vs/ 222 | Reference/AlexeyKuryakin.txt 223 | Reference/_crw_lttb.pas 224 | -------------------------------------------------------------------------------- /.hgignore: -------------------------------------------------------------------------------- 1 | syntax: glob 2 | obj 3 | bin 4 | *.suo 5 | .gitignore 6 | .git 7 | .vs 8 | *.userprefs 9 | packages 10 | -------------------------------------------------------------------------------- /.hgtags: -------------------------------------------------------------------------------- 1 | 26d0f5dbd337205b60ce69929e3cdadd6f8a9db4 GitHub/wheelZoom 2 | 5377cfd75ff09929fca9f8b9c597b150e36075bf V-01-03-00 3 | 7c1f3df48458a85013ef5cd15ef0c0c13c1b695b V-01-02-00 4 | 9e8172fc405c25fa11889760a4697e2d8be15f8b V-01-01-02 5 | bdc1327bcc3792631ca0f19f0d2d90c2e3de6cdd GitHub/Clone 6 | ed5e13c29007f004d61fc0007ecba366749320c8 GitHub/master 7 | fd6a5c2e1e695787fcd5a05d294c7963d9f6dbbc V-01-00-00 8 | fea771e7e8facf8e36e850132f400667475d53b5 V-01-01-01 9 | 558b97b671a8c39969798a2a4b6e8d42c556bf0a V-01-04-00 10 | 6003d1d4673ac85fa8eb72ee2e9f51eabd90c4c8 V-01-04-01 11 | b4f61a016a6a20243d409fb71cb3ce4a78ef5dd4 V-02-00-00 12 | 1ad65eaa20bd38a423ef65e72ee8d3b482cc183f V-02-00-01 13 | 1ad65eaa20bd38a423ef65e72ee8d3b482cc183f CodeProject 14 | 6a1e4fff450a2014e4fae9cae40676f84c3a9e61 V-02-01-00 15 | 9d09e339656e18b83ba8b57e25cbcfd9b74309b6 V-02-01-02 16 | 04549718adef1082080f9f04fc4d889eac565474 V-02-00-01- 17 | 04549718adef1082080f9f04fc4d889eac565474 V-02-00-01- 18 | 0000000000000000000000000000000000000000 V-02-00-01- 19 | 04549718adef1082080f9f04fc4d889eac565474 V-02-02-00 20 | 04549718adef1082080f9f04fc4d889eac565474 V-02-02-00 21 | ab3e92417e47818b7fa4168f2bf2db5e32d1837f V-02-02-00 22 | 23cdba8379cfa15ac052d501d43c610eeea04c81 V-02-02-01 23 | 16f7a50a2046bcd9998ff956f717b7b43d5c2b18 V-02-02-02 24 | 16f7a50a2046bcd9998ff956f717b7b43d5c2b18 CodeProject-V2.2.0 25 | 111d3d5b58ee94e4585b5ccf752177eeefa5c124 V-02-02-03 26 | d9f141f1792ef206c9e511b6ca4bf4e216bbf524 V-02-02-04 27 | e8aee049b7ef51fbcf6292f9a2ab31ecb6976f6a V-02-03-00 28 | a6da29859937d1682239abae45076f68192c883a V-03-00-00 29 | 6ba77785b6f255dc0c657f8fbe6133a32c1bb039 V-03-01-00 30 | 57f29fadc2f6c3fd7a374758553bbf31291296be V-03-01-01 31 | 2e10fc5b3483e48e0ba399e1d0bfb50577ef395b V-03-02-00 32 | 783eccfa8295ade0c37d025b63d0d5e9a60b0d1a V-03-02-01 33 | 61082dabbeffb6e413acb9e4e40dcb9b535eec8f V-03-03-00 34 | c51bd881c3f531967deecc57ac650852fb5dea4c V-03-05-00 35 | c51bd881c3f531967deecc57ac650852fb5dea4c V-03-05-00 36 | 0000000000000000000000000000000000000000 V-03-05-00 37 | 0000000000000000000000000000000000000000 V-03-05-00 38 | cc22b265c1958c6707af431b0d3fd103c1566e9b V-03-05-00 39 | 46a88e9e5517955bd11eac714d76a5303df194b6 V-03-05-01 40 | ec1eda80b38fa705d5ea8dbab4d2d2e05d468003 V-03-05-02 41 | b897a70e9ff4e2d5991bf2d05018748394031f27 V-03-06-00 42 | 34159d2dd274f2204afbf9ca836c2c8a51eaa5a9 V-03-07-00 43 | 5844e91ab7f4e2fab159c2a882b70f1176b6baeb V-03-07-01 44 | 2018d99f7aef3e9755bf37f487751d997f49da24 V-03-07-03 45 | f44bea040065b8c033148f56fe63f5dd75c3f0be V-03-08-00 46 | c38baf3c78e6b6f60885f10166d506c43d9b0ed5 V-03-08-01 47 | 16b43d00aa855d7dc5b332bc2b92356d0ffbafa9 V-03-09-00 48 | 6fda79169d975d0871190e68925bb918445eb354 V-03-09-01 49 | 7714c152c38d3cb22afbff8bcde841a2af7ca583 V-03-09-02 50 | 32f595e40e9959ecffc73dc220f6fe64823fc69c V-03-10-00 51 | d11f97d189d68d0c41450c080450e9f3241fc987 V-03-10-01 52 | 33d202912c92198b50bcbc05212bf07dc7fdf98e V-03-10-02 53 | -------------------------------------------------------------------------------- /Doc/ChartDistance.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Code-Artist/MSChartExtension/d1ebcd615adaf418cd4d236203f22b2ce6b795ef/Doc/ChartDistance.JPG -------------------------------------------------------------------------------- /Doc/CursorDropDownMenu.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Code-Artist/MSChartExtension/d1ebcd615adaf418cd4d236203f22b2ce6b795ef/Doc/CursorDropDownMenu.jpg -------------------------------------------------------------------------------- /Doc/CursorSnapToNearestData.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Code-Artist/MSChartExtension/d1ebcd615adaf418cd4d236203f22b2ce6b795ef/Doc/CursorSnapToNearestData.JPG -------------------------------------------------------------------------------- /Doc/DLTTB.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Code-Artist/MSChartExtension/d1ebcd615adaf418cd4d236203f22b2ce6b795ef/Doc/DLTTB.docx -------------------------------------------------------------------------------- /Doc/Images/ChartTheme.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Code-Artist/MSChartExtension/d1ebcd615adaf418cd4d236203f22b2ce6b795ef/Doc/Images/ChartTheme.png -------------------------------------------------------------------------------- /Doc/Images/ContextMenu.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Code-Artist/MSChartExtension/d1ebcd615adaf418cd4d236203f22b2ce6b795ef/Doc/Images/ContextMenu.png -------------------------------------------------------------------------------- /Doc/Images/DualCursors.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Code-Artist/MSChartExtension/d1ebcd615adaf418cd4d236203f22b2ce6b795ef/Doc/Images/DualCursors.PNG -------------------------------------------------------------------------------- /Doc/Images/Theme.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Code-Artist/MSChartExtension/d1ebcd615adaf418cd4d236203f22b2ce6b795ef/Doc/Images/Theme.PNG -------------------------------------------------------------------------------- /Doc/MSChartExtension.vsdx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Code-Artist/MSChartExtension/d1ebcd615adaf418cd4d236203f22b2ce6b795ef/Doc/MSChartExtension.vsdx -------------------------------------------------------------------------------- /Doc/Sampling.pdn: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Code-Artist/MSChartExtension/d1ebcd615adaf418cd4d236203f22b2ce6b795ef/Doc/Sampling.pdn -------------------------------------------------------------------------------- /Doc/Sampling.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Code-Artist/MSChartExtension/d1ebcd615adaf418cd4d236203f22b2ce6b795ef/Doc/Sampling.png -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2019 Code Artist 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | 23 | -------------------------------------------------------------------------------- /MSChartExtension.NET/MSChartExtension.NET.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | net6.0-windows;net7.0-windows 5 | true 6 | enable 7 | disable 8 | System.Windows.Forms.DataVisualization.Charting 9 | Code Artist 10 | Code Art Engineering 11 | Copyright © Code Art Engineering 2012 - 2023 12 | MIT 13 | MSChart Extension for .NET Core. Build with WinForms.DataVisualization by Kirsan 14 | https://www.codearteng.com/search/label/MSChartExtension 15 | MSChartExtensionLogo.png 16 | README.md 17 | https://github.com/Code-Artist/MSChartExtension 18 | GitHub 19 | chart;data-visualization;winfors;net6 20 | Added Resource Utilization Chart 21 | True 22 | 3.11.1 23 | MSChartExtensionLogo.ico 24 | MSChart Extension for .NET Core 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | True 73 | \ 74 | 75 | 76 | True 77 | \ 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | True 89 | True 90 | Resources.resx 91 | 92 | 93 | 94 | 95 | 96 | ResXFileCodeGenerator 97 | Resources.Designer.cs 98 | 99 | 100 | 101 | 102 | -------------------------------------------------------------------------------- /MSChartExtension.NET/MSChartExtensionLogo.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Code-Artist/MSChartExtension/d1ebcd615adaf418cd4d236203f22b2ce6b795ef/MSChartExtension.NET/MSChartExtensionLogo.ico -------------------------------------------------------------------------------- /MSChartExtension.NET/Properties/Resources.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.42000 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace System.Windows.Forms.DataVisualization.Charting.Properties { 12 | using System; 13 | 14 | 15 | /// 16 | /// A strongly-typed resource class, for looking up localized strings, etc. 17 | /// 18 | // This class was auto-generated by the StronglyTypedResourceBuilder 19 | // class via a tool like ResGen or Visual Studio. 20 | // To add or remove a member, edit your .ResX file then rerun ResGen 21 | // with the /str option, or rebuild your VS project. 22 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")] 23 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 24 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 25 | internal class Resources { 26 | 27 | private static global::System.Resources.ResourceManager resourceMan; 28 | 29 | private static global::System.Globalization.CultureInfo resourceCulture; 30 | 31 | [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] 32 | internal Resources() { 33 | } 34 | 35 | /// 36 | /// Returns the cached ResourceManager instance used by this class. 37 | /// 38 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 39 | internal static global::System.Resources.ResourceManager ResourceManager { 40 | get { 41 | if (object.ReferenceEquals(resourceMan, null)) { 42 | global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("System.Windows.Forms.DataVisualization.Charting.Properties.Resources", typeof(Resources).Assembly); 43 | resourceMan = temp; 44 | } 45 | return resourceMan; 46 | } 47 | } 48 | 49 | /// 50 | /// Overrides the current thread's CurrentUICulture property for all 51 | /// resource lookups using this strongly typed resource class. 52 | /// 53 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 54 | internal static global::System.Globalization.CultureInfo Culture { 55 | get { 56 | return resourceCulture; 57 | } 58 | set { 59 | resourceCulture = value; 60 | } 61 | } 62 | 63 | /// 64 | /// Looks up a localized resource of type System.Drawing.Bitmap. 65 | /// 66 | internal static System.Drawing.Bitmap AboutDlgBackground { 67 | get { 68 | object obj = ResourceManager.GetObject("AboutDlgBackground", resourceCulture); 69 | return ((System.Drawing.Bitmap)(obj)); 70 | } 71 | } 72 | 73 | /// 74 | /// Looks up a localized resource of type System.Drawing.Bitmap. 75 | /// 76 | internal static System.Drawing.Bitmap CAELogoSmall { 77 | get { 78 | object obj = ResourceManager.GetObject("CAELogoSmall", resourceCulture); 79 | return ((System.Drawing.Bitmap)(obj)); 80 | } 81 | } 82 | 83 | /// 84 | /// Looks up a localized resource of type System.Drawing.Bitmap. 85 | /// 86 | internal static System.Drawing.Bitmap FacebookIcon { 87 | get { 88 | object obj = ResourceManager.GetObject("FacebookIcon", resourceCulture); 89 | return ((System.Drawing.Bitmap)(obj)); 90 | } 91 | } 92 | 93 | /// 94 | /// Looks up a localized resource of type System.Drawing.Bitmap. 95 | /// 96 | internal static System.Drawing.Bitmap GithubIcon { 97 | get { 98 | object obj = ResourceManager.GetObject("GithubIcon", resourceCulture); 99 | return ((System.Drawing.Bitmap)(obj)); 100 | } 101 | } 102 | 103 | /// 104 | /// Looks up a localized resource of type System.Drawing.Bitmap. 105 | /// 106 | internal static System.Drawing.Bitmap MSChartExtensionLogo { 107 | get { 108 | object obj = ResourceManager.GetObject("MSChartExtensionLogo", resourceCulture); 109 | return ((System.Drawing.Bitmap)(obj)); 110 | } 111 | } 112 | } 113 | } 114 | -------------------------------------------------------------------------------- /MSChartExtension.NET/Properties/Resources.resx: -------------------------------------------------------------------------------- 1 |  2 | 3 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | text/microsoft-resx 110 | 111 | 112 | 2.0 113 | 114 | 115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 116 | 117 | 118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 119 | 120 | 121 | 122 | ..\Resources\AboutDlgBackground.jpg;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a 123 | 124 | 125 | ..\Resources\CAELogoSmall.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a 126 | 127 | 128 | ..\Resources\FacebookIcon.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a 129 | 130 | 131 | ..\Resources\GithubIcon.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a 132 | 133 | 134 | ..\Resources\MSChartExtensionLogo.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a 135 | 136 | -------------------------------------------------------------------------------- /MSChartExtension.NET/Resources/AboutDlgBackground.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Code-Artist/MSChartExtension/d1ebcd615adaf418cd4d236203f22b2ce6b795ef/MSChartExtension.NET/Resources/AboutDlgBackground.jpg -------------------------------------------------------------------------------- /MSChartExtension.NET/Resources/CAELogoSmall.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Code-Artist/MSChartExtension/d1ebcd615adaf418cd4d236203f22b2ce6b795ef/MSChartExtension.NET/Resources/CAELogoSmall.png -------------------------------------------------------------------------------- /MSChartExtension.NET/Resources/FacebookIcon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Code-Artist/MSChartExtension/d1ebcd615adaf418cd4d236203f22b2ce6b795ef/MSChartExtension.NET/Resources/FacebookIcon.png -------------------------------------------------------------------------------- /MSChartExtension.NET/Resources/GithubIcon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Code-Artist/MSChartExtension/d1ebcd615adaf418cd4d236203f22b2ce6b795ef/MSChartExtension.NET/Resources/GithubIcon.png -------------------------------------------------------------------------------- /MSChartExtension.NET/Resources/MSChartExtensionLogo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Code-Artist/MSChartExtension/d1ebcd615adaf418cd4d236203f22b2ce6b795ef/MSChartExtension.NET/Resources/MSChartExtensionLogo.png -------------------------------------------------------------------------------- /MSChartExtension.NETDemo/MSChartExtension.NETDemo.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | WinExe 5 | net6.0-windows 6 | enable 7 | true 8 | enable 9 | MSChartExtensionDemo.Program 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | -------------------------------------------------------------------------------- /MSChartExtension.NETDemo/Program.cs: -------------------------------------------------------------------------------- 1 | namespace MSChartExtensionDemo 2 | { 3 | internal static class Program 4 | { 5 | /// 6 | /// The main entry point for the application. 7 | /// 8 | [STAThread] 9 | static void Main() 10 | { 11 | // To customize application configuration such as set high DPI settings or default font, 12 | // see https://aka.ms/applicationconfiguration. 13 | ApplicationConfiguration.Initialize(); 14 | Application.Run(new Form1()); 15 | } 16 | } 17 | } -------------------------------------------------------------------------------- /MSChartExtension.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio Version 17 4 | VisualStudioVersion = 17.7.34031.279 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MSChartExtension", "MSChartExtension\MSChartExtension.csproj", "{D865F90F-8498-4D31-BEAF-21A7D5EA0212}" 7 | EndProject 8 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MSChartExtensionDemo", "MSChartExtensionDemo\MSChartExtensionDemo.csproj", "{4BF8A3F7-DE4C-4675-976C-4CD5952ABB77}" 9 | EndProject 10 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MSChartExtension.NET", "MSChartExtension.NET\MSChartExtension.NET.csproj", "{EB439318-C24A-40F0-9738-3E22A2823F0C}" 11 | EndProject 12 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MSChartExtension.NETDemo", "MSChartExtension.NETDemo\MSChartExtension.NETDemo.csproj", "{DE1F7C68-634F-49A2-B747-80DD11D3730E}" 13 | EndProject 14 | Global 15 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 16 | Debug|Any CPU = Debug|Any CPU 17 | Debug|Mixed Platforms = Debug|Mixed Platforms 18 | Debug|x86 = Debug|x86 19 | Release|Any CPU = Release|Any CPU 20 | Release|Mixed Platforms = Release|Mixed Platforms 21 | Release|x86 = Release|x86 22 | EndGlobalSection 23 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 24 | {D865F90F-8498-4D31-BEAF-21A7D5EA0212}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 25 | {D865F90F-8498-4D31-BEAF-21A7D5EA0212}.Debug|Any CPU.Build.0 = Debug|Any CPU 26 | {D865F90F-8498-4D31-BEAF-21A7D5EA0212}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU 27 | {D865F90F-8498-4D31-BEAF-21A7D5EA0212}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU 28 | {D865F90F-8498-4D31-BEAF-21A7D5EA0212}.Debug|x86.ActiveCfg = Debug|Any CPU 29 | {D865F90F-8498-4D31-BEAF-21A7D5EA0212}.Release|Any CPU.ActiveCfg = Release|Any CPU 30 | {D865F90F-8498-4D31-BEAF-21A7D5EA0212}.Release|Any CPU.Build.0 = Release|Any CPU 31 | {D865F90F-8498-4D31-BEAF-21A7D5EA0212}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU 32 | {D865F90F-8498-4D31-BEAF-21A7D5EA0212}.Release|Mixed Platforms.Build.0 = Release|Any CPU 33 | {D865F90F-8498-4D31-BEAF-21A7D5EA0212}.Release|x86.ActiveCfg = Release|Any CPU 34 | {4BF8A3F7-DE4C-4675-976C-4CD5952ABB77}.Debug|Any CPU.ActiveCfg = Debug|x86 35 | {4BF8A3F7-DE4C-4675-976C-4CD5952ABB77}.Debug|Mixed Platforms.ActiveCfg = Debug|x86 36 | {4BF8A3F7-DE4C-4675-976C-4CD5952ABB77}.Debug|Mixed Platforms.Build.0 = Debug|x86 37 | {4BF8A3F7-DE4C-4675-976C-4CD5952ABB77}.Debug|x86.ActiveCfg = Debug|x86 38 | {4BF8A3F7-DE4C-4675-976C-4CD5952ABB77}.Debug|x86.Build.0 = Debug|x86 39 | {4BF8A3F7-DE4C-4675-976C-4CD5952ABB77}.Release|Any CPU.ActiveCfg = Release|x86 40 | {4BF8A3F7-DE4C-4675-976C-4CD5952ABB77}.Release|Mixed Platforms.ActiveCfg = Release|x86 41 | {4BF8A3F7-DE4C-4675-976C-4CD5952ABB77}.Release|Mixed Platforms.Build.0 = Release|x86 42 | {4BF8A3F7-DE4C-4675-976C-4CD5952ABB77}.Release|x86.ActiveCfg = Release|x86 43 | {4BF8A3F7-DE4C-4675-976C-4CD5952ABB77}.Release|x86.Build.0 = Release|x86 44 | {EB439318-C24A-40F0-9738-3E22A2823F0C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 45 | {EB439318-C24A-40F0-9738-3E22A2823F0C}.Debug|Any CPU.Build.0 = Debug|Any CPU 46 | {EB439318-C24A-40F0-9738-3E22A2823F0C}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU 47 | {EB439318-C24A-40F0-9738-3E22A2823F0C}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU 48 | {EB439318-C24A-40F0-9738-3E22A2823F0C}.Debug|x86.ActiveCfg = Debug|Any CPU 49 | {EB439318-C24A-40F0-9738-3E22A2823F0C}.Debug|x86.Build.0 = Debug|Any CPU 50 | {EB439318-C24A-40F0-9738-3E22A2823F0C}.Release|Any CPU.ActiveCfg = Release|Any CPU 51 | {EB439318-C24A-40F0-9738-3E22A2823F0C}.Release|Any CPU.Build.0 = Release|Any CPU 52 | {EB439318-C24A-40F0-9738-3E22A2823F0C}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU 53 | {EB439318-C24A-40F0-9738-3E22A2823F0C}.Release|Mixed Platforms.Build.0 = Release|Any CPU 54 | {EB439318-C24A-40F0-9738-3E22A2823F0C}.Release|x86.ActiveCfg = Release|Any CPU 55 | {EB439318-C24A-40F0-9738-3E22A2823F0C}.Release|x86.Build.0 = Release|Any CPU 56 | {DE1F7C68-634F-49A2-B747-80DD11D3730E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 57 | {DE1F7C68-634F-49A2-B747-80DD11D3730E}.Debug|Any CPU.Build.0 = Debug|Any CPU 58 | {DE1F7C68-634F-49A2-B747-80DD11D3730E}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU 59 | {DE1F7C68-634F-49A2-B747-80DD11D3730E}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU 60 | {DE1F7C68-634F-49A2-B747-80DD11D3730E}.Debug|x86.ActiveCfg = Debug|Any CPU 61 | {DE1F7C68-634F-49A2-B747-80DD11D3730E}.Debug|x86.Build.0 = Debug|Any CPU 62 | {DE1F7C68-634F-49A2-B747-80DD11D3730E}.Release|Any CPU.ActiveCfg = Release|Any CPU 63 | {DE1F7C68-634F-49A2-B747-80DD11D3730E}.Release|Any CPU.Build.0 = Release|Any CPU 64 | {DE1F7C68-634F-49A2-B747-80DD11D3730E}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU 65 | {DE1F7C68-634F-49A2-B747-80DD11D3730E}.Release|Mixed Platforms.Build.0 = Release|Any CPU 66 | {DE1F7C68-634F-49A2-B747-80DD11D3730E}.Release|x86.ActiveCfg = Release|Any CPU 67 | {DE1F7C68-634F-49A2-B747-80DD11D3730E}.Release|x86.Build.0 = Release|Any CPU 68 | EndGlobalSection 69 | GlobalSection(SolutionProperties) = preSolution 70 | HideSolutionNode = FALSE 71 | EndGlobalSection 72 | GlobalSection(ExtensibilityGlobals) = postSolution 73 | SolutionGuid = {8E6FC6C9-8D4D-4545-9315-FACFCB48A73E} 74 | EndGlobalSection 75 | EndGlobal 76 | -------------------------------------------------------------------------------- /MSChartExtension.userprefs: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /MSChartExtension/AboutDialog.Designer.cs: -------------------------------------------------------------------------------- 1 | namespace System.Windows.Forms.DataVisualization.Charting 2 | { 3 | partial class AboutDialog 4 | { 5 | /// 6 | /// Required designer variable. 7 | /// 8 | private System.ComponentModel.IContainer components = null; 9 | 10 | /// 11 | /// Clean up any resources being used. 12 | /// 13 | /// true if managed resources should be disposed; otherwise, false. 14 | protected override void Dispose(bool disposing) 15 | { 16 | if (disposing && (components != null)) 17 | { 18 | components.Dispose(); 19 | } 20 | base.Dispose(disposing); 21 | } 22 | 23 | #region Windows Form Designer generated code 24 | 25 | /// 26 | /// Required method for Designer support - do not modify 27 | /// the contents of this method with the code editor. 28 | /// 29 | private void InitializeComponent() 30 | { 31 | System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(AboutDialog)); 32 | this.flowLayoutPanel1 = new System.Windows.Forms.FlowLayoutPanel(); 33 | this.bloggerIcon = new System.Windows.Forms.PictureBox(); 34 | this.facebookIcon = new System.Windows.Forms.PictureBox(); 35 | this.githubIcon = new System.Windows.Forms.PictureBox(); 36 | this.btOK = new System.Windows.Forms.Button(); 37 | this.lbVersion = new System.Windows.Forms.Label(); 38 | this.flowLayoutPanel1.SuspendLayout(); 39 | ((System.ComponentModel.ISupportInitialize)(this.bloggerIcon)).BeginInit(); 40 | ((System.ComponentModel.ISupportInitialize)(this.facebookIcon)).BeginInit(); 41 | ((System.ComponentModel.ISupportInitialize)(this.githubIcon)).BeginInit(); 42 | this.SuspendLayout(); 43 | // 44 | // flowLayoutPanel1 45 | // 46 | this.flowLayoutPanel1.Anchor = System.Windows.Forms.AnchorStyles.Bottom; 47 | this.flowLayoutPanel1.AutoSize = true; 48 | this.flowLayoutPanel1.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink; 49 | this.flowLayoutPanel1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(35)))), ((int)(((byte)(64)))), ((int)(((byte)(80))))); 50 | this.flowLayoutPanel1.Controls.Add(this.bloggerIcon); 51 | this.flowLayoutPanel1.Controls.Add(this.facebookIcon); 52 | this.flowLayoutPanel1.Controls.Add(this.githubIcon); 53 | this.flowLayoutPanel1.Location = new System.Drawing.Point(354, 237); 54 | this.flowLayoutPanel1.Margin = new System.Windows.Forms.Padding(0); 55 | this.flowLayoutPanel1.Name = "flowLayoutPanel1"; 56 | this.flowLayoutPanel1.Size = new System.Drawing.Size(78, 26); 57 | this.flowLayoutPanel1.TabIndex = 0; 58 | // 59 | // bloggerIcon 60 | // 61 | this.bloggerIcon.Cursor = System.Windows.Forms.Cursors.Hand; 62 | this.bloggerIcon.Image = global::System.Windows.Forms.DataVisualization.Charting.Properties.Resources.CAELogoSmall; 63 | this.bloggerIcon.Location = new System.Drawing.Point(3, 3); 64 | this.bloggerIcon.Name = "bloggerIcon"; 65 | this.bloggerIcon.Size = new System.Drawing.Size(20, 20); 66 | this.bloggerIcon.TabIndex = 0; 67 | this.bloggerIcon.TabStop = false; 68 | this.bloggerIcon.Click += new System.EventHandler(this.IconClick); 69 | // 70 | // facebookIcon 71 | // 72 | this.facebookIcon.Cursor = System.Windows.Forms.Cursors.Hand; 73 | this.facebookIcon.Image = global::System.Windows.Forms.DataVisualization.Charting.Properties.Resources.FacebookIcon; 74 | this.facebookIcon.Location = new System.Drawing.Point(29, 3); 75 | this.facebookIcon.Name = "facebookIcon"; 76 | this.facebookIcon.Size = new System.Drawing.Size(20, 20); 77 | this.facebookIcon.TabIndex = 1; 78 | this.facebookIcon.TabStop = false; 79 | this.facebookIcon.Click += new System.EventHandler(this.IconClick); 80 | // 81 | // githubIcon 82 | // 83 | this.githubIcon.Cursor = System.Windows.Forms.Cursors.Hand; 84 | this.githubIcon.Image = global::System.Windows.Forms.DataVisualization.Charting.Properties.Resources.GithubIcon; 85 | this.githubIcon.Location = new System.Drawing.Point(55, 3); 86 | this.githubIcon.Name = "githubIcon"; 87 | this.githubIcon.Size = new System.Drawing.Size(20, 20); 88 | this.githubIcon.TabIndex = 2; 89 | this.githubIcon.TabStop = false; 90 | this.githubIcon.Click += new System.EventHandler(this.IconClick); 91 | // 92 | // btOK 93 | // 94 | this.btOK.Anchor = System.Windows.Forms.AnchorStyles.Bottom; 95 | this.btOK.DialogResult = System.Windows.Forms.DialogResult.OK; 96 | this.btOK.Location = new System.Drawing.Point(354, 270); 97 | this.btOK.Name = "btOK"; 98 | this.btOK.Size = new System.Drawing.Size(78, 23); 99 | this.btOK.TabIndex = 1; 100 | this.btOK.Text = "OK"; 101 | this.btOK.UseVisualStyleBackColor = true; 102 | // 103 | // lbVersion 104 | // 105 | this.lbVersion.BackColor = System.Drawing.Color.Black; 106 | this.lbVersion.Font = new System.Drawing.Font("Verdana", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); 107 | this.lbVersion.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(164)))), ((int)(((byte)(222)))), ((int)(((byte)(234))))); 108 | this.lbVersion.Location = new System.Drawing.Point(326, 29); 109 | this.lbVersion.Name = "lbVersion"; 110 | this.lbVersion.Size = new System.Drawing.Size(94, 19); 111 | this.lbVersion.TabIndex = 2; 112 | this.lbVersion.Text = "Vx.x.x.x"; 113 | this.lbVersion.TextAlign = System.Drawing.ContentAlignment.MiddleRight; 114 | // 115 | // AboutDialog 116 | // 117 | this.AcceptButton = this.btOK; 118 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None; 119 | this.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("$this.BackgroundImage"))); 120 | this.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch; 121 | this.ClientSize = new System.Drawing.Size(445, 300); 122 | this.Controls.Add(this.lbVersion); 123 | this.Controls.Add(this.btOK); 124 | this.Controls.Add(this.flowLayoutPanel1); 125 | this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog; 126 | this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); 127 | this.MaximizeBox = false; 128 | this.MinimizeBox = false; 129 | this.Name = "AboutDialog"; 130 | this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; 131 | this.Text = "About"; 132 | this.Shown += new System.EventHandler(this.AboutDialog_Shown); 133 | this.flowLayoutPanel1.ResumeLayout(false); 134 | ((System.ComponentModel.ISupportInitialize)(this.bloggerIcon)).EndInit(); 135 | ((System.ComponentModel.ISupportInitialize)(this.facebookIcon)).EndInit(); 136 | ((System.ComponentModel.ISupportInitialize)(this.githubIcon)).EndInit(); 137 | this.ResumeLayout(false); 138 | this.PerformLayout(); 139 | 140 | } 141 | 142 | #endregion 143 | 144 | private System.Windows.Forms.FlowLayoutPanel flowLayoutPanel1; 145 | private System.Windows.Forms.PictureBox bloggerIcon; 146 | private System.Windows.Forms.PictureBox facebookIcon; 147 | private System.Windows.Forms.Button btOK; 148 | private System.Windows.Forms.Label lbVersion; 149 | private PictureBox githubIcon; 150 | } 151 | } -------------------------------------------------------------------------------- /MSChartExtension/AboutDialog.cs: -------------------------------------------------------------------------------- 1 | using System.Diagnostics; 2 | 3 | namespace System.Windows.Forms.DataVisualization.Charting 4 | { 5 | internal partial class AboutDialog : Form 6 | { 7 | public string WebsiteLink { get; set; } 8 | public string FacebookLink { get; set; } 9 | public string GitHubLink { get; set; } 10 | 11 | public AboutDialog(string appName) 12 | { 13 | InitializeComponent(); 14 | Text += " " + appName; 15 | lbVersion.Text = "V" + System.Reflection.Assembly.GetExecutingAssembly().GetName().Version.ToString(); 16 | 17 | //AssemblyName[] assemblyNames = Assembly.GetExecutingAssembly().GetReferencedAssemblies(); 18 | //foreach (AssemblyName assembly in assemblyNames) 19 | //{ 20 | // TbComponents.Rows.Add(new string[] { assembly.Name, assembly.Version.ToString() }); 21 | //} 22 | //TbComponents.Sort(TbComponents.Columns[0], ListSortDirection.Ascending); 23 | } 24 | 25 | private void IconClick(object sender, EventArgs e) 26 | { 27 | if (sender == bloggerIcon) Process.Start(WebsiteLink); 28 | else if (sender == facebookIcon) Process.Start(FacebookLink); 29 | else if (sender == githubIcon) Process.Start(GitHubLink); 30 | } 31 | 32 | private void AboutDialog_Shown(object sender, EventArgs e) 33 | { 34 | bloggerIcon.Visible = !string.IsNullOrEmpty(WebsiteLink); 35 | facebookIcon.Visible = !string.IsNullOrEmpty(FacebookLink); 36 | } 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /MSChartExtension/ChartCursor.cs: -------------------------------------------------------------------------------- 1 | namespace System.Windows.Forms.DataVisualization.Charting 2 | { 3 | /// 4 | /// Chart Cursor Position 5 | /// 6 | public class ChartCursor : ICloneable 7 | { 8 | /// 9 | /// Return 1 for Cursor1 and 2 for Cursor2 10 | /// 11 | public int CursorIndex { get; set; } 12 | /// 13 | /// Data point index, -1 if invalid or not found. 14 | /// 15 | public int DataIndex { get; set; } 16 | /// 17 | /// X Value based on primary Axis 18 | /// 19 | public double X { get; internal set; } = double.NaN; 20 | /// 21 | /// Y Value based on primary Axis 22 | /// 23 | public double Y { get; internal set; } = double.NaN; 24 | /// 25 | /// Return X Value as string based on . 26 | /// 27 | /// 28 | public string XFormattedString { get; internal set; } 29 | /// 30 | /// Return Y Value as string based on 31 | /// 32 | /// 33 | public string YFormattedString { get; internal set; } 34 | 35 | /// 36 | /// ChartArea where the cursor is located. 37 | /// 38 | public ChartArea ChartArea { get; set; } = null; 39 | /// 40 | /// Clone object 41 | /// 42 | /// 43 | public object Clone() 44 | { 45 | return new ChartCursor() 46 | { 47 | X = this.X, 48 | Y = this.Y, 49 | DataIndex = this.DataIndex, 50 | ChartArea = this.ChartArea, 51 | SelectedChartSeries = this.SelectedChartSeries, 52 | CursorIndex = this.CursorIndex, 53 | XFormattedString = this.XFormattedString, 54 | YFormattedString = this.YFormattedString 55 | }; 56 | } 57 | /// 58 | /// Selected Chart Series 59 | /// 60 | public Series SelectedChartSeries { get; set; } = null; 61 | } 62 | 63 | } 64 | -------------------------------------------------------------------------------- /MSChartExtension/ChartCursorLabel.cs: -------------------------------------------------------------------------------- 1 | namespace System.Windows.Forms.DataVisualization.Charting 2 | { 3 | /// 4 | /// Chart cursor label format 5 | /// 6 | public class ChartCursorLabel 7 | { 8 | /// 9 | /// Label value format 10 | /// 11 | /// More details regarding string format at https://docs.microsoft.com/en-us/dotnet/standard/base-types/standard-numeric-format-strings 12 | public string StringFormat { get; set; } 13 | /// 14 | /// Label prefix 15 | /// 16 | public string Prefix { get; set; } 17 | /// 18 | /// Label postfix 19 | /// 20 | public string Postfix { get; set; } 21 | /// 22 | /// Show / hide labels 23 | /// 24 | public bool Visible { get; set; } = true; 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /MSChartExtension/ChartData.cs: -------------------------------------------------------------------------------- 1 | using System.Linq; 2 | using System.Collections.Generic; 3 | 4 | namespace System.Windows.Forms.DataVisualization.Charting 5 | { 6 | /// 7 | /// Data Storage class for 8 | /// 9 | internal class ChartData 10 | { 11 | //Store chart settings. Used to backup and restore chart settings. 12 | 13 | public Chart Source { get; private set; } 14 | public ChartData(Chart sender) 15 | { 16 | Source = sender; 17 | CreateChartContextMenu(); 18 | 19 | int x = sender.ChartAreas.Count; 20 | CursorXUserEnabled = new bool[x]; 21 | CursorYUserEnabled = new bool[x]; 22 | Cursor = new Forms.Cursor[x]; 23 | CursorXInterval = new double[x]; 24 | CursorYInterval = new double[x]; 25 | CursorXAutoScroll = new bool[x]; 26 | CursorYAutoScroll = new bool[x]; 27 | ScrollBarX = new bool[x]; 28 | ScrollBarX2 = new bool[x]; 29 | ScrollBarY = new bool[x]; 30 | ScrollBarY2 = new bool[x]; 31 | ScrollBarXPositionInside = new bool[x]; 32 | ScrollBarX2PositionInside = new bool[x]; 33 | SupportedChartArea = new List(); 34 | 35 | Cursor1 = new ChartCursor() { CursorIndex = 1 }; 36 | Cursor2 = new ChartCursor() { CursorIndex = 2 }; 37 | } 38 | 39 | public MSChartExtensionToolState ToolState { get; set; } 40 | public CursorPositionChanged PositionChangedCallback; 41 | public CursorPositionChanged CursorMovedCallback; 42 | public ZoomChanged ZoomChangedCallback { get; set; } 43 | public ChartOption Option { get; set; } 44 | public List SupportedChartArea { get; set; } 45 | public bool Enabled { get; set; } = true; 46 | public ChartArea ActiveChartArea { get; set; } 47 | /// 48 | /// Some series type have X-Axis on vertical bar. Positioning for these axis should be handle in different way. 49 | /// 50 | internal bool InvertedAxis { get; set; } 51 | public ChartCursor Cursor1 { get; private set; } 52 | public ChartCursor Cursor2 { get; private set; } 53 | public List SeriesData { get; set; } = new List(); 54 | public List ResourceSeries { get; set; } = null; 55 | public List AxisSettings { get; set; } = new List(); 56 | private void CreateChartContextMenu() 57 | { 58 | ChartToolZoomOut = new ToolStripMenuItem("Zoom Out"); 59 | ChartToolZoom = new ToolStripMenuItem("Zoom Window"); 60 | ChartToolZoomX = new ToolStripMenuItem("Zoom XAxis"); 61 | ChartToolZoomY = new ToolStripMenuItem("Zoom YAxis"); 62 | ChartToolZoomDialog = new ToolStripMenuItem("Zoom Dialog..."); 63 | ChartToolPan = new ToolStripMenuItem("Pan"); 64 | ChartToolZoomOutSeparator = new ToolStripSeparator(); 65 | ChartToolSelect = new ToolStripMenuItem("Select - Cursor 1") { Tag = this }; 66 | ChartToolSelect2 = new ToolStripMenuItem("Select - Cursor 2") { Tag = this }; 67 | ChartToolClearCursor = new ToolStripMenuItem("Clear Cursors..."); 68 | AboutSeparator = new ToolStripSeparator() { Name = "AboutMenu" }; 69 | Clear = new ToolStripMenuItem("Clear"); 70 | Settings = new ToolStripMenuItem("Settings..."); 71 | About = new ToolStripMenuItem("About...") { Name = "About" }; 72 | About.Image = Properties.Resources.MSChartExtensionLogo; 73 | 74 | MenuItems = new List 75 | { 76 | ChartToolZoomOut, 77 | ChartToolZoom, 78 | ChartToolZoomX, 79 | ChartToolZoomY, 80 | ChartToolZoomDialog, 81 | ChartToolPan, 82 | ChartToolZoomOutSeparator, 83 | ChartToolSelect, 84 | ChartToolSelect2, 85 | ChartToolClearCursor, 86 | AboutSeparator, 87 | Clear, 88 | Settings, 89 | About 90 | }; 91 | 92 | StateMenu = new Dictionary 93 | { 94 | {MSChartExtensionToolState.Select, ChartToolSelect}, 95 | {MSChartExtensionToolState.Select2, ChartToolSelect2}, 96 | {MSChartExtensionToolState.Pan, ChartToolPan}, 97 | {MSChartExtensionToolState.Zoom, ChartToolZoom}, 98 | {MSChartExtensionToolState.ZoomX, ChartToolZoomX}, 99 | {MSChartExtensionToolState.ZoomY, ChartToolZoomY}, 100 | {MSChartExtensionToolState.ZoomDialog, ChartToolZoomDialog } 101 | 102 | }; 103 | } 104 | 105 | public void ResetAxisSettings(Axis axis) 106 | { 107 | AxisSettings ptrSettings = AxisSettings.FirstOrDefault(n => n.Axis == axis); 108 | ptrSettings?.Restore(); 109 | } 110 | 111 | /// 112 | /// Backtup properties for all Chart Area 113 | /// 114 | public void Backup() 115 | { 116 | ContextMenuStrip = Source.ContextMenuStrip; 117 | AxisSettings.Clear(); 118 | int x = 0; 119 | foreach (ChartArea ptrChartArea in Source.ChartAreas) 120 | { 121 | CursorXUserEnabled[x] = ptrChartArea.CursorX.IsUserEnabled; 122 | CursorYUserEnabled[x] = ptrChartArea.CursorY.IsUserEnabled; 123 | Cursor[x] = Source.Cursor; 124 | CursorXInterval[x] = ptrChartArea.CursorX.Interval; 125 | CursorYInterval[x] = ptrChartArea.CursorY.Interval; 126 | CursorXAutoScroll[x] = ptrChartArea.CursorX.AutoScroll; 127 | CursorYAutoScroll[x] = ptrChartArea.CursorY.AutoScroll; 128 | ScrollBarX[x] = ptrChartArea.AxisX.ScrollBar.Enabled; 129 | ScrollBarX2[x] = ptrChartArea.AxisX2.ScrollBar.Enabled; 130 | ScrollBarY[x] = ptrChartArea.AxisY.ScrollBar.Enabled; 131 | ScrollBarY2[x] = ptrChartArea.AxisY2.ScrollBar.Enabled; 132 | ScrollBarXPositionInside[x] = ptrChartArea.AxisX.ScrollBar.IsPositionedInside; 133 | ScrollBarX2PositionInside[x] = ptrChartArea.AxisX2.ScrollBar.IsPositionedInside; 134 | x++; 135 | 136 | AxisSettings.Add(new AxisSettings(ptrChartArea.AxisX)); 137 | AxisSettings.Add(new AxisSettings(ptrChartArea.AxisY)); 138 | AxisSettings.Add(new AxisSettings(ptrChartArea.AxisX2)); 139 | AxisSettings.Add(new AxisSettings(ptrChartArea.AxisY2)); 140 | } 141 | 142 | foreach (AxisSettings s in AxisSettings) s.Backup(); 143 | } 144 | 145 | /// 146 | /// Restore properties for all Chart Area 147 | /// 148 | public void Restore() 149 | { 150 | Source.ContextMenuStrip = ContextMenuStrip; 151 | int x = 0; 152 | foreach (ChartArea ptrChartArea in Source.ChartAreas) 153 | { 154 | ptrChartArea.CursorX.IsUserEnabled = CursorXUserEnabled[x]; 155 | ptrChartArea.CursorY.IsUserEnabled = CursorYUserEnabled[x]; 156 | Source.Cursor = Cursor[x]; 157 | ptrChartArea.CursorX.Interval = CursorXInterval[x]; 158 | ptrChartArea.CursorY.Interval = CursorYInterval[x]; 159 | ptrChartArea.CursorX.AutoScroll = CursorXAutoScroll[x]; 160 | ptrChartArea.CursorY.AutoScroll = CursorYAutoScroll[x]; 161 | ptrChartArea.AxisX.ScrollBar.Enabled = ScrollBarX[x]; 162 | ptrChartArea.AxisX2.ScrollBar.Enabled = ScrollBarX2[x]; 163 | ptrChartArea.AxisY.ScrollBar.Enabled = ScrollBarY[x]; 164 | ptrChartArea.AxisY2.ScrollBar.Enabled = ScrollBarY2[x]; 165 | ptrChartArea.AxisX.ScrollBar.IsPositionedInside = ScrollBarXPositionInside[x]; 166 | ptrChartArea.AxisX2.ScrollBar.IsPositionedInside = ScrollBarX2PositionInside[x]; 167 | x++; 168 | } 169 | foreach (AxisSettings s in AxisSettings) s.Restore(); 170 | } 171 | public void UncheckAllMenuItems() 172 | { 173 | foreach (ToolStripMenuItem ptrItem in StateMenu.Values) ptrItem.Checked = false; 174 | } 175 | public void UpdateState() 176 | { 177 | UncheckAllMenuItems(); 178 | StateMenu[ToolState].Checked = true; 179 | } 180 | 181 | #region [ Backup Data ] 182 | 183 | public ContextMenuStrip ContextMenuStrip { get; set; } 184 | private readonly bool[] CursorXUserEnabled; 185 | private readonly bool[] CursorYUserEnabled; 186 | private readonly Forms.Cursor[] Cursor; 187 | private readonly double[] CursorXInterval, CursorYInterval; 188 | private readonly bool[] CursorXAutoScroll, CursorYAutoScroll; 189 | private readonly bool[] ScrollBarX, ScrollBarX2, ScrollBarY, ScrollBarY2; 190 | private readonly bool[] ScrollBarXPositionInside, ScrollBarX2PositionInside; 191 | 192 | #endregion 193 | 194 | #region [ Extended Context Menu ] 195 | 196 | public List MenuItems { get; private set; } 197 | public ToolStripMenuItem ChartToolSelect { get; private set; } 198 | public ToolStripMenuItem ChartToolSelect2 { get; private set; } 199 | public ToolStripMenuItem ChartToolClearCursor { get; private set; } 200 | public ToolStripMenuItem ChartToolZoom { get; private set; } 201 | public ToolStripMenuItem ChartToolZoomX { get; private set; } 202 | public ToolStripMenuItem ChartToolZoomY { get; private set; } 203 | public ToolStripMenuItem ChartToolZoomDialog { get; private set; } 204 | public ToolStripMenuItem ChartToolPan { get; private set; } 205 | public ToolStripMenuItem ChartToolZoomOut { get; private set; } 206 | public ToolStripSeparator ChartToolZoomOutSeparator { get; private set; } 207 | public ToolStripSeparator ChartContextSeparator { get; private set; } 208 | public ToolStripSeparator AboutSeparator { get; private set; } 209 | public ToolStripMenuItem Clear { get; private set; } 210 | public ToolStripMenuItem Settings { get; private set; } 211 | public ToolStripMenuItem About { get; private set; } 212 | private Dictionary StateMenu; 213 | 214 | #endregion 215 | 216 | } 217 | 218 | internal class AxisSettings 219 | { 220 | public Axis Axis { get; private set; } 221 | 222 | public double Interval { get; set; } 223 | public IntervalAutoMode IntervalAutoMode { get; set; } 224 | public double IntervalOffset { get; set; } 225 | public DateTimeIntervalType IntervalOffsetType { get; set; } 226 | public double MajorTickMarkOffset { get; set; } 227 | public double MinorTickMarkOffset { get; set; } 228 | 229 | public AxisSettings(Axis axis) 230 | { 231 | Axis = axis; 232 | Backup(); 233 | } 234 | 235 | public void Backup() 236 | { 237 | Interval = Axis.Interval; 238 | IntervalAutoMode = Axis.IntervalAutoMode; 239 | IntervalOffset = Axis.IntervalOffset; 240 | IntervalOffsetType = Axis.IntervalOffsetType; 241 | MajorTickMarkOffset = Axis.MajorTickMark.IntervalOffset; 242 | MinorTickMarkOffset = Axis.MinorTickMark.IntervalOffset; 243 | } 244 | 245 | public void Restore() 246 | { 247 | Axis.Interval = Interval; 248 | Axis.IntervalAutoMode = IntervalAutoMode; 249 | Axis.IntervalOffset = IntervalOffset; 250 | Axis.IntervalOffsetType = IntervalOffsetType; 251 | Axis.MajorTickMark.IntervalOffset = MajorTickMarkOffset; 252 | Axis.MinorTickMark.IntervalOffset = MinorTickMarkOffset; 253 | } 254 | } 255 | 256 | } 257 | -------------------------------------------------------------------------------- /MSChartExtension/ChartOption.cs: -------------------------------------------------------------------------------- 1 | using System.Drawing; 2 | 3 | namespace System.Windows.Forms.DataVisualization.Charting 4 | { 5 | /// 6 | /// Configuration options for 7 | /// 8 | [Serializable] 9 | public class ChartOption 10 | { 11 | /// 12 | /// Enable / Disable controls in ContextMenu to show / hide series 13 | /// 14 | public bool ContextMenuAllowToHideSeries { get; set; } = true; 15 | /// 16 | /// Round value on XAxis to number of decimal place 17 | /// 18 | public int XAxisPrecision { get; set; } = -1; 19 | /// 20 | /// Round value on YAxis to number of decimal place 21 | /// 22 | public int YAxisPrecision { get; set; } = -1; 23 | /// 24 | /// Cursor 1 Color, default is 25 | /// 26 | public Color Cursor1Color { get; set; } = Color.Red; 27 | /// 28 | /// Cursor 1 text color, default is 29 | /// 30 | public Color Cursor1TextColor { get; set; } = Color.White; 31 | /// 32 | /// Cursor 2 Color, default is 33 | /// 34 | public Color Cursor2Color { get; set; } = Color.Green; 35 | /// 36 | /// Cursor 2 text color, default is 37 | /// 38 | public Color Cursor2TextColor { get; set; } = Color.White; 39 | /// 40 | /// Cursor 1 Dash Style, default is 41 | /// 42 | public ChartDashStyle Cursor1DashStyle { get; set; } = ChartDashStyle.Dash; 43 | /// 44 | /// Cursor 2 Dash Style, default is 45 | /// 46 | public ChartDashStyle Cursor2DashStyle { get; set; } = ChartDashStyle.Dash; 47 | /// 48 | /// Cursor 1 Line Width, default = 1 49 | /// 50 | public int Cursor1LineWidth { get; set; } = 1; 51 | /// 52 | /// Cursor 2 Line Width, default = 1 53 | /// 54 | public int Cursor2LineWidth { get; set; } = 1; 55 | /// 56 | /// Enable / Disable snap cursor to nearest data points. 57 | /// This feature is enabled by default. 58 | /// 59 | public bool SnapCursorToData { get; set; } = true; 60 | 61 | /// 62 | /// Label format for X1 63 | /// 64 | public ChartCursorLabel CursorLabelFormatX1 { get; set; } = new ChartCursorLabel(); 65 | /// 66 | /// Label format for X2 67 | /// 68 | public ChartCursorLabel CursorLabelFormatX2 { get; set; } = new ChartCursorLabel(); 69 | /// 70 | /// Label format for Y1 71 | /// 72 | public ChartCursorLabel CursorLabelFormatY1 { get; set; } = new ChartCursorLabel(); 73 | /// 74 | /// Label format for Y2 75 | /// 76 | public ChartCursorLabel CursorLabelFormatY2 { get; set; } = new ChartCursorLabel(); 77 | 78 | /// 79 | /// Display cursor value on chart 80 | /// 81 | public bool ShowCursorValue { get; set; } = true; 82 | /// 83 | /// 84 | /// 85 | public ThemeBase Theme { get; set; } = null; 86 | 87 | /// 88 | /// Virtual Display Mode 89 | /// 90 | public bool BufferedMode { get; set; } = false; 91 | /// 92 | /// Number of data to display in 93 | /// Minimum value is 10. Default Value is 500 94 | /// 95 | public int DisplayDataSize 96 | { 97 | get => DispDataSize; set 98 | { 99 | DispDataSize = value; 100 | if (DispDataSize < 10) DispDataSize = 10; 101 | } 102 | } 103 | private int DispDataSize = 1000; 104 | } 105 | 106 | } 107 | -------------------------------------------------------------------------------- /MSChartExtension/ConfigurationDialog.cs: -------------------------------------------------------------------------------- 1 | using System.Drawing; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | 5 | namespace System.Windows.Forms.DataVisualization.Charting 6 | { 7 | internal partial class ConfigurationDialog : Form 8 | { 9 | private readonly Dictionary Themes; 10 | 11 | public ChartOption Option { get; private set; } 12 | 13 | private Chart ChartHandler { get; set; } 14 | 15 | private int ThemeIndex; 16 | 17 | public ConfigurationDialog(Chart chart, ChartOption chartOption) 18 | { 19 | InitializeComponent(); 20 | 21 | ChartHandler = chart; 22 | Option = chartOption; 23 | //Create List of Dash Style, skip NOTSET option. 24 | cbCursor1DashStyle.Items.AddRange(Enum.GetNames(typeof(ChartDashStyle)).Skip(1).ToArray()); 25 | cbCursor2DashStyle.Items.AddRange(Enum.GetNames(typeof(ChartDashStyle)).Skip(1).ToArray()); 26 | 27 | Text = chart.Name + " Settings"; 28 | if (chart.Titles.Count > 0) 29 | { 30 | string chartTitle = chart.Titles.Where(n => !string.IsNullOrEmpty(n.Text)).Select(d => d.Text).FirstOrDefault(); 31 | if (!string.IsNullOrEmpty(chartTitle)) Text = chartTitle + " Settings"; 32 | } 33 | 34 | Themes = ThemeManager.GetThemes(); 35 | cbTheme.Items.Clear(); 36 | cbTheme.Items.AddRange(Themes.Keys.ToArray()); 37 | 38 | ReadSettings(); 39 | 40 | SeriesGrid.Rows.Clear(); 41 | foreach (Series series in chart.Series) 42 | { 43 | int rowID = SeriesGrid.Rows.Add(new object[] { series.Enabled, series.Name, "", ">>" }); 44 | SeriesGrid.Rows[rowID].Cells[colSeriesColor.Index].Style.BackColor = series.Color; 45 | SeriesGrid.Rows[rowID].Tag = series; 46 | } 47 | } 48 | 49 | private void ReadSettings() 50 | { 51 | btCursor1TextColor.BackColor = Option.Cursor1TextColor; 52 | btCursor2TextColor.BackColor = Option.Cursor2TextColor; 53 | btCursor1Color.BackColor = Option.Cursor1Color; 54 | btCursor2Color.BackColor = Option.Cursor2Color; 55 | cursor1LineWidth.Text = Option.Cursor1LineWidth.ToString(); 56 | cursor2LineWidth.Text = Option.Cursor2LineWidth.ToString(); 57 | chkAllowToHideSeries.Checked = Option.ContextMenuAllowToHideSeries; 58 | chkShowCursorValue.Checked = Option.ShowCursorValue; 59 | cbCursor1DashStyle.SelectedIndex = (int)Option.Cursor1DashStyle - 1; 60 | cbCursor2DashStyle.SelectedIndex = (int)Option.Cursor2DashStyle - 1; 61 | 62 | LabelFormatX1.SetContent(Option.CursorLabelFormatX1); 63 | LabelFormatX2.SetContent(Option.CursorLabelFormatX2); 64 | LabelFormatY1.SetContent(Option.CursorLabelFormatY1); 65 | LabelFormatY2.SetContent(Option.CursorLabelFormatY2); 66 | 67 | 68 | if (Option.Theme == null) cbTheme.SelectedIndex = ThemeIndex = -1; 69 | else { ThemeIndex = cbTheme.SelectedIndex = cbTheme.Items.IndexOf(Option.Theme.Name); } 70 | } 71 | 72 | private void WriteSettings() 73 | { 74 | Option.Cursor1TextColor = btCursor1TextColor.BackColor; 75 | Option.Cursor2TextColor = btCursor2TextColor.BackColor; 76 | Option.Cursor1Color = btCursor1Color.BackColor; 77 | Option.Cursor2Color = btCursor2Color.BackColor; 78 | Option.Cursor1LineWidth = Convert.ToInt32(cursor1LineWidth.Text); 79 | Option.Cursor2LineWidth = Convert.ToInt32(cursor2LineWidth.Text); 80 | Option.ContextMenuAllowToHideSeries = chkAllowToHideSeries.Checked; 81 | Option.ShowCursorValue = chkShowCursorValue.Checked; 82 | Option.Cursor1DashStyle = (ChartDashStyle)(cbCursor1DashStyle.SelectedIndex + 1); 83 | Option.Cursor2DashStyle = (ChartDashStyle)(cbCursor2DashStyle.SelectedIndex + 1); 84 | 85 | Option.CursorLabelFormatX1 = LabelFormatX1.GetLabelContent(); 86 | Option.CursorLabelFormatX2 = LabelFormatX2.GetLabelContent(); 87 | Option.CursorLabelFormatY1 = LabelFormatY1.GetLabelContent(); 88 | Option.CursorLabelFormatY2 = LabelFormatY2.GetLabelContent(); 89 | 90 | if (cbTheme.SelectedIndex != ThemeIndex) Option.Theme = Themes[cbTheme.Text]; 91 | } 92 | 93 | private Color PickColor(Color color) 94 | { 95 | using (ColorDialog dialog = new ColorDialog()) 96 | { 97 | dialog.Color = color; 98 | if (dialog.ShowDialog() == DialogResult.OK) return dialog.Color; 99 | return color; 100 | } 101 | } 102 | 103 | 104 | private void BtCursor1Color_Click(object sender, EventArgs e) 105 | { 106 | btCursor1Color.BackColor = PickColor(btCursor1Color.BackColor); 107 | } 108 | private void btCursor1TextColor_Click(object sender, EventArgs e) 109 | { 110 | btCursor1TextColor.BackColor = PickColor(btCursor1TextColor.BackColor); 111 | } 112 | 113 | 114 | private void BtCursor2Color_Click(object sender, EventArgs e) 115 | { 116 | btCursor2Color.BackColor = PickColor(btCursor2Color.BackColor); 117 | } 118 | 119 | private void btCursor2TextColor_Click(object sender, EventArgs e) 120 | { 121 | btCursor2TextColor.BackColor = PickColor(btCursor2TextColor.BackColor); 122 | } 123 | 124 | private void UpdateSeriesSettings() 125 | { 126 | foreach (DataGridViewRow r in SeriesGrid.Rows) 127 | { 128 | Series ptrSeries = r.Tag as Series; 129 | ptrSeries.Enabled = Convert.ToBoolean(r.Cells[colSeriesEnable.Index].Value); 130 | ptrSeries.MarkerBorderColor = ptrSeries.MarkerColor = ptrSeries.Color = r.Cells[colSeriesColor.Index].Style.BackColor; 131 | } 132 | } 133 | 134 | private void BtOK_Click(object sender, EventArgs e) 135 | { 136 | WriteSettings(); 137 | UpdateSeriesSettings(); 138 | } 139 | 140 | private void ChkAllowToHideSeries_CheckedChanged(object sender, EventArgs e) 141 | { 142 | SeriesGrid.Enabled = chkAllowToHideSeries.Enabled; 143 | } 144 | 145 | private void BtCheckAll_Click(object sender, EventArgs e) 146 | { 147 | for (int x = 0; x < SeriesGrid.Rows.Count; x++) (SeriesGrid.Rows[x].Cells[colSeriesEnable.Index] as DataGridViewCheckBoxCell).Value = true; 148 | } 149 | 150 | private void BtCheckNone_Click(object sender, EventArgs e) 151 | { 152 | for (int x = 0; x < SeriesGrid.Rows.Count; x++) (SeriesGrid.Rows[x].Cells[colSeriesEnable.Index] as DataGridViewCheckBoxCell).Value = false; 153 | } 154 | 155 | private void SeriesGrid_CellContentClick(object sender, DataGridViewCellEventArgs e) 156 | { 157 | if (e.ColumnIndex == colSelectColor.Index) 158 | { 159 | DataGridViewCell ptrCell = SeriesGrid.Rows[e.RowIndex].Cells[e.ColumnIndex - 1]; 160 | ptrCell.Style.BackColor = PickColor(ptrCell.Style.BackColor); 161 | } 162 | } 163 | 164 | private void SeriesGrid_SelectionChanged(object sender, EventArgs e) 165 | { 166 | SeriesGrid.ClearSelection(); 167 | } 168 | 169 | } 170 | } 171 | -------------------------------------------------------------------------------- /MSChartExtension/ConfigurationDialog.resx: -------------------------------------------------------------------------------- 1 |  2 | 3 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | text/microsoft-resx 110 | 111 | 112 | 2.0 113 | 114 | 115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 116 | 117 | 118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 119 | 120 | 121 | True 122 | 123 | 124 | True 125 | 126 | 127 | True 128 | 129 | 130 | True 131 | 132 | -------------------------------------------------------------------------------- /MSChartExtension/DataPointCollectionExtension.cs: -------------------------------------------------------------------------------- 1 | namespace System.Windows.Forms.DataVisualization.Charting 2 | { 3 | /// 4 | /// DataPointCollection Extension 5 | /// 6 | public static class DataPointCollectionExtension 7 | { 8 | /// 9 | /// Add a to object and assign object to Tag properties. 10 | /// 11 | /// 12 | /// 13 | /// 14 | /// 15 | /// 16 | public static DataPoint AddXYWithObject(this DataPointCollection sender, object dataObject, object xValues, params object[] yValues) 17 | { 18 | int i = sender.AddXY(xValues, yValues); 19 | DataPoint p = sender[i]; 20 | p.Tag = dataObject; 21 | return p; 22 | } 23 | 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /MSChartExtension/DownSampling.cs: -------------------------------------------------------------------------------- 1 | using System.Diagnostics; 2 | 3 | namespace System.Windows.Forms.DataVisualization.Charting 4 | { 5 | internal static class DownSampling 6 | { 7 | internal static PointD[] DownsampleLTTB(PointD[] array, int length, bool dynamicX = true) 8 | { 9 | //Sanity Check 10 | if (array == null) return null; 11 | if (array.Length < length) return array; 12 | if (length < 2) return array; 13 | 14 | //Largest-Triangle-Three Bucket Downsampling 15 | //Technical Reference: https://github.com/sveinn-steinarsson/highcharts-downsample 16 | //Code Reference: https://gist.github.com/adrianseeley/264417d295ccd006e7fd 17 | //Implementation: https://www.codearteng.com/2020/08/implementation-of-downsampling.html 18 | 19 | //With dynamicX, Actual data size returned might be less, Handle data point with no data by not returning 0,0. Use Dynamic List 20 | PointD[] window = new PointD[length]; 21 | int w = 0; 22 | int data_size_less_start_and_end = length - 2; 23 | 24 | double bucket_size = (double)(array.Length - 2) / data_size_less_start_and_end; 25 | int a = 0; 26 | int next_a = 0; 27 | PointD max_area_point = new PointD(); 28 | window[w++] = array[a]; // Always add the first point 29 | 30 | int start = 0, end = 0; 31 | int bucket_start = 1, bucket_end = 1; 32 | 33 | //Dynamic X Parameters (For data points where X incremental is not constant) 34 | double xStart = (array[1].X + array[0].X) / 2; //Mid X point for first 2 points 35 | double xEnd = (array[array.Length - 1].X + array[array.Length - 2].X) / 2; //Mid X point for last 2 points 36 | double bucketSizeX = (xEnd - xStart) / data_size_less_start_and_end; //Calculate bucket X width exclude first and last points 37 | double bucketBoundary = xStart + bucketSizeX; //Next bucket boundary 38 | 39 | if (dynamicX) 40 | { 41 | while (array[bucket_end].X < bucketBoundary) 42 | { 43 | bucket_end++; 44 | } 45 | } 46 | else 47 | { 48 | bucket_end = (int)(Math.Floor(bucket_size) + 1); //End index of current bucket 49 | } 50 | //Debug.WriteLine("Bucket Start: " + bucket_start + ", " + bucket_end); 51 | 52 | for (int i = 0; i < data_size_less_start_and_end; i++) 53 | { 54 | // Calculate point average for next bucket (containing c) 55 | double avg_x = 0; 56 | double avg_y = 0; 57 | if (dynamicX) 58 | { 59 | while (array[start].X < bucketBoundary) 60 | { 61 | start++; 62 | if (start == array.Length) break; 63 | } 64 | bucketBoundary += bucketSizeX; 65 | end = start; 66 | if (end <= (array.Length - 1)) //Prevent buffer overrun 67 | { 68 | while (array[end].X < bucketBoundary) 69 | { 70 | end++; 71 | if (end == array.Length) break; 72 | } 73 | } 74 | } 75 | else 76 | { 77 | //Get bucket data, assume x increased with fixed interval 78 | start = (int)(Math.Floor((i + 1) * bucket_size) + 1); //Start index of next bucket 79 | end = (int)(Math.Floor((i + 2) * bucket_size) + 1); //End index of next bucket 80 | } 81 | 82 | if (end >= array.Length) //Prevent index overrun 83 | { 84 | end = array.Length; 85 | } 86 | 87 | int span = end - start; //Span = number of data points in next bucket 88 | //Debug.WriteLine("Bucket " + i + ": " + start + ", " + end + " : " + span); 89 | 90 | if (span <= 0) continue; //Skip empty bucket 91 | else 92 | { 93 | for (int m = start; m < end; m++) 94 | { 95 | avg_x += m; 96 | avg_y += array[m].Y; 97 | } 98 | avg_x /= span; //Average X Value 99 | avg_y /= span; //Average Y Value 100 | 101 | // Point a (Reference data point of previous bucket) 102 | double a_x = a; 103 | double a_y = array[a].Y; 104 | 105 | double max_area = double.MinValue; 106 | for (int n = bucket_start; n < bucket_end; n++) 107 | { 108 | // Calculate triangle area over three buckets 109 | // Optimization - Rectange and Triangle area return same result, removed multiplication of 0.5 110 | double area = Math.Abs((a_x - avg_x) * (array[n].Y - a_y) - (a_x - n) * (avg_y - a_y)); 111 | if (area > max_area) 112 | { 113 | max_area = area; 114 | max_area_point = array[n]; 115 | next_a = n; // Next a is this b 116 | } 117 | } 118 | // Pick this point from the Bucket 119 | window[w++] = max_area_point; 120 | } 121 | 122 | // Current a becomes the next_a (chosen b) 123 | a = next_a; 124 | 125 | //Move on to next bucket 126 | bucket_start = start; 127 | bucket_end = end; 128 | start = end; 129 | if (end >= array.Length) break; 130 | } 131 | 132 | window[w++] = array[array.Length - 1]; // Always add last 133 | if (w < length) 134 | { 135 | //Resize array in case total length is less 136 | Array.Resize(ref window, w); 137 | Debug.WriteLine("Actual window size = " + w); 138 | } 139 | return window; 140 | } 141 | } 142 | } 143 | -------------------------------------------------------------------------------- /MSChartExtension/Extensions.cs: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2009 by John Mertus 3 | // 4 | // John Mertus 5 | // 10/31/2009 9:30:22 AM 6 | // 7 | 8 | namespace EventHandlerSupport 9 | { 10 | using System; 11 | using System.ComponentModel; 12 | using System.Linq; 13 | using System.Reflection; 14 | using System.Windows.Forms; 15 | 16 | /// 17 | /// This is a set of extensions for accessing the Event Handlers as well as cloning menu items 18 | /// 19 | public static class Extensions 20 | { 21 | ////////////////////////////////////////////////// 22 | // Private static fields 23 | ////////////////////////////////////////////////// 24 | #region Public static methods 25 | 26 | /// 27 | /// This contains a counter to help make names unique 28 | /// 29 | private static int menuNameCounter; 30 | 31 | #endregion 32 | 33 | ////////////////////////////////////////////////// 34 | // Public static methods 35 | ////////////////////////////////////////////////// 36 | #region Public static methods 37 | 38 | /// 39 | /// Clones the specified source tool strip menu item. 40 | /// 41 | /// The source tool strip menu item. 42 | /// A cloned version of the toolstrip menu item 43 | public static ToolStripMenuItem Clone(this ToolStripMenuItem sourceToolStripMenuItem) 44 | { 45 | ToolStripMenuItem menuItem = new ToolStripMenuItem(); 46 | 47 | var propInfoList = from p in typeof(ToolStripMenuItem).GetProperties() 48 | let attributes = p.GetCustomAttributes(true) 49 | let notBrowseable = (from a in attributes 50 | where a.GetType() == typeof(BrowsableAttribute) 51 | select !(a as BrowsableAttribute).Browsable).FirstOrDefault() 52 | where !notBrowseable && p.CanRead && p.CanWrite && p.Name != "DropDown" 53 | orderby p.Name 54 | select p; 55 | 56 | // Copy over using reflections 57 | foreach (var propertyInfo in propInfoList) 58 | { 59 | object propertyInfoValue = propertyInfo.GetValue(sourceToolStripMenuItem, null); 60 | propertyInfo.SetValue(menuItem, propertyInfoValue, null); 61 | } 62 | 63 | // Create a new menu name 64 | menuItem.Name = sourceToolStripMenuItem.Name + "-" + menuNameCounter++; 65 | 66 | // Process any other properties 67 | if (sourceToolStripMenuItem.ImageIndex != -1) 68 | { 69 | menuItem.ImageIndex = sourceToolStripMenuItem.ImageIndex; 70 | } 71 | 72 | if (!string.IsNullOrEmpty(sourceToolStripMenuItem.ImageKey)) 73 | { 74 | menuItem.ImageKey = sourceToolStripMenuItem.ImageKey; 75 | } 76 | 77 | // We need to make this visible 78 | menuItem.Visible = true; 79 | 80 | // Recursively clone the drop down list 81 | foreach (var item in sourceToolStripMenuItem.DropDownItems) 82 | { 83 | ToolStripItem newItem; 84 | if (item is ToolStripMenuItem) 85 | { 86 | newItem = ((ToolStripMenuItem)item).Clone(); 87 | } 88 | else if (item is ToolStripSeparator) 89 | { 90 | newItem = new ToolStripSeparator(); 91 | } 92 | else 93 | { 94 | throw new NotImplementedException("Menu item is not a ToolStripMenuItem or a ToolStripSeparatorr"); 95 | } 96 | 97 | menuItem.DropDownItems.Add(newItem); 98 | } 99 | 100 | // The handler list starts empty because we created its parent via a new 101 | // So this is equivalen to a copy. 102 | menuItem.AddHandlers(sourceToolStripMenuItem); 103 | 104 | return menuItem; 105 | } 106 | 107 | /// 108 | /// Adds the handlers from the source component to the destination component 109 | /// 110 | /// An IComponent type 111 | /// The destination component. 112 | /// The source component. 113 | public static void AddHandlers(this T destinationComponent, T sourceComponent) where T : IComponent 114 | { 115 | // If there are other handlers, they will not be erased 116 | var destEventHandlerList = destinationComponent.GetEventHandlerList(); 117 | var sourceEventHandlerList = sourceComponent.GetEventHandlerList(); 118 | 119 | destEventHandlerList.AddHandlers(sourceEventHandlerList); 120 | } 121 | 122 | /// 123 | /// Gets the event handler list from a component 124 | /// 125 | /// The source component. 126 | /// The EventHanderList or null if none 127 | public static EventHandlerList GetEventHandlerList(this IComponent component) 128 | { 129 | var eventsInfo = component.GetType().GetProperty("Events", BindingFlags.Instance | BindingFlags.NonPublic); 130 | return (EventHandlerList)eventsInfo.GetValue(component, null); 131 | } 132 | 133 | #endregion 134 | 135 | ////////////////////////////////////////////////// 136 | // Private static methods 137 | ////////////////////////////////////////////////// 138 | } 139 | } 140 | -------------------------------------------------------------------------------- /MSChartExtension/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2016 Code Artist 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /MSChartExtension/LabelFormatControl.Designer.cs: -------------------------------------------------------------------------------- 1 | namespace System.Windows.Forms.DataVisualization.Charting 2 | { 3 | partial class LabelFormatControl 4 | { 5 | /// 6 | /// Required designer variable. 7 | /// 8 | private System.ComponentModel.IContainer components = null; 9 | 10 | /// 11 | /// Clean up any resources being used. 12 | /// 13 | /// true if managed resources should be disposed; otherwise, false. 14 | protected override void Dispose(bool disposing) 15 | { 16 | if (disposing && (components != null)) 17 | { 18 | components.Dispose(); 19 | } 20 | base.Dispose(disposing); 21 | } 22 | 23 | #region Component Designer generated code 24 | 25 | /// 26 | /// Required method for Designer support - do not modify 27 | /// the contents of this method with the code editor. 28 | /// 29 | private void InitializeComponent() 30 | { 31 | this.chkVisible = new System.Windows.Forms.CheckBox(); 32 | this.LbName = new System.Windows.Forms.Label(); 33 | this.txtPrefix = new System.Windows.Forms.TextBox(); 34 | this.txtFormat = new System.Windows.Forms.TextBox(); 35 | this.txtPostfix = new System.Windows.Forms.TextBox(); 36 | this.SuspendLayout(); 37 | // 38 | // chkVisible 39 | // 40 | this.chkVisible.AutoSize = true; 41 | this.chkVisible.Location = new System.Drawing.Point(239, 6); 42 | this.chkVisible.Name = "chkVisible"; 43 | this.chkVisible.Size = new System.Drawing.Size(56, 17); 44 | this.chkVisible.TabIndex = 0; 45 | this.chkVisible.Text = "Visible"; 46 | this.chkVisible.UseVisualStyleBackColor = true; 47 | // 48 | // LbName 49 | // 50 | this.LbName.AutoSize = true; 51 | this.LbName.Location = new System.Drawing.Point(3, 6); 52 | this.LbName.Name = "LbName"; 53 | this.LbName.Size = new System.Drawing.Size(20, 13); 54 | this.LbName.TabIndex = 1; 55 | this.LbName.Text = "X1"; 56 | // 57 | // txtPrefix 58 | // 59 | this.txtPrefix.Location = new System.Drawing.Point(29, 3); 60 | this.txtPrefix.Name = "txtPrefix"; 61 | this.txtPrefix.Size = new System.Drawing.Size(46, 20); 62 | this.txtPrefix.TabIndex = 3; 63 | // 64 | // txtFormat 65 | // 66 | this.txtFormat.Location = new System.Drawing.Point(78, 3); 67 | this.txtFormat.Name = "txtFormat"; 68 | this.txtFormat.Size = new System.Drawing.Size(106, 20); 69 | this.txtFormat.TabIndex = 4; 70 | // 71 | // txtPostfix 72 | // 73 | this.txtPostfix.Location = new System.Drawing.Point(187, 3); 74 | this.txtPostfix.Name = "txtPostfix"; 75 | this.txtPostfix.Size = new System.Drawing.Size(46, 20); 76 | this.txtPostfix.TabIndex = 5; 77 | // 78 | // LabelFormatControl 79 | // 80 | this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); 81 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; 82 | this.AutoSize = true; 83 | this.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink; 84 | this.Controls.Add(this.txtPostfix); 85 | this.Controls.Add(this.txtFormat); 86 | this.Controls.Add(this.txtPrefix); 87 | this.Controls.Add(this.LbName); 88 | this.Controls.Add(this.chkVisible); 89 | this.Name = "LabelFormatControl"; 90 | this.Size = new System.Drawing.Size(298, 23); 91 | this.ResumeLayout(false); 92 | this.PerformLayout(); 93 | 94 | } 95 | 96 | #endregion 97 | 98 | private CheckBox chkVisible; 99 | private Label LbName; 100 | private TextBox txtPrefix; 101 | private TextBox txtFormat; 102 | private TextBox txtPostfix; 103 | } 104 | } 105 | -------------------------------------------------------------------------------- /MSChartExtension/LabelFormatControl.cs: -------------------------------------------------------------------------------- 1 | namespace System.Windows.Forms.DataVisualization.Charting 2 | { 3 | internal partial class LabelFormatControl : UserControl 4 | { 5 | public LabelFormatControl() 6 | { 7 | InitializeComponent(); 8 | } 9 | 10 | public string LabelName { get => LbName.Text; set => LbName.Text = value; } 11 | 12 | public void SetContent(ChartCursorLabel sender) 13 | { 14 | txtPrefix.Text = sender.Prefix; 15 | txtFormat.Text = sender.StringFormat; 16 | txtPostfix.Text = sender.Postfix; 17 | chkVisible.Checked = sender.Visible; 18 | } 19 | 20 | public ChartCursorLabel GetLabelContent() 21 | { 22 | ChartCursorLabel result = new ChartCursorLabel(); 23 | result.Prefix = txtPrefix.Text; 24 | result.StringFormat = txtFormat.Text; 25 | result.Postfix = txtPostfix.Text; 26 | result.Visible = chkVisible.Checked; 27 | return result; 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /MSChartExtension/LabelFormatControl.resx: -------------------------------------------------------------------------------- 1 |  2 | 3 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | text/microsoft-resx 110 | 111 | 112 | 2.0 113 | 114 | 115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 116 | 117 | 118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 119 | 120 | -------------------------------------------------------------------------------- /MSChartExtension/MSChartExtension.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | Debug 5 | AnyCPU 6 | 8.0.30703 7 | 2.0 8 | {D865F90F-8498-4D31-BEAF-21A7D5EA0212} 9 | Library 10 | Properties 11 | System.Windows.Forms.DataVisualization.Charting 12 | System.Windows.Forms.DataVisualization.MSChartExtension 13 | v4.5.2 14 | 512 15 | 16 | 17 | 18 | 19 | 20 | true 21 | full 22 | false 23 | bin\Debug\ 24 | DEBUG;TRACE 25 | prompt 26 | 4 27 | bin\Debug\System.Windows.Forms.DataVisualization.MSChartExtension.XML 28 | MSChartExtension.ruleset 29 | false 30 | 31 | 32 | pdbonly 33 | true 34 | bin\Release\ 35 | TRACE 36 | prompt 37 | 4 38 | bin\Release\System.Windows.Forms.DataVisualization.MSChartExtension.XML 39 | MSChartExtension.ruleset 40 | false 41 | 42 | 43 | MSChartExtensionLogo.ico 44 | 45 | 46 | 47 | True 48 | 49 | 50 | ..\packages\CodeArtEng.Extensions.2.5.2\lib\net452\CodeArtEng.Extensions.dll 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | Form 67 | 68 | 69 | AboutDialog.cs 70 | 71 | 72 | 73 | 74 | 75 | 76 | Form 77 | 78 | 79 | ConfigurationDialog.cs 80 | 81 | 82 | 83 | 84 | UserControl 85 | 86 | 87 | LabelFormatControl.cs 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | Form 97 | 98 | 99 | MSChartExtensionZoomDialog.cs 100 | 101 | 102 | 103 | True 104 | True 105 | Resources.resx 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | AboutDialog.cs 116 | 117 | 118 | ConfigurationDialog.cs 119 | 120 | 121 | LabelFormatControl.cs 122 | 123 | 124 | MSChartExtensionZoomDialog.cs 125 | 126 | 127 | ResXFileCodeGenerator 128 | Resources.Designer.cs 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. 156 | 157 | 158 | 159 | 160 | del *.nupkg 161 | 162 | 169 | -------------------------------------------------------------------------------- /MSChartExtension/MSChartExtension.csproj.user: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | ProjectFiles 5 | 6 | -------------------------------------------------------------------------------- /MSChartExtension/MSChartExtension.ruleset: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /MSChartExtension/MSChartExtensionLogo.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Code-Artist/MSChartExtension/d1ebcd615adaf418cd4d236203f22b2ce6b795ef/MSChartExtension/MSChartExtensionLogo.ico -------------------------------------------------------------------------------- /MSChartExtension/MSChartExtensionZoomDialog.Designer.cs: -------------------------------------------------------------------------------- 1 | namespace System.Windows.Forms.DataVisualization.Charting 2 | { 3 | partial class MSChartExtensionZoomDialog 4 | { 5 | /// 6 | /// Required designer variable. 7 | /// 8 | private System.ComponentModel.IContainer components = null; 9 | 10 | /// 11 | /// Clean up any resources being used. 12 | /// 13 | /// true if managed resources should be disposed; otherwise, false. 14 | protected override void Dispose(bool disposing) 15 | { 16 | if (disposing && (components != null)) 17 | { 18 | components.Dispose(); 19 | } 20 | base.Dispose(disposing); 21 | } 22 | 23 | #region Windows Form Designer generated code 24 | 25 | /// 26 | /// Required method for Designer support - do not modify 27 | /// the contents of this method with the code editor. 28 | /// 29 | private void InitializeComponent() 30 | { 31 | this.txtXMin = new System.Windows.Forms.TextBox(); 32 | this.label1 = new System.Windows.Forms.Label(); 33 | this.label2 = new System.Windows.Forms.Label(); 34 | this.txtYMin = new System.Windows.Forms.TextBox(); 35 | this.txtYMax = new System.Windows.Forms.TextBox(); 36 | this.txtXMax = new System.Windows.Forms.TextBox(); 37 | this.label3 = new System.Windows.Forms.Label(); 38 | this.label4 = new System.Windows.Forms.Label(); 39 | this.txtXLimit = new System.Windows.Forms.Label(); 40 | this.txtYLimit = new System.Windows.Forms.Label(); 41 | this.panel1 = new System.Windows.Forms.Panel(); 42 | this.btCancel = new System.Windows.Forms.Button(); 43 | this.btOK = new System.Windows.Forms.Button(); 44 | this.cbAxisType = new System.Windows.Forms.ComboBox(); 45 | this.panel1.SuspendLayout(); 46 | this.SuspendLayout(); 47 | // 48 | // txtXMin 49 | // 50 | this.txtXMin.Location = new System.Drawing.Point(31, 62); 51 | this.txtXMin.Name = "txtXMin"; 52 | this.txtXMin.Size = new System.Drawing.Size(69, 20); 53 | this.txtXMin.TabIndex = 1; 54 | // 55 | // label1 56 | // 57 | this.label1.AutoSize = true; 58 | this.label1.Location = new System.Drawing.Point(11, 65); 59 | this.label1.Name = "label1"; 60 | this.label1.Size = new System.Drawing.Size(14, 13); 61 | this.label1.TabIndex = 1; 62 | this.label1.Text = "X"; 63 | // 64 | // label2 65 | // 66 | this.label2.AutoSize = true; 67 | this.label2.Location = new System.Drawing.Point(11, 91); 68 | this.label2.Name = "label2"; 69 | this.label2.Size = new System.Drawing.Size(14, 13); 70 | this.label2.TabIndex = 3; 71 | this.label2.Text = "Y"; 72 | // 73 | // txtYMin 74 | // 75 | this.txtYMin.Location = new System.Drawing.Point(31, 88); 76 | this.txtYMin.Name = "txtYMin"; 77 | this.txtYMin.Size = new System.Drawing.Size(69, 20); 78 | this.txtYMin.TabIndex = 3; 79 | // 80 | // txtYMax 81 | // 82 | this.txtYMax.Location = new System.Drawing.Point(106, 88); 83 | this.txtYMax.Name = "txtYMax"; 84 | this.txtYMax.Size = new System.Drawing.Size(69, 20); 85 | this.txtYMax.TabIndex = 4; 86 | // 87 | // txtXMax 88 | // 89 | this.txtXMax.Location = new System.Drawing.Point(106, 62); 90 | this.txtXMax.Name = "txtXMax"; 91 | this.txtXMax.Size = new System.Drawing.Size(69, 20); 92 | this.txtXMax.TabIndex = 2; 93 | // 94 | // label3 95 | // 96 | this.label3.AutoSize = true; 97 | this.label3.Location = new System.Drawing.Point(53, 46); 98 | this.label3.Name = "label3"; 99 | this.label3.Size = new System.Drawing.Size(24, 13); 100 | this.label3.TabIndex = 6; 101 | this.label3.Text = "Min"; 102 | // 103 | // label4 104 | // 105 | this.label4.AutoSize = true; 106 | this.label4.Location = new System.Drawing.Point(125, 46); 107 | this.label4.Name = "label4"; 108 | this.label4.Size = new System.Drawing.Size(27, 13); 109 | this.label4.TabIndex = 7; 110 | this.label4.Text = "Max"; 111 | // 112 | // txtXLimit 113 | // 114 | this.txtXLimit.AutoSize = true; 115 | this.txtXLimit.Location = new System.Drawing.Point(181, 65); 116 | this.txtXLimit.Name = "txtXLimit"; 117 | this.txtXLimit.Size = new System.Drawing.Size(68, 13); 118 | this.txtXLimit.TabIndex = 8; 119 | this.txtXLimit.Text = "[XAxis Limits]"; 120 | // 121 | // txtYLimit 122 | // 123 | this.txtYLimit.AutoSize = true; 124 | this.txtYLimit.Location = new System.Drawing.Point(181, 91); 125 | this.txtYLimit.Name = "txtYLimit"; 126 | this.txtYLimit.Size = new System.Drawing.Size(71, 13); 127 | this.txtYLimit.TabIndex = 9; 128 | this.txtYLimit.Text = "[YAxis Limits ]"; 129 | // 130 | // panel1 131 | // 132 | this.panel1.Controls.Add(this.btCancel); 133 | this.panel1.Controls.Add(this.btOK); 134 | this.panel1.Dock = System.Windows.Forms.DockStyle.Bottom; 135 | this.panel1.Location = new System.Drawing.Point(0, 123); 136 | this.panel1.Name = "panel1"; 137 | this.panel1.Size = new System.Drawing.Size(323, 38); 138 | this.panel1.TabIndex = 5; 139 | // 140 | // btCancel 141 | // 142 | this.btCancel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); 143 | this.btCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel; 144 | this.btCancel.Location = new System.Drawing.Point(239, 8); 145 | this.btCancel.Name = "btCancel"; 146 | this.btCancel.Size = new System.Drawing.Size(75, 23); 147 | this.btCancel.TabIndex = 1; 148 | this.btCancel.Text = "Cancel"; 149 | this.btCancel.UseVisualStyleBackColor = true; 150 | // 151 | // btOK 152 | // 153 | this.btOK.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); 154 | this.btOK.Location = new System.Drawing.Point(158, 8); 155 | this.btOK.Name = "btOK"; 156 | this.btOK.Size = new System.Drawing.Size(75, 23); 157 | this.btOK.TabIndex = 0; 158 | this.btOK.Text = "OK"; 159 | this.btOK.UseVisualStyleBackColor = true; 160 | this.btOK.Click += new System.EventHandler(this.btOK_Click); 161 | // 162 | // cbAxisType 163 | // 164 | this.cbAxisType.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; 165 | this.cbAxisType.FormattingEnabled = true; 166 | this.cbAxisType.Items.AddRange(new object[] { 167 | "Primary Axis", 168 | "Secondary Axis"}); 169 | this.cbAxisType.Location = new System.Drawing.Point(14, 12); 170 | this.cbAxisType.Name = "cbAxisType"; 171 | this.cbAxisType.Size = new System.Drawing.Size(161, 21); 172 | this.cbAxisType.TabIndex = 0; 173 | this.cbAxisType.SelectedIndexChanged += new System.EventHandler(this.cbAxisType_SelectedIndexChanged); 174 | // 175 | // MSChartExtensionZoomDialog 176 | // 177 | this.AcceptButton = this.btOK; 178 | this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); 179 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; 180 | this.CancelButton = this.btCancel; 181 | this.ClientSize = new System.Drawing.Size(323, 161); 182 | this.Controls.Add(this.cbAxisType); 183 | this.Controls.Add(this.panel1); 184 | this.Controls.Add(this.txtYLimit); 185 | this.Controls.Add(this.txtXLimit); 186 | this.Controls.Add(this.label4); 187 | this.Controls.Add(this.label3); 188 | this.Controls.Add(this.txtYMax); 189 | this.Controls.Add(this.txtXMax); 190 | this.Controls.Add(this.label2); 191 | this.Controls.Add(this.txtYMin); 192 | this.Controls.Add(this.label1); 193 | this.Controls.Add(this.txtXMin); 194 | this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow; 195 | this.Name = "MSChartExtensionZoomDialog"; 196 | this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; 197 | this.Text = "Zoom Settings..."; 198 | this.panel1.ResumeLayout(false); 199 | this.ResumeLayout(false); 200 | this.PerformLayout(); 201 | 202 | } 203 | 204 | #endregion 205 | 206 | private TextBox txtXMin; 207 | private Label label1; 208 | private Label label2; 209 | private TextBox txtYMin; 210 | private TextBox txtYMax; 211 | private TextBox txtXMax; 212 | private Label label3; 213 | private Label label4; 214 | private Label txtXLimit; 215 | private Label txtYLimit; 216 | private Panel panel1; 217 | private Button btCancel; 218 | private Button btOK; 219 | private ComboBox cbAxisType; 220 | } 221 | } -------------------------------------------------------------------------------- /MSChartExtension/MSChartExtensionZoomDialog.cs: -------------------------------------------------------------------------------- 1 | using System.Drawing; 2 | 3 | namespace System.Windows.Forms.DataVisualization.Charting 4 | { 5 | internal partial class MSChartExtensionZoomDialog : Form 6 | { 7 | private readonly ChartArea ptrChartArea; 8 | private Axis ptrXAxis, ptrYAxis; 9 | public MSChartExtensionZoomDialog(ChartArea sender) 10 | { 11 | InitializeComponent(); 12 | ptrChartArea = sender; 13 | cbAxisType.SelectedIndex = 0; 14 | cbAxisType_SelectedIndexChanged(this, null); 15 | 16 | } 17 | 18 | private void cbAxisType_SelectedIndexChanged(object sender, EventArgs e) 19 | { 20 | switch (cbAxisType.SelectedIndex) 21 | { 22 | case 0: //Primary Axis 23 | ptrXAxis = ptrChartArea.AxisX; 24 | ptrYAxis = ptrChartArea.AxisY; 25 | break; 26 | 27 | case 1: //Secondary Axis 28 | ptrXAxis = ptrChartArea.AxisX2; 29 | ptrYAxis = ptrChartArea.AxisY2; 30 | break; 31 | } 32 | txtXLimit.Text = string.Format("[{0} to {1}]", 33 | FormatDouble(ptrXAxis.Minimum), 34 | FormatDouble(ptrXAxis.Maximum)); 35 | 36 | txtYLimit.Text = string.Format("[{0} to {1}]", 37 | FormatDouble(ptrYAxis.Minimum), 38 | FormatDouble(ptrYAxis.Maximum)); 39 | 40 | txtXMin.Text = ptrXAxis.ScaleView.ViewMinimum.ToString(); 41 | txtXMax.Text = ptrXAxis.ScaleView.ViewMaximum.ToString(); 42 | txtYMin.Text = ptrYAxis.ScaleView.ViewMinimum.ToString(); 43 | txtYMax.Text = ptrYAxis.ScaleView.ViewMaximum.ToString(); 44 | } 45 | 46 | private void btOK_Click(object sender, EventArgs e) 47 | { 48 | bool inputValid = true; 49 | 50 | //Sanity Check 51 | if (!ValidateInput(txtXMin)) { inputValid = false; } 52 | if (!ValidateInput(txtXMax)) { inputValid = false; } 53 | if (!ValidateInput(txtYMin)) { inputValid = false; } 54 | if (!ValidateInput(txtYMax)) { inputValid = false; } 55 | if (!inputValid) 56 | { 57 | MessageBox.Show("Invalid input values!", this.Text, 58 | MessageBoxButtons.OK, MessageBoxIcon.Error); 59 | return; 60 | } 61 | 62 | //Limit Check 63 | double xStart = Convert.ToDouble(txtXMin.Text); 64 | double xEnd = Convert.ToDouble(txtXMax.Text); 65 | double yStart = Convert.ToDouble(txtYMin.Text); 66 | double yEnd = Convert.ToDouble(txtYMax.Text); 67 | 68 | //Adjust Axis 69 | if (xStart < ptrXAxis.Minimum) ptrXAxis.Minimum = xStart; 70 | if (xEnd > ptrXAxis.Maximum) ptrXAxis.Maximum = xEnd; 71 | if (yStart < ptrYAxis.Minimum) ptrYAxis.Minimum = yStart; 72 | if (yEnd > ptrYAxis.Maximum) ptrYAxis.Maximum = yEnd; 73 | 74 | //Perform ZOOM 75 | if ((xStart > ptrXAxis.Minimum) || (xEnd < ptrXAxis.Maximum)) ptrXAxis.ScaleView.Zoom(xStart, xEnd); 76 | if ((yStart > ptrYAxis.Minimum) || (yEnd < ptrYAxis.Maximum)) ptrYAxis.ScaleView.Zoom(yStart, yEnd); 77 | 78 | DialogResult = DialogResult.OK; 79 | } 80 | 81 | private bool ValidateInput(TextBox sender) 82 | { 83 | bool valid = double.TryParse(sender.Text, out _); 84 | sender.BackColor = valid ? Color.FromKnownColor(KnownColor.Window) : Color.FromArgb(255, 192, 192); 85 | return valid; 86 | } 87 | 88 | private string FormatDouble(double number) 89 | { 90 | double numberRange = Math.Abs(number); 91 | if (numberRange < 0) 92 | return number.ToString("0.0000"); 93 | else if (numberRange < 10) 94 | return number.ToString("0.0000"); 95 | else if (numberRange < 100) 96 | return number.ToString("0.00"); 97 | else if (numberRange < 1000) 98 | return number.ToString("0.0"); 99 | else 100 | return number.ToString("0"); 101 | } 102 | } 103 | } 104 | -------------------------------------------------------------------------------- /MSChartExtension/MSChartExtensionZoomDialog.resx: -------------------------------------------------------------------------------- 1 |  2 | 3 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | text/microsoft-resx 110 | 111 | 112 | 2.0 113 | 114 | 115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 116 | 117 | 118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 119 | 120 | -------------------------------------------------------------------------------- /MSChartExtension/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.InteropServices; 3 | 4 | // General Information about an assembly is controlled through the following 5 | // set of attributes. Change these attribute values to modify the information 6 | // associated with an assembly. 7 | [assembly: AssemblyTitle("MSChartExtension")] 8 | [assembly: AssemblyDescription("Extension for MSChart Control .NET (WinForm)")] 9 | [assembly: AssemblyConfiguration("")] 10 | [assembly: AssemblyCompany("Code Art Engineering")] 11 | [assembly: AssemblyProduct("MSChartExtension")] 12 | [assembly: AssemblyCopyright("Copyright © Code Art Engineering 2012 - 2023")] 13 | [assembly: AssemblyTrademark("")] 14 | [assembly: AssemblyCulture("")] 15 | [assembly: System.CLSCompliant(true)] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("14069fc4-451d-49fb-a529-827ef91ffe2a")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("3.11.1")] 36 | [assembly: AssemblyFileVersion("3.11.1")] 37 | -------------------------------------------------------------------------------- /MSChartExtension/Properties/Resources.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.42000 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace System.Windows.Forms.DataVisualization.Charting.Properties { 12 | using System; 13 | 14 | 15 | /// 16 | /// A strongly-typed resource class, for looking up localized strings, etc. 17 | /// 18 | // This class was auto-generated by the StronglyTypedResourceBuilder 19 | // class via a tool like ResGen or Visual Studio. 20 | // To add or remove a member, edit your .ResX file then rerun ResGen 21 | // with the /str option, or rebuild your VS project. 22 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")] 23 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 24 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 25 | internal class Resources { 26 | 27 | private static global::System.Resources.ResourceManager resourceMan; 28 | 29 | private static global::System.Globalization.CultureInfo resourceCulture; 30 | 31 | [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] 32 | internal Resources() { 33 | } 34 | 35 | /// 36 | /// Returns the cached ResourceManager instance used by this class. 37 | /// 38 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 39 | internal static global::System.Resources.ResourceManager ResourceManager { 40 | get { 41 | if (object.ReferenceEquals(resourceMan, null)) { 42 | global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("System.Windows.Forms.DataVisualization.Charting.Properties.Resources", typeof(Resources).Assembly); 43 | resourceMan = temp; 44 | } 45 | return resourceMan; 46 | } 47 | } 48 | 49 | /// 50 | /// Overrides the current thread's CurrentUICulture property for all 51 | /// resource lookups using this strongly typed resource class. 52 | /// 53 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 54 | internal static global::System.Globalization.CultureInfo Culture { 55 | get { 56 | return resourceCulture; 57 | } 58 | set { 59 | resourceCulture = value; 60 | } 61 | } 62 | 63 | /// 64 | /// Looks up a localized resource of type System.Drawing.Bitmap. 65 | /// 66 | internal static System.Drawing.Bitmap AboutDlgBackground { 67 | get { 68 | object obj = ResourceManager.GetObject("AboutDlgBackground", resourceCulture); 69 | return ((System.Drawing.Bitmap)(obj)); 70 | } 71 | } 72 | 73 | /// 74 | /// Looks up a localized resource of type System.Drawing.Bitmap. 75 | /// 76 | internal static System.Drawing.Bitmap CAELogoSmall { 77 | get { 78 | object obj = ResourceManager.GetObject("CAELogoSmall", resourceCulture); 79 | return ((System.Drawing.Bitmap)(obj)); 80 | } 81 | } 82 | 83 | /// 84 | /// Looks up a localized resource of type System.Drawing.Bitmap. 85 | /// 86 | internal static System.Drawing.Bitmap FacebookIcon { 87 | get { 88 | object obj = ResourceManager.GetObject("FacebookIcon", resourceCulture); 89 | return ((System.Drawing.Bitmap)(obj)); 90 | } 91 | } 92 | 93 | /// 94 | /// Looks up a localized resource of type System.Drawing.Bitmap. 95 | /// 96 | internal static System.Drawing.Bitmap GithubIcon { 97 | get { 98 | object obj = ResourceManager.GetObject("GithubIcon", resourceCulture); 99 | return ((System.Drawing.Bitmap)(obj)); 100 | } 101 | } 102 | 103 | /// 104 | /// Looks up a localized resource of type System.Drawing.Bitmap. 105 | /// 106 | internal static System.Drawing.Bitmap MSChartExtensionLogo { 107 | get { 108 | object obj = ResourceManager.GetObject("MSChartExtensionLogo", resourceCulture); 109 | return ((System.Drawing.Bitmap)(obj)); 110 | } 111 | } 112 | } 113 | } 114 | -------------------------------------------------------------------------------- /MSChartExtension/Properties/Resources.resx: -------------------------------------------------------------------------------- 1 |  2 | 3 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | text/microsoft-resx 110 | 111 | 112 | 2.0 113 | 114 | 115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 116 | 117 | 118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 119 | 120 | 121 | 122 | ..\Resources\AboutDlgBackground.jpg;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a 123 | 124 | 125 | ..\Resources\CAELogoSmall.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a 126 | 127 | 128 | ..\Resources\FacebookIcon.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a 129 | 130 | 131 | ..\Resources\GithubIcon.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a 132 | 133 | 134 | ..\Resources\MSChartExtensionLogo.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a 135 | 136 | -------------------------------------------------------------------------------- /MSChartExtension/ResourceSeries.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Linq; 3 | 4 | namespace System.Windows.Forms.DataVisualization.Charting 5 | { 6 | /// 7 | /// Resource utilization chart series 8 | /// 9 | public class ResourceSeries 10 | { 11 | /// 12 | /// Series used for this Resource Chart. 13 | /// 14 | public Series BaseSeries { get; private set; } 15 | /// 16 | /// Chart area where this series is belongs to. 17 | /// 18 | public ChartArea ChartArea { get; private set; } 19 | internal ResourceSeries(ChartArea chartArea, Series series) 20 | { 21 | ChartArea = chartArea; 22 | BaseSeries = series; 23 | ChartArea.AxisX.LabelStyle.Interval = 1; 24 | } 25 | 26 | private List Rows { get; set; } = new List(); 27 | 28 | /// 29 | /// Get or add Row data. 30 | /// 31 | /// 32 | /// 33 | public ResourceRow Row(string name) 34 | { 35 | ResourceRow result = Rows.FirstOrDefault(n => n.Name == name); 36 | if (result == null) 37 | { 38 | result = new ResourceRow(name, BaseSeries, Rows.Count); 39 | Rows.Add(result); 40 | } 41 | return result; 42 | } 43 | 44 | /// 45 | /// Clear all data points. 46 | /// 47 | public void Clear() 48 | { 49 | BaseSeries.ClearPoints(); 50 | Rows.Clear(); 51 | } 52 | } 53 | 54 | /// 55 | /// Resource series data row, one row for each X index from 0 to N 56 | /// 57 | public class ResourceRow 58 | { 59 | /// 60 | /// Data Row name 61 | /// 62 | public string Name { get; private set; } 63 | /// 64 | /// Associated XValue of current row instance. 65 | /// 66 | public int RowIndex { get; private set; } 67 | internal Series Series { get; private set; } 68 | internal ResourceRow(string name, Series series, int rowIndex) 69 | { 70 | Name = name; 71 | Series = series; 72 | RowIndex = rowIndex; 73 | } 74 | 75 | /// 76 | /// Add data to current data row. 77 | /// 78 | /// 79 | public DataPoint[] AddTimeBlocks(params TimeBlock[] blocks) 80 | { 81 | List results = new List(); 82 | foreach (TimeBlock t in blocks) 83 | { 84 | DataPoint p = Series.Points.AddXYWithObject(t, RowIndex, t.StartTime, t.EndTime); 85 | p.AxisLabel = Name; 86 | results.Add(p); 87 | } 88 | return results.ToArray(); 89 | } 90 | 91 | } 92 | } 93 | -------------------------------------------------------------------------------- /MSChartExtension/Resources/AboutDlgBackground.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Code-Artist/MSChartExtension/d1ebcd615adaf418cd4d236203f22b2ce6b795ef/MSChartExtension/Resources/AboutDlgBackground.jpg -------------------------------------------------------------------------------- /MSChartExtension/Resources/AboutDlgBackground.pdn: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Code-Artist/MSChartExtension/d1ebcd615adaf418cd4d236203f22b2ce6b795ef/MSChartExtension/Resources/AboutDlgBackground.pdn -------------------------------------------------------------------------------- /MSChartExtension/Resources/CAELogoSmall.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Code-Artist/MSChartExtension/d1ebcd615adaf418cd4d236203f22b2ce6b795ef/MSChartExtension/Resources/CAELogoSmall.png -------------------------------------------------------------------------------- /MSChartExtension/Resources/FacebookIcon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Code-Artist/MSChartExtension/d1ebcd615adaf418cd4d236203f22b2ce6b795ef/MSChartExtension/Resources/FacebookIcon.png -------------------------------------------------------------------------------- /MSChartExtension/Resources/GithubIcon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Code-Artist/MSChartExtension/d1ebcd615adaf418cd4d236203f22b2ce6b795ef/MSChartExtension/Resources/GithubIcon.png -------------------------------------------------------------------------------- /MSChartExtension/Resources/MSChartExtensionLogo.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Code-Artist/MSChartExtension/d1ebcd615adaf418cd4d236203f22b2ce6b795ef/MSChartExtension/Resources/MSChartExtensionLogo.ico -------------------------------------------------------------------------------- /MSChartExtension/Resources/MSChartExtensionLogo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Code-Artist/MSChartExtension/d1ebcd615adaf418cd4d236203f22b2ce6b795ef/MSChartExtension/Resources/MSChartExtensionLogo.png -------------------------------------------------------------------------------- /MSChartExtension/SeriesDataBuffer.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | 3 | namespace System.Windows.Forms.DataVisualization.Charting 4 | { 5 | 6 | internal struct PointD 7 | { 8 | public PointD(double x, double y) { X = x; Y = y; } 9 | public double X { get; set; } 10 | public double Y { get; set; } 11 | } 12 | 13 | internal class SeriesDataBuffer 14 | { 15 | public ChartData Parent { get; set; } 16 | public Series Series { get; set; } 17 | public List DataBuffer { get; set; } = new List(); 18 | 19 | public double XMin { get; internal set; } 20 | public double XMax { get; internal set; } 21 | public double YMin { get; internal set; } 22 | public double YMax { get; internal set; } 23 | 24 | public PointD XMinPoint = new PointD(); 25 | public PointD XMaxPoint = new PointD(); 26 | 27 | public void AddPoint(double x, double y) 28 | { 29 | DataBuffer.Add(new PointD(x, y)); 30 | 31 | if (x < XMin) 32 | { 33 | XMinPoint.X = x; 34 | XMinPoint.Y = y; 35 | } 36 | if (x > XMax) 37 | { 38 | XMaxPoint.X = x; 39 | XMaxPoint.Y = y; 40 | } 41 | 42 | XMin = Math.Min(XMin, x); 43 | XMax = Math.Max(XMax, x); 44 | YMin = Math.Min(YMin, y); 45 | YMax = Math.Max(YMax, y); 46 | } 47 | 48 | public void Clear() 49 | { 50 | DataBuffer.Clear(); 51 | XMin = YMin = Double.MaxValue; 52 | XMax = YMax = Double.MinValue; 53 | } 54 | 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /MSChartExtension/Theme/DarkTheme.cs: -------------------------------------------------------------------------------- 1 | using System.Drawing; 2 | 3 | namespace System.Windows.Forms.DataVisualization.Charting 4 | { 5 | /// 6 | /// Dark Theme 7 | /// 8 | public class DarkTheme : ThemeBase 9 | { 10 | /// 11 | /// Constructor 12 | /// 13 | public DarkTheme() : base("Dark") 14 | { 15 | BackColor = ChartAreaBackColor = Color.Black; 16 | AxisLineColor = AxisMajorGridColor = AxisMinorGridColor = Color.Gray; 17 | AxisLabelColor = TitleColor = Color.LightGray; 18 | } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /MSChartExtension/Theme/Futuristic.cs: -------------------------------------------------------------------------------- 1 | using System.Drawing; 2 | 3 | namespace System.Windows.Forms.DataVisualization.Charting 4 | { 5 | /// 6 | /// Dark Theme 7 | /// 8 | public class FuturisticTheme : ThemeBase 9 | { 10 | /// 11 | /// Constructor 12 | /// 13 | public FuturisticTheme() : base("Futuristic") 14 | { 15 | BackColor = Color.FromArgb(12, 25, 48); 16 | ChartAreaBackColor = Color.FromArgb(14, 37, 61); 17 | AxisLineColor = AxisMajorGridColor = AxisMinorGridColor = Color.FromArgb(47, 97, 135); 18 | AxisLabelColor = TitleColor = Color.White; 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /MSChartExtension/Theme/NightVision.cs: -------------------------------------------------------------------------------- 1 | using System.Drawing; 2 | 3 | namespace System.Windows.Forms.DataVisualization.Charting 4 | { 5 | /// 6 | /// Night Vision Theme 7 | /// 8 | public class NightVisionTheme : ThemeBase 9 | { 10 | /// 11 | /// Constructor 12 | /// 13 | public NightVisionTheme() : base("Night Vision") 14 | { 15 | BackColor = ChartAreaBackColor = Color.FromArgb(0, 28, 0); 16 | AxisLineColor = AxisMajorGridColor = AxisMinorGridColor = Color.FromArgb(4, 120, 11); 17 | AxisLabelColor = TitleColor = Color.FromArgb(22, 198, 12); 18 | } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /MSChartExtension/Theme/ThemeBase.cs: -------------------------------------------------------------------------------- 1 | using System.Drawing; 2 | 3 | namespace System.Windows.Forms.DataVisualization.Charting 4 | { 5 | /// 6 | /// Theme - Base Class 7 | /// 8 | public abstract class ThemeBase 9 | { 10 | /// 11 | /// Base Constructor, create new theme. 12 | /// 13 | /// Display name 14 | public ThemeBase(string name) { Name = name; } 15 | /// 16 | /// User Friendly Name 17 | /// 18 | public string Name { get; private set; } 19 | /// 20 | /// Chart -> BackColor 21 | /// 22 | public Color BackColor { get; set; } = Color.Empty; 23 | /// 24 | /// ChartArea -> BackColor 25 | /// 26 | public Color ChartAreaBackColor { get; set; } = Color.Empty; 27 | /// 28 | /// All Axis: Line Color 29 | /// 30 | public Color AxisLineColor { get; set; } = Color.Empty; 31 | /// 32 | /// All Axis: Major Grid Color, Major Tick Mark 33 | /// 34 | public Color AxisMajorGridColor { get; set; } = Color.Empty; 35 | /// 36 | /// All Axis: Minor Gird Color, Minor Tick Mark 37 | /// 38 | public Color AxisMinorGridColor { get; set; } = Color.Empty; 39 | /// 40 | /// All Axis: LabelStyel -> ForeColor 41 | /// 42 | public Color AxisLabelColor { get; set; } = Color.Empty; 43 | /// 44 | /// Chart Title Color 45 | /// 46 | public Color TitleColor { get; set; } = Color.Empty; 47 | /// 48 | /// Border Skin Style 49 | /// 50 | public BorderSkinStyle BorderSkin { get; set; } = BorderSkinStyle.None; 51 | 52 | /// 53 | /// Assign style to chart 54 | /// 55 | /// 56 | public virtual void AssignTheme(Chart sender) 57 | { 58 | sender.BackColor = BackColor; 59 | foreach (Title t in sender.Titles) 60 | { 61 | t.ForeColor = TitleColor; 62 | } 63 | foreach (ChartArea a in sender.ChartAreas) 64 | { 65 | a.BackColor = ChartAreaBackColor; 66 | foreach (Axis x in a.Axes) 67 | { 68 | x.LineColor = AxisLineColor; 69 | x.MajorGrid.LineColor = x.MajorTickMark.LineColor = AxisMajorGridColor; 70 | x.MinorGrid.LineColor = x.MinorTickMark.LineColor = AxisMinorGridColor; 71 | x.LabelStyle.ForeColor = AxisLabelColor; 72 | x.TitleForeColor = AxisLabelColor; 73 | } 74 | } 75 | foreach (Legend l in sender.Legends) 76 | { 77 | l.BackColor = BackColor; 78 | l.ForeColor = AxisLabelColor; 79 | } 80 | sender.BorderSkin.SkinStyle = BorderSkin; 81 | } 82 | 83 | } 84 | } 85 | -------------------------------------------------------------------------------- /MSChartExtension/Theme/ThemeManager.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Reflection; 3 | 4 | namespace System.Windows.Forms.DataVisualization.Charting 5 | { 6 | internal static class ThemeManager 7 | { 8 | public static Dictionary GetThemes() 9 | { 10 | Dictionary themes = new Dictionary(); 11 | 12 | foreach (Type item in Assembly.GetExecutingAssembly().GetTypes()) 13 | { 14 | if (!item.IsClass) continue; 15 | if (item.IsAbstract) continue; 16 | if (item.IsSubclassOf(typeof(ThemeBase))) 17 | { 18 | ThemeBase t = Activator.CreateInstance(item) as ThemeBase; 19 | themes.Add(t.Name, t); 20 | } 21 | } 22 | return themes; 23 | } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /MSChartExtension/Theme/WindowsTheme.cs: -------------------------------------------------------------------------------- 1 | using System.Drawing; 2 | 3 | namespace System.Windows.Forms.DataVisualization.Charting.Theme 4 | { 5 | /// 6 | /// Original WinForm Theme 7 | /// 8 | public class WindowsTheme : ThemeBase 9 | { 10 | /// 11 | /// Constructor 12 | /// 13 | public WindowsTheme() : base("Windows") 14 | { 15 | Chart tChart = new Chart(); 16 | BackColor = tChart.BackColor; 17 | TitleColor = Color.FromKnownColor(KnownColor.WindowText); 18 | 19 | ChartArea tChartArea = new ChartArea(); 20 | AxisLabelColor = tChartArea.AxisX.TitleForeColor; 21 | AxisMajorGridColor = AxisMinorGridColor = tChartArea.AxisX.MajorGrid.LineColor; 22 | AxisLineColor = tChartArea.AxisX.LineColor; 23 | ChartAreaBackColor = tChartArea.BackColor; 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /MSChartExtension/WindowMessagesNativeMethods.cs: -------------------------------------------------------------------------------- 1 | using System.Runtime.InteropServices; 2 | 3 | namespace System.Windows.Forms.DataVisualization.Charting 4 | { 5 | static class WindowMessagesNativeMethods 6 | { 7 | #region [ Suspend / Resume Drawing ] 8 | [DllImport("user32.dll")] 9 | private static extern IntPtr SendMessage(IntPtr hWnd, Int32 wMsg, IntPtr wParam, IntPtr lParam); 10 | 11 | private const int WM_SETREDRAW = 11; 12 | public static void SuspendDrawing(Control parent) { SendMessage(parent.Handle, WM_SETREDRAW, IntPtr.Zero, IntPtr.Zero); } 13 | public static void ResumeDrawing(Control parent) { SendMessage(parent.Handle, WM_SETREDRAW, new IntPtr(1), IntPtr.Zero); parent.Refresh(); } 14 | #endregion 15 | 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /MSChartExtension/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /MSChartExtensionDemo/ChartForm.Designer.cs: -------------------------------------------------------------------------------- 1 | namespace MSChartExtensionDemo 2 | { 3 | partial class ChartForm 4 | { 5 | /// 6 | /// Required designer variable. 7 | /// 8 | private System.ComponentModel.IContainer components = null; 9 | 10 | /// 11 | /// Clean up any resources being used. 12 | /// 13 | /// true if managed resources should be disposed; otherwise, false. 14 | protected override void Dispose(bool disposing) 15 | { 16 | if (disposing && (components != null)) 17 | { 18 | components.Dispose(); 19 | } 20 | base.Dispose(disposing); 21 | } 22 | 23 | #region Windows Form Designer generated code 24 | 25 | /// 26 | /// Required method for Designer support - do not modify 27 | /// the contents of this method with the code editor. 28 | /// 29 | private void InitializeComponent() 30 | { 31 | System.Windows.Forms.DataVisualization.Charting.ChartArea chartArea1 = new System.Windows.Forms.DataVisualization.Charting.ChartArea(); 32 | System.Windows.Forms.DataVisualization.Charting.Legend legend1 = new System.Windows.Forms.DataVisualization.Charting.Legend(); 33 | System.Windows.Forms.DataVisualization.Charting.Series series1 = new System.Windows.Forms.DataVisualization.Charting.Series(); 34 | System.Windows.Forms.DataVisualization.Charting.DataPoint dataPoint1 = new System.Windows.Forms.DataVisualization.Charting.DataPoint(0D, "10,20"); 35 | System.Windows.Forms.DataVisualization.Charting.DataPoint dataPoint2 = new System.Windows.Forms.DataVisualization.Charting.DataPoint(0D, "30,40"); 36 | System.Windows.Forms.DataVisualization.Charting.DataPoint dataPoint3 = new System.Windows.Forms.DataVisualization.Charting.DataPoint(1D, "10,20"); 37 | System.Windows.Forms.DataVisualization.Charting.DataPoint dataPoint4 = new System.Windows.Forms.DataVisualization.Charting.DataPoint(1D, "50,60"); 38 | this.chart1 = new System.Windows.Forms.DataVisualization.Charting.Chart(); 39 | this.statusStrip1 = new System.Windows.Forms.StatusStrip(); 40 | this.LbCursorValue = new System.Windows.Forms.ToolStripStatusLabel(); 41 | this.LbSelectedPoint = new System.Windows.Forms.ToolStripStatusLabel(); 42 | ((System.ComponentModel.ISupportInitialize)(this.chart1)).BeginInit(); 43 | this.statusStrip1.SuspendLayout(); 44 | this.SuspendLayout(); 45 | // 46 | // chart1 47 | // 48 | chartArea1.AxisX.Title = "X Axis"; 49 | chartArea1.Name = "ChartArea1"; 50 | this.chart1.ChartAreas.Add(chartArea1); 51 | this.chart1.Dock = System.Windows.Forms.DockStyle.Fill; 52 | legend1.Name = "Legend1"; 53 | this.chart1.Legends.Add(legend1); 54 | this.chart1.Location = new System.Drawing.Point(0, 0); 55 | this.chart1.Name = "chart1"; 56 | series1.ChartArea = "ChartArea1"; 57 | series1.ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.StepLine; 58 | series1.CustomProperties = "DrawSideBySide=False, IsXAxisQuantitative=True"; 59 | series1.Legend = "Legend1"; 60 | series1.Name = "Series1"; 61 | series1.Points.Add(dataPoint1); 62 | series1.Points.Add(dataPoint2); 63 | series1.Points.Add(dataPoint3); 64 | series1.Points.Add(dataPoint4); 65 | series1.YValuesPerPoint = 2; 66 | this.chart1.Series.Add(series1); 67 | this.chart1.Size = new System.Drawing.Size(800, 426); 68 | this.chart1.TabIndex = 0; 69 | this.chart1.Text = "chart1"; 70 | // 71 | // statusStrip1 72 | // 73 | this.statusStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { 74 | this.LbCursorValue, 75 | this.LbSelectedPoint}); 76 | this.statusStrip1.Location = new System.Drawing.Point(0, 426); 77 | this.statusStrip1.Name = "statusStrip1"; 78 | this.statusStrip1.Size = new System.Drawing.Size(800, 24); 79 | this.statusStrip1.TabIndex = 1; 80 | this.statusStrip1.Text = "statusStrip1"; 81 | // 82 | // LbCursorValue 83 | // 84 | this.LbCursorValue.BorderSides = System.Windows.Forms.ToolStripStatusLabelBorderSides.Right; 85 | this.LbCursorValue.Name = "LbCursorValue"; 86 | this.LbCursorValue.Size = new System.Drawing.Size(90, 19); 87 | this.LbCursorValue.Text = ""; 88 | // 89 | // LbSelectedPoint 90 | // 91 | this.LbSelectedPoint.BorderSides = System.Windows.Forms.ToolStripStatusLabelBorderSides.Right; 92 | this.LbSelectedPoint.Name = "LbSelectedPoint"; 93 | this.LbSelectedPoint.Size = new System.Drawing.Size(102, 19); 94 | this.LbSelectedPoint.Text = ""; 95 | // 96 | // ChartForm 97 | // 98 | this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); 99 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; 100 | this.ClientSize = new System.Drawing.Size(800, 450); 101 | this.Controls.Add(this.chart1); 102 | this.Controls.Add(this.statusStrip1); 103 | this.Name = "ChartForm"; 104 | this.Text = "ChartForm"; 105 | this.Shown += new System.EventHandler(this.ChartForm_Shown); 106 | ((System.ComponentModel.ISupportInitialize)(this.chart1)).EndInit(); 107 | this.statusStrip1.ResumeLayout(false); 108 | this.statusStrip1.PerformLayout(); 109 | this.ResumeLayout(false); 110 | this.PerformLayout(); 111 | 112 | } 113 | 114 | #endregion 115 | 116 | private System.Windows.Forms.DataVisualization.Charting.Chart chart1; 117 | private System.Windows.Forms.StatusStrip statusStrip1; 118 | private System.Windows.Forms.ToolStripStatusLabel LbCursorValue; 119 | private System.Windows.Forms.ToolStripStatusLabel LbSelectedPoint; 120 | } 121 | } -------------------------------------------------------------------------------- /MSChartExtensionDemo/ChartForm.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Windows.Forms; 3 | using System.Windows.Forms.DataVisualization.Charting; 4 | 5 | 6 | namespace MSChartExtensionDemo 7 | { 8 | public partial class ChartForm : Form 9 | { 10 | public ChartForm() 11 | { 12 | InitializeComponent(); 13 | } 14 | 15 | private void selectionChanged(Chart sender, ChartCursor cursor) 16 | { 17 | LbSelectedPoint.Text = cursor.XFormattedString + ", " + cursor.YFormattedString; 18 | } 19 | 20 | private void cursorMoved(Chart sender, ChartCursor cursor) 21 | { 22 | LbCursorValue.Text = cursor.XFormattedString + ", " + cursor.YFormattedString; 23 | } 24 | 25 | private void ChartForm_Shown(object sender, EventArgs e) 26 | { 27 | ChartOption chartOption = new ChartOption(); 28 | chartOption.CursorLabelFormatX1.StringFormat = "F0"; 29 | chartOption.CursorLabelFormatY1.StringFormat = "t"; 30 | 31 | chart1.EnableZoomAndPanControls(selectionChanged, cursorMoved, option: chartOption); 32 | chart1.ChartAreas[0].AxisY.LabelStyle.Format = "MMM-dd, HH:mm"; 33 | ResourceSeries ptrSeries = chart1.ChartAreas[0].SetupResourceAllocationChart(); 34 | Random r = new Random((int)DateTime.Now.Ticks); 35 | char serName = 'A'; 36 | DateTime tRef = DateTime.Now; 37 | for (int x = 0; x < 25; x++) //X Entry 38 | { 39 | ResourceRow ptrRow = ptrSeries.Row(serName.ToString()); 40 | serName++; 41 | 42 | int totalSeconds = 0; 43 | 44 | while (totalSeconds < 600) 45 | { 46 | int range = r.Next(50); 47 | if (totalSeconds + range >= 600) break; 48 | ptrRow.AddTimeBlocks(new TimeBlock(tRef.AddSeconds(totalSeconds), range)); 49 | totalSeconds += range; 50 | totalSeconds += r.Next(20); 51 | } 52 | } 53 | } 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /MSChartExtensionDemo/ChartForm.resx: -------------------------------------------------------------------------------- 1 |  2 | 3 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | text/microsoft-resx 110 | 111 | 112 | 2.0 113 | 114 | 115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 116 | 117 | 118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 119 | 120 | 121 | 17, 17 122 | 123 | -------------------------------------------------------------------------------- /MSChartExtensionDemo/Form1.resx: -------------------------------------------------------------------------------- 1 |  2 | 3 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | text/microsoft-resx 110 | 111 | 112 | 2.0 113 | 114 | 115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 116 | 117 | 118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 119 | 120 | 121 | 220, 14 122 | 123 | 124 | 17, 17 125 | 126 | 127 | 128 | 129 | iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8 130 | YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAIDSURBVDhPpZLrS5NhGMb3j4SWh0oRQVExD4gonkDpg4hG 131 | YKxG6WBogkMZKgPNCEVJFBGdGETEvgwyO9DJE5syZw3PIlPEE9pgBCLZ5XvdMB8Ew8gXbl54nuf63dd9 132 | 0OGSnwCahxbPRNPAPMw9Xpg6ZmF46kZZ0xSKzJPIrhpDWsVnpBhGkKx3nAX8Pv7z1zg8OoY/cITdn4fw 133 | bf/C0kYAN3Ma/w3gWfZL5kzTKBxjWyK2DftwI9tyMYCZKXbNHaD91bLYJrDXsYbrWfUKwJrPE9M2M1Oc 134 | VzOOpHI7Jr376Hi9ogHqFIANO0/MmmmbmSmm9a8ze+I4MrNWAdjtoJgWcx+PSzg166yZZ8xM8XvXDix9 135 | c4jIqFYAjoriBV9AhEPv1mH/sonogha0afbZMMZz+yreTGyhpusHwtNNCsA5U1zS4BLxzJIfg299qO32 136 | Ir7UJtZfftyATqeT+8o2D8JSjQrAJblrncYL7ZJ2+bfaFnC/1S1NjL3diRat7qrO7wLRP3HjWsojBeCo 137 | mDEo5mNjuweFGvjWg2EBhCbpkW78htSHHwRyNdmgAFzPEee2iFkzayy2OLXzT4gr6UdUnlXrullsxxQ+ 138 | kx0g8BTA3aZlButjSTyjODq/WcQcW/B/Je4OQhLvKQDnzN1mp0nnkvAhR8VuMzNrpm1mpjgkoVwB/v8D 139 | TgDQASA1MVpwzwAAAABJRU5ErkJggg== 140 | 141 | 142 | 143 | 104, 14 144 | 145 | -------------------------------------------------------------------------------- /MSChartExtensionDemo/MSChartExtensionDemo.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | Debug 5 | x86 6 | 8.0.30703 7 | 2.0 8 | {4BF8A3F7-DE4C-4675-976C-4CD5952ABB77} 9 | WinExe 10 | Properties 11 | MSChartExtensionDemo 12 | MSChartExtensionDemo 13 | v4.8 14 | 15 | 16 | 512 17 | 18 | 19 | x86 20 | true 21 | full 22 | false 23 | bin\Debug\ 24 | DEBUG;TRACE 25 | prompt 26 | 4 27 | ..\MSChartExtension\MSChartExtension.ruleset 28 | false 29 | 30 | 31 | x86 32 | pdbonly 33 | true 34 | bin\Release\ 35 | TRACE 36 | prompt 37 | 4 38 | ..\MSChartExtension\MSChartExtension.ruleset 39 | false 40 | 41 | 42 | 43 | ..\packages\CodeArtEng.Extensions.2.5.2\lib\net48\CodeArtEng.Extensions.dll 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | Form 60 | 61 | 62 | ChartForm.cs 63 | 64 | 65 | Form 66 | 67 | 68 | Form1.cs 69 | 70 | 71 | 72 | ChartForm.cs 73 | 74 | 75 | Form1.cs 76 | 77 | 78 | ResXFileCodeGenerator 79 | Resources.Designer.cs 80 | Designer 81 | 82 | 83 | True 84 | Resources.resx 85 | True 86 | 87 | 88 | 89 | 90 | SettingsSingleFileGenerator 91 | Settings.Designer.cs 92 | 93 | 94 | True 95 | Settings.settings 96 | True 97 | 98 | 99 | 100 | 101 | {D865F90F-8498-4D31-BEAF-21A7D5EA0212} 102 | MSChartExtension 103 | 104 | 105 | 106 | 113 | -------------------------------------------------------------------------------- /MSChartExtensionDemo/MSChartExtensionLogo.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Code-Artist/MSChartExtension/d1ebcd615adaf418cd4d236203f22b2ce6b795ef/MSChartExtensionDemo/MSChartExtensionLogo.ico -------------------------------------------------------------------------------- /MSChartExtensionDemo/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.InteropServices; 3 | 4 | // General Information about an assembly is controlled through the following 5 | // set of attributes. Change these attribute values to modify the information 6 | // associated with an assembly. 7 | [assembly: AssemblyTitle("MSChartExtensionDemo")] 8 | [assembly: AssemblyDescription("MSChart Extension Demo (WinForm)")] 9 | [assembly: AssemblyConfiguration("")] 10 | [assembly: AssemblyCompany("Code Art Engineering")] 11 | [assembly: AssemblyProduct("MSChartExtensionDemo")] 12 | [assembly: AssemblyCopyright("Copyright © 2012")] 13 | [assembly: AssemblyTrademark("Copyright © CodeArtEng 2012")] 14 | [assembly: AssemblyCulture("")] 15 | 16 | // Setting ComVisible to false makes the types in this assembly not visible 17 | // to COM components. If you need to access a type in this assembly from 18 | // COM, set the ComVisible attribute to true on that type. 19 | [assembly: ComVisible(false)] 20 | 21 | // The following GUID is for the ID of the typelib if this project is exposed to COM 22 | [assembly: Guid("97a41bfb-2341-42f0-b59f-1f08709513fc")] 23 | 24 | // Version information for an assembly consists of the following four values: 25 | // 26 | // Major Version 27 | // Minor Version 28 | // Build Number 29 | // Revision 30 | // 31 | // You can specify all the values or you can default the Build and Revision Numbers 32 | // by using the '*' as shown below: 33 | // [assembly: AssemblyVersion("1.0.*")] 34 | [assembly: AssemblyVersion("1.0.0.0")] 35 | [assembly: AssemblyFileVersion("1.0.0.0")] 36 | -------------------------------------------------------------------------------- /MSChartExtensionDemo/Properties/Resources.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.42000 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace MSChartExtensionDemo.Properties { 12 | using System; 13 | 14 | 15 | /// 16 | /// A strongly-typed resource class, for looking up localized strings, etc. 17 | /// 18 | // This class was auto-generated by the StronglyTypedResourceBuilder 19 | // class via a tool like ResGen or Visual Studio. 20 | // To add or remove a member, edit your .ResX file then rerun ResGen 21 | // with the /str option, or rebuild your VS project. 22 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")] 23 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 24 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 25 | internal class Resources { 26 | 27 | private static global::System.Resources.ResourceManager resourceMan; 28 | 29 | private static global::System.Globalization.CultureInfo resourceCulture; 30 | 31 | [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] 32 | internal Resources() { 33 | } 34 | 35 | /// 36 | /// Returns the cached ResourceManager instance used by this class. 37 | /// 38 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 39 | internal static global::System.Resources.ResourceManager ResourceManager { 40 | get { 41 | if (object.ReferenceEquals(resourceMan, null)) { 42 | global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("MSChartExtensionDemo.Properties.Resources", typeof(Resources).Assembly); 43 | resourceMan = temp; 44 | } 45 | return resourceMan; 46 | } 47 | } 48 | 49 | /// 50 | /// Overrides the current thread's CurrentUICulture property for all 51 | /// resource lookups using this strongly typed resource class. 52 | /// 53 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 54 | internal static global::System.Globalization.CultureInfo Culture { 55 | get { 56 | return resourceCulture; 57 | } 58 | set { 59 | resourceCulture = value; 60 | } 61 | } 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /MSChartExtensionDemo/Properties/Resources.resx: -------------------------------------------------------------------------------- 1 |  2 | 3 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | text/microsoft-resx 107 | 108 | 109 | 2.0 110 | 111 | 112 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 113 | 114 | 115 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 116 | 117 | -------------------------------------------------------------------------------- /MSChartExtensionDemo/Properties/Settings.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.42000 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace MSChartExtensionDemo.Properties { 12 | 13 | 14 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 15 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "17.3.0.0")] 16 | internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { 17 | 18 | private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); 19 | 20 | public static Settings Default { 21 | get { 22 | return defaultInstance; 23 | } 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /MSChartExtensionDemo/Properties/Settings.settings: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /MSChartExtensionDemo/app.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /MSChartExtensionDemo/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # MSChartExtension ![NuGet](https://img.shields.io/nuget/v/Mschartextension) 2 | Microsoft Chart Extensions unleashed the power of Microsoft .NET Chart component in WinForms.
3 | Let's see what it can do 4 | - Interactive zoom and pan with built-in context menu to configure chart series and cursors
5 | ![Context menu with Zoom and Pan controls](/Doc/Images/ContextMenu.png?raw=true)
6 | - Dual Cursors for Data Analysis
7 | ![Dual Cursors](/Doc/Images/DualCursors.PNG?raw=true)
8 | - Beautiful Themes
9 | ![Themes](/Doc/Images/Theme.PNG?raw=true)
10 | 11 | 12 | ## Future Study: 13 | - [MSChart Extension - The Start](https://www.codearteng.com/2012/05/mschart-extension-zoom-and-pan-controls.html) 14 | - [MSChart Extension Version 2](https://www.codearteng.com/2016/08/mschart-extension-v2.html)
15 | What's New: Dual cursors, mouse wheel functions. 16 | - [MSChart Extension Version 2.2](https://www.codearteng.com/2019/02/mschart-extension-zoom-and-pan-control.html):
17 | What's New: Snap cursor to nearest data points, select series for chart cursor. 18 | - [What's new in Microsoft Chart Control (MSChart) Extension Version 3 ](https://www.codearteng.com/2020/07/whats-new-in-microsoft-chart-control.html)
19 | What's New: Theme, Buffered Mode, Cursor Label Format and Cursors Navigation. 20 | - [Implementation of Downsampling Algorithm in MSChart Extension ](https://www.codearteng.com/2020/08/implementation-of-downsampling.html)
21 | Discussed implementation of downsampling algorithm in MSChart Buffered Mode. 22 | 23 | 24 | -------------------------------------------------------------------------------- /Release.bat: -------------------------------------------------------------------------------- 1 | REM Release Script for Code Project 2 | @echo off 3 | SET SRC=D:\CKMAI_Documents\Programming\ClassLibraryNET\MSChartExtension 4 | SET DEST=D:\CKMAI_Documents\SWRelease\MSChartExtension\ 5 | SET TARGET=%DEST%MSChartExtension 6 | SET BINTARGET=%DEST%MSChartExtensionDemoBin 7 | SET ZIP="C:\Program Files\7-Zip\7z.exe" 8 | SET ZIPFile=%DEST%MSChartExtensionSource.zip 9 | SET ZIPBin=%DEST%MSChartExtensionDemo.zip 10 | 11 | echo Copying Source Code 12 | del %TARGET% /s /q 13 | rd %TARGET% /s /q 14 | robocopy %SRC% %TARGET% /MIR /XD .hg .git Doc obj bin .vs /XF .hg* .git* *.bat *.userprefs *.pdn 15 | %ZIP% a -tzip %ZIPFILE% %TARGET% 16 | 17 | echo Copying Binary Files 18 | robocopy %SRC%\MSChartExtensionDemo\bin\Debug %BINTARGET% /MIR /XF *.pdb *.mdb *.vshost* 19 | %ZIP% a -tzip %ZIPBin% %BINTARGET% -------------------------------------------------------------------------------- /packages/NuPack.3.4.2/NuPack.3.4.2.nupkg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Code-Artist/MSChartExtension/d1ebcd615adaf418cd4d236203f22b2ce6b795ef/packages/NuPack.3.4.2/NuPack.3.4.2.nupkg --------------------------------------------------------------------------------