C#/C# chart controls
I am creating a chart form and trying to create a chart object that keeps giving me error
" Error 8 The type or namespace name 'Chart' does not exist in the namespace 'System.Windows.Forms.DataVisualization.Charting' (are you missing an assembly reference?)"
with the following line
"private System.Windows.Forms.DataVisualization.Charting.Chart chart1;"
i am trying to create chart1 as an object of chart.
i have done a bit of searching and another syntax available has form of
"System.Windows.Forms.DataVisualization.Charting.ChartArea chartArea1 = new System.Windows.Forms.DataVisualization.Charting.ChartArea();"
i am using vs 2012 .NET 4.5
i created a form by dragging and dropping chart control from toolbox which automatically generated the second syntax but when i try the same code its an error, plus while writing my code vs 2012 prompts for "...Charting.Utilities" and never shows "ChartArea" as an option.
but when i drag and drop that time it works fine.
please do help me i am fixed.
Check if you have reference to System.Windows.Forms.DataVisualization. If you don't have it, add it and it will work fine. If you have it, ensure your project's .Net version is 4 or 4.5. Go to project properties and see Target Framework to confirm it. (Even you pointed that you use 4.5, please re-confirm it, mistakes may happen)
Hope that helps,