I'm trying to fill up a plotsurface with the data found within.
What end up happening is that this AddIndicator method - does do it's job -
but the data lines are squished down tiny. I know they're there as I can use
a Y axis interaction to increase their height. But how to instantly fill the
plotsurface with the data?
indicatorPlot.YAxis1.AutoScaleTicks = true;
does not autoscale the lines.
clues?
protected NPlot.Windows.PlotSurface2D AddIndicator(DataTable dt,
string name, string controlKey, string absiscca, string[] lineNames)
{
Control[] ctrls = this.Controls.Find("ExtraIndicators", true);
NPlot.Windows.PlotSurface2D indicatorPlot = null;
bool foundIt = false;
if (ctrls.Length > 0)
{
foreach (Control ctrl in ctrls)
{
if ((string)ctrl.Tag == controlKey)
{
indicatorPlot = (NPlot.Windows.PlotSurface2D)ctrl;
indicatorPlot.Clear();
foundIt = true;
break;
}
}
}
if (!foundIt)
{
indicatorPlot = new NPlot.Windows.PlotSurface2D();
indicatorPlot.Name = "ExtraIndicators";
indicatorPlot.Tag = controlKey;
}
indicatorPlot.AddInteraction(new
NPlot.Windows.PlotSurface2D.Interactions.HorizontalDrag());
indicatorPlot.AddInteraction(new
NPlot.Windows.PlotSurface2D.Interactions.AxisDrag(true));
indicatorPlot.InteractionOccured += new
NPlot.Windows.PlotSurface2D.InteractionHandler(extraIndicator_InteractionOccured);
pricePS.InteractionOccured += new
NPlot.Windows.PlotSurface2D.InteractionHandler(extraIndicator_InteractionOccured);
//indicatorPlot.Anchor =
((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top
| System.Windows.Forms.AnchorStyles.Bottom)
//| System.Windows.Forms.AnchorStyles.Left)
//| System.Windows.Forms.AnchorStyles.Right)));
indicatorPlot.Dock = DockStyle.Fill;
indicatorPlot.BackColor = Color.Cornsilk;
indicatorPlot.PlotBackColor = Color.Ivory;
indicatorPlot.DateTimeToolTip = false;
indicatorPlot.Width = pricePS.Width;
indicatorPlot.Left = pricePS.Left;
this.splitContainer2.Panel2.Controls.Add(indicatorPlot);
foreach (string lineName in lineNames)
DrawIndicatorLine(dt, indicatorPlot, name, absiscca,
lineName, Color.BlueViolet);
indicatorPlot.SmoothingMode =
System.Drawing.Drawing2D.SmoothingMode.AntiAlias;
indicatorPlot.Add(new Grid());
indicatorPlot.YAxis1.Label = name;
indicatorPlot.YAxis1.LabelOffsetAbsolute = true;
indicatorPlot.YAxis1.LabelOffset = 45;
indicatorPlot.YAxis1.AutoScaleTicks = true;
indicatorPlot.Padding = new System.Windows.Forms.Padding(5); ;
indicatorPlot.Invalidate();
return indicatorPlot;
}
--
___________________
Dav...@gm...
Lake Oswego, OR
801-473-9213
¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
|