コード例 #1
0
ファイル: Events.cs プロジェクト: vlapchenko/nfx
 internal ChartPaneMouseEventArgs( MouseEventType type,
                                   TimeSeriesChart chart,
                                   PlotPane pane,
                                   MouseEventArgs mouse,
                                   ITimeSeriesSample sample,
                                   float value)
 {
   this.EventType = type;
   this.Chart = chart;
   this.Pane = pane;
   this.MouseEvent = mouse;
   this.SampleAtX = sample;
   this.ValueAtY = value;
 }
コード例 #2
0
ファイル: PlotPane.cs プロジェクト: vlapchenko/nfx
     internal PlotPane(TimeSeriesChart chart, string paneName, int paneOrder ) : base()
     {              
       m_Chart = chart;
       base.Name = paneName;
       this.m_Order = paneOrder;


       //for(var x=0; x<1600; x+= 48)
       //  for(var y=0; y<1800; y+= 16)
       //  {
       //  var elm =  new CheckBoxElement(this);// new TextLabelElement(this);
       //  elm.Region = new Rectangle(x,y, 46, 14);
       // // elm.Text = "Cell " + x+"x"+y;
       //  elm.Visible = true;
       //  }
     }
コード例 #3
0
ファイル: PlotPane.cs プロジェクト: itadapter/nfx
        internal PlotPane(TimeSeriesChart chart, string paneName, int paneOrder)
            : base()
        {
            m_Chart = chart;
              base.Name = paneName;
              this.m_Order = paneOrder;

              using (var gr = CreateGraphics())
              {
            var fSize = gr.MeasureString("0.00000", m_Chart.RulerStyle.Font); //margin
            m_VLineSpaceHeight = (int)Math.Round(fSize.Height) + VLINE_SPACE_PADDING;
              }

              //for(var x=0; x<1600; x+= 48)
              //  for(var y=0; y<1800; y+= 16)
              //  {
              //  var elm =  new CheckBoxElement(this);// new TextLabelElement(this);
              //  elm.Region = new Rectangle(x,y, 46, 14);
              // // elm.Text = "Cell " + x+"x"+y;
              //  elm.Visible = true;
              //  }
        }
コード例 #4
0
ファイル: CandleBuySellView.cs プロジェクト: vlapchenko/nfx
 protected override Elements.Element MakeSampleElement(TimeSeriesChart chart, PlotPane pane, CandleSample sample, int x, float minScale, float maxScale)
 {
   return new CandleBuySellElement(this, pane, sample, x, minScale, maxScale);
 }
コード例 #5
0
ファイル: TimeScalePane.cs プロジェクト: yhhno/nfx
 internal TimeScalePane(TimeSeriesChart chart)
 {
     m_Chart      = chart;
       m_TimeCursor = new TimeCursorElement(this);
       TickSpace    = DEFAULT_TICK_SPACE;
 }
コード例 #6
0
ファイル: CandleMidLineView.cs プロジェクト: vlapchenko/nfx
      protected override Element MakeSeriesElement(TimeSeriesChart chart,
                                                   PlotPane pane, 
                                                   IEnumerable<CandleSample> data,
                                                   int xStart, 
                                                   float minScale,
                                                   float maxScale,
                                                   int maxSampleWidth,
                                                   out int fitSamplesCount)
      {
        var points = new List<Point>();
       

        var pxTotalHeight = (int)(pane.Height / pane.Zoom);
        var pxPrice = (float)pxTotalHeight / (maxScale - minScale);

        fitSamplesCount = 0;
        var x = xStart+(maxSampleWidth / 2);
        var xcutof = chart.VRulerPosition == VRulerPosition.Right ? pane.Width - 1 - chart.VRulerWidth : pane.Width;
        foreach(var candle in data)
        {
          var midPrice =  MidLineType==Temporal.MidLineType.HighLow ? 
                       (candle.LowPrice + ((candle.HighPrice - candle.LowPrice) / 2f)) :
                       (Math.Min(candle.OpenPrice, candle.ClosePrice) + (Math.Abs(candle.OpenPrice - candle.ClosePrice) / 2f));
          
          
          var y = pxTotalHeight - (int)((midPrice-minScale) * pxPrice);
          points.Add( new Point(x, y));

          
          x += maxSampleWidth;
          x++;
          if ((x*pane.Zoom)>=xcutof) break;
          fitSamplesCount++;
        }

        return new CandleMidLineElement(this, pane, points.ToArray());
      }
コード例 #7
0
ファイル: CandleMidLineView.cs プロジェクト: vlapchenko/nfx
 protected override Elements.Element MakeSampleElement(TimeSeriesChart chart, PlotPane pane, CandleSample sample, int x, float minScale, float maxScale)
 {
   return null;
 }
コード例 #8
0
ファイル: Series.cs プロジェクト: yhhno/nfx
        /// <summary>
        /// Returns how many samples fit
        /// </summary>
        internal int BuildViews(TimeSeriesChart chart, int maxSampleWidth)
        {
            var fitSamples = 0;
              foreach(var view in m_Views.OrderedValues.Where( v => v.Visible))
              {
            var pane = chart.Panes[view.PaneName];
            if (pane==null)
             throw new WFormsException("Pane '{0}' not found in chart".Args(view.PaneName));

            var fit = view.BuildElements(chart, pane, this, maxSampleWidth);
            if (fit>fitSamples)
             fitSamples = fit;
              }

              foreach(var child in m_Children.OrderedValues.Where( c => c.Visible))
               child.BuildViews(chart, maxSampleWidth);

              return fitSamples;
        }
コード例 #9
0
ファイル: SeriesView.cs プロジェクト: vlapchenko/nfx
 /// <summary>
 /// Override to build elements that render the data by adding drawable elements to the chart.
 /// Returns how many samples could fit
 /// </summary>
 public abstract int BuildElements(TimeSeriesChart chart, PlotPane pane, TimeSeries series, int maxSampleWidth);
コード例 #10
0
ファイル: CandleMidLineView.cs プロジェクト: zhabis/nfx
 protected override Elements.Element MakeSampleElement(TimeSeriesChart chart, PlotPane pane, CandleSample sample, int x, float minScale, float maxScale)
 {
     return(null);
 }
コード例 #11
0
 internal TimeScalePane(TimeSeriesChart chart)
 {
     m_Chart      = chart;
     m_TimeCursor = new TimeCursorElement(this);
     TickSpace    = DEFAULT_TICK_SPACE;
 }
コード例 #12
0
 /// <summary>
 /// Override to build elements that render the data by adding drawable elements to the chart.
 /// Returns how many samples could fit
 /// </summary>
 public abstract int BuildElements(TimeSeriesChart chart, PlotPane pane, TimeSeries series, int maxSampleWidth);
コード例 #13
0
ファイル: TimeScalePane.cs プロジェクト: vlapchenko/nfx
 internal TimeScalePane(TimeSeriesChart chart) : base()
 {              
   m_Chart = chart;
   m_TimeCursor = new TimeCursorElement(this);
 }
コード例 #14
0
 protected override Elements.Element MakeSampleElement(TimeSeriesChart chart, PlotPane pane, CandleSample sample, int x, float minScale, float maxScale)
 {
     return(new CandleBuySellElement(this, pane, sample, x, minScale, maxScale));
 }