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:
public static PlotModel Notinterpolatedvalues() {
var plotModel1 = new PlotModel();
plotModel1.Subtitle = "Input text here";
var linearColorAxis1 = new LinearColorAxis();
linearColorAxis1.HighColor = OxyColors.Gray;
linearColorAxis1.LowColor = OxyColors.Black;
linearColorAxis1.Position = AxisPosition.Right;
plotModel1.Axes.Add(linearColorAxis1);
var linearAxis1 = new LinearAxis();
linearAxis1.Position = AxisPosition.Bottom;
plotModel1.Axes.Add(linearAxis1);
var linearAxis2 = new LinearAxis();
plotModel1.Axes.Add(linearAxis2);
var heatMapSeries1 = new HeatMapSeries();
heatMapSeries1.X0 = 0.5;
heatMapSeries1.X1 = 1.5;
heatMapSeries1.Y0 = 0.5;
heatMapSeries1.Y1 = 2.5;
heatMapSeries1.Interpolate = false;
heatMapSeries1.Data = new Double[2, 3];
heatMapSeries1.Data[0, 0] = 0;
heatMapSeries1.Data[0, 1] = 0.2;
heatMapSeries1.Data[0, 2] = 0.4;
heatMapSeries1.Data[1, 0] = 0.1;
heatMapSeries1.Data[1, 1] = 0.3;
heatMapSeries1.Data[1, 2] = 0.2;
plotModel1.Series.Add(heatMapSeries1);
return plotModel1;
}
This generates this 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:
Any OxyPlot pros in here could lend me a hand? Thank you.