CPTScatterPlotInterpolationLinear와 동일한 Y 좌표를 갖는 순차적 선분을 그리고 CPTScatterPlotInterpolationCurved가없는 순차 선분을 그릴 수 있어야합니다. CPTScatterPlotInterpolationCurved는 모든 선을 곡선으로 그립니다. 현재 다중 플롯을 추가하여이 작업을 수행하고 있습니다.core-plot CPTScatterPlotInterpolationCurved와 CPTScatterPlotInterpolationLinear를 조합하면
public List<CorrectedGraphPoints> GetCorrectDataPoints(List<PointF> dataSource)
{
int lastIndex = 0;
bool shouldLoop = true;
CPTScatterPlotInterpolation interpolation = CPTScatterPlotInterpolation.Curved;
List<CorrectedGraphPoints> OuterList = new List<CorrectedGraphPoints>();
if (dataSource [0].Y == dataSource [1].Y)
interpolation = CPTScatterPlotInterpolation.Linear;
while (lastIndex+1 != dataSource.Count) {
OuterList.Add (new CorrectedGraphPoints (interpolation));
while (shouldLoop)
{
OuterList[OuterList.Count -1].Add(dataSource[lastIndex]);
if ((lastIndex + 1) < dataSource.Count) {
if (interpolation == CPTScatterPlotInterpolation.Linear) {
if (dataSource [lastIndex].Y != dataSource [lastIndex + 1].Y) {
interpolation = CPTScatterPlotInterpolation.Curved;
shouldLoop = false;
break;
}
}
if (interpolation == CPTScatterPlotInterpolation.Curved) {
if (dataSource [lastIndex].Y == dataSource [lastIndex + 1].Y) {
interpolation = CPTScatterPlotInterpolation.Linear;
shouldLoop = false;
break;
}
}
}
else {
shouldLoop = false;
break;
}
if (shouldLoop)
lastIndex++;
}
shouldLoop = true;
}
return OuterList;
}
public class CorrectedGraphPoints
{
private List<PointF> points;
public List<PointF> Points { get { return points; } }
private CPTScatterPlotInterpolation interpolation;
public CPTScatterPlotInterpolation Interpolation { get { return interpolation; } }
public CorrectedGraphPoints(CPTScatterPlotInterpolation interpolation)
{
this.interpolation = interpolation;
points = new List<PointF>();
}
public void Add(PointF point)
{
points.Add (point);
}
}
그러나 fill을 사용하는 여러 개의 플롯을 만들면 응용 프로그램이 크게 느려집니다. 내가 이것을 얼마나 많이 할 수 있는지 궁금해했다. 섹션의 보간법을 변경하는 방법을 찾지 못했습니까 ?? 이것이 코어 플롯의 문제일까요, 아니면 논리 또는 코드에 문제가 있습니까?
어떻게 더 잘 설명 할 수 있을지 확신 할 수 없습니까? – CubanAzcuy
예를 들어 x = 0, 1, 2 및 3에 점이 있고 1과 2 사이의 곡선을 원할 경우 점을 (예 :) 1.25 (@ 인덱스 2), 1.5 (@ 3) 및 1.75 (@ 4), 2와 3의 점을 인덱스 5와 6으로 이동하십시오. –