i'd like to realize a isothermal plot with your software.. therefor i read in a csv file with three columns (X position, Y position, and Z for the temperature) and save it into a list of arrays.
The X and Y position is the top left position of each cell. You can load it here: http://rapidshare.com/files/413439287/2dtemp.csv
Then i plot it with a grid.. Here the code:
Code: Select all
ColorGrid cGrid = new ColorGrid(tChart1.Chart);
cGrid.Brush.Color = System.Drawing.Color.FromArgb(((int)(((byte)(68)))), ((int)(((byte)(102)))), ((int)(((byte)(163)))));
cGrid.CenteredPoints = true;
cGrid.Color = System.Drawing.Color.FromArgb(((int)(((byte)(68)))), ((int)(((byte)(102)))), ((int)(((byte)(163)))));
cGrid.ColorEach = false;
cGrid.Marks.Callout.ArrowHead = Steema.TeeChart.Styles.ArrowHeadStyles.None;
cGrid.Marks.Callout.ArrowHeadSize = 8;
cGrid.Marks.Callout.Brush.Color = System.Drawing.Color.Black;
cGrid.Marks.Callout.Distance = 0;
cGrid.Marks.Callout.Draw3D = false;
cGrid.Marks.Callout.Length = 10;
cGrid.Marks.Callout.Series = cGrid;
cGrid.Marks.Callout.Style = Steema.TeeChart.Styles.PointerStyles.Rectangle;
cGrid.Marks.Callout.Visible = false;
cGrid.Pen.Visible = false;
cGrid.Marks.Series = cGrid;
cGrid.PaletteMin = 0;
cGrid.PaletteStep = 0;
cGrid.PaletteStyle = Steema.TeeChart.Styles.PaletteStyles.GrayScale;
cGrid.Title = "isotherm";
cGrid.UseColorRange = false;
cGrid.UsePalette = true;
cGrid.XValues.DataMember = "X";
cGrid.YValues.DataMember = "Y";
cGrid.ZValues.DataMember = "Z";
cGrid.IrregularGrid = true;
for (int i = 0; i < values.ElementAt(0).Length; i++)
{
cGrid.Add(Convert.ToDouble(values.ElementAt(0).GetValue(i)) * 1000,
Convert.ToDouble(values.ElementAt(2).GetValue(i)),
Convert.ToDouble(values.ElementAt(1).GetValue(i)) * 1000); // Y ACHSE
}
//test...
double tempVal = Convert.ToDouble(values.ElementAt(0).GetValue(values.ElementAt(0).Length - 1));
double tempVal2 = 0;
for (int i = values.ElementAt(0).Length-1; i >= 0; i--)
{
if (Convert.ToDouble(values.ElementAt(0).GetValue(i)) != tempVal)
{
tempVal2 = Convert.ToDouble(values.ElementAt(0).GetValue(i));
break;
}
}
tChart1.Axes.Left.AutomaticMaximum = false;
tChart1.Axes.Bottom.AutomaticMaximum = false;
tChart1.Axes.Left.Maximum = Convert.ToDouble(values.ElementAt(1).GetValue(values.ElementAt(0).Length - 1)) * 1000 + (Convert.ToDouble(values.ElementAt(1).GetValue(values.ElementAt(0).Length - 1)) * 1000-Convert.ToDouble(values.ElementAt(1).GetValue(values.ElementAt(0).Length - 2)) * 1000);
tChart1.Axes.Bottom.Maximum = Convert.ToDouble(values.ElementAt(0).GetValue(values.ElementAt(0).Length - 1)) * 1000 + (Convert.ToDouble(values.ElementAt(0).GetValue(values.ElementAt(0).Length - 1)) * 1000 - tempVal2*1000 );
//Legend Palette
Steema.TeeChart.Tools.LegendPalette legendPalette1 = new Steema.TeeChart.Tools.LegendPalette(tChart1.Chart);
legendPalette1.Series = cGrid;//surface;
legendPalette1.Left = 625;
legendPalette1.Top = 140;
legendPalette1.Width = 80;
legendPalette1.Vertical = true;
legendPalette1.Border.Visible = false;
legendPalette1.Axis = Steema.TeeChart.Tools.LegendPaletteAxis.laOther;
My Questions are:
1) I want to have a colorpallete from blue to red to yellow to white (like hot steel) - how can i do this?
2) I use CenteredPoints = true, but teechart is not plotting it in the center (see screenshot above). How can i do this?
Thanks a lot for your support!