2017-02-28 3 views
-3

대신 선형 차트를 만들려면 스플라인 차트를 작성해야합니다. 나는 WPF가 splineseries를 직접 제공하지 않는다는 것을 알고있다.WPF 스플라인 곡선 차트 템플릿을 사용하여 라인 집합

라인 그래프 차트를 사용자 정의 (템플릿)하여 커브 그래프를 표시하려면 어떻게해야합니까? 제 3 회 지불 도구를 사용하고 싶지는 않습니다. (물론 무료입니다)

감사

답변

3

당신이 스플라인 시리즈는 무엇을 의미하는 라인 시리즈를 부드럽게하는 경우, 당신은 OxyPlot를 사용할 수 있습니다. true이 될 수있는 LineSeries 및 설정 Smooth 속성을 사용

여기 예 :

public MainWindow() 
    { 
     this.InitializeComponent(); 
     var plotModel = new PlotModel { Title = "OxyPlot" }; 
     plotModel.Axes.Add(new OxyPlot.Axes.LinearAxis { Position = OxyPlot.Axes.AxisPosition.Bottom }); 
     plotModel.Axes.Add(new OxyPlot.Axes.LinearAxis { Position = OxyPlot.Axes.AxisPosition.Left, Maximum = 10, Minimum = 0 }); 
     var series1 = new OxyPlot.Series.LineSeries 
     { 
      MarkerType = MarkerType.Circle, 
      MarkerSize = 5, 
      MarkerStroke = OxyColors.White 
     }; 
     series1.Points.Add(new DataPoint(0, 6)); 
     series1.Points.Add(new DataPoint(1, 2)); 
     series1.Points.Add(new DataPoint(2, 4)); 
     series1.Points.Add(new DataPoint(3, 2)); 
     series1.Points.Add(new DataPoint(4, 7)); 
     series1.Points.Add(new DataPoint(6, 6)); 
     series1.Points.Add(new DataPoint(8, 8)); 
     series1.Smooth = true; 
     plotModel.Series.Add(series1); 
     this.Content = new OxyPlot.Wpf.PlotView() { Model = plotModel }; 
    } 

참고이 부분 : series1.Smooth = true;

+0

예이 무슨 의미가 있습니다. 고마워. 도움이된다. – Yogesh

관련 문제