Declaring an instance variable for an OxyPlot graphing object

Dec 6, 2013 at 4:52 PM
Edited Dec 6, 2013 at 4:52 PM
I am using OxyPlot, a graphing library for C#. What confuses me so far is the type for some of the constructors. A code snippet is below:

Image

This generates this image:

Image

(It's a heat map)


My question is - what is var? For example, when you create a new multidimensional array, you do this:
double[,] doubleArray = new double[columns, rows];
Understandingly, the type for this is a double[,]. Why I need to know this is that I would like to store the heatmap as an instance variable, more specifically, heatMapSeries1.Data as a multi-dimensional array. However, in VS, I am unable to declare var as the type for an instance variable. The only selection I get is this:

Image

Any OxyPlot pros in here could lend me a hand? Thank you.
Coordinator
Dec 6, 2013 at 6:17 PM
You can only use var within method scope:
http://msdn.microsoft.com/en-us/library/bb383973.aspx
use explicit types for fields and properties.
I prefer to use var where possible, it reduces code duplication.
Dec 6, 2013 at 6:59 PM
Ah I understand now.

Thanks.