WPF Trend Line from Custom Tool Class?


Author
Message
Matthew Crider
Matthew Crider
Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)
Group: Forum Members
Posts: 0, Visits: 78
I am writing a WPF app and using the WPF Chart control. I have a custom tool class derived from NDragTool. In the MouseUp() handler, I'm trying to add a trend line to a chart control already populated with a data set. My code looks like this:

    var tradingChart = chartControl.Charts[0] as NCartesianChart;
    var newFreeTrendLine = new NTrendLine();
    newFreeTrendLine.BeginPoint = new NPointD(0.0f, 0.0f);
    newFreeTrendLine.EndPoint = new NPointD(100.0f, 100.0f);
    var trendLineStrokeStyle = new NStrokeStyle(10.0f, NColor.FromString("Blue"), LinePattern.Solid, 0, 1);
    newFreeTrendLine.StrokeStyle = trendLineStrokeStyle;
   if (tradingChart.Series.Count > 1)
    {
      tradingChart.Series.RemoveAt(0);
    }
    tradingChart.Series.Insert(0, newFreeTrendLine);
chartControl.Refresh();

I'm not seeing a trend line when I refresh. Can you tell me what I am doing wrong?
GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...





Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search