2012-07-26 4 views
1

DateTime이 X 축이고 0에서 100까지의 숫자가 Y 축인 그래프를 플로팅하려는 응용 프로그램을 만듭니다.DynamicDataDisplay를 사용하여 그래프 축의 값 범위 설정

나는 다음과 같은 코드

 <d3:ChartPlotter.HorizontalAxis> 
     <d3:HorizontalDateTimeAxis Name="dateAxis"/> 
    </d3:ChartPlotter.HorizontalAxis> 
    <d3:ChartPlotter.VerticalAxis> 
     <d3:VerticalIntegerAxis Name="countAxis" /> 
    </d3:ChartPlotter.VerticalAxis> 


    <d3:Header FontFamily="Times New Roman" Foreground="SteelBlue" Content="Radiation Monitoring System"/> 
    <d3:VerticalAxis FontFamily="Times New Roman" Foreground="SteelBlue" Content="Radiation Number" HorizontalAlignment="Center" VerticalAlignment="Top" Height="346" Width="179" /> 
    <d3:HorizontalAxis FontFamily="Times New Roman" Foreground="SteelBlue" Content="Real time" HorizontalAlignment="Center" /> 

    </d3:ChartPlotter> 

을 사용하고 어떻게 0 사이의 Y-axisvalues ​​설정하는 가정입니다 - 100?

는 또한 우리가 보통 그래프에서 보는 바와 같이 Y 축의 내용을 설정해야합니다.

답변

2

나는 당신의 두 번째 요구 사항 (회전)의 모르겠지만, 당신의 Y를 제한 할 (270도 회전) 축 값을 사용하면 ViewPort.Domain을 사용할 수 있습니다. 도메인은 플로터의 범위를 설정합니다. 예 :

var axis = (DateTimeAxis)productPlot.MainHorizontalAxis; 
double yMin = 0; 
double yMax = 100;  
Rect domainRect = new Rect(xMin, yMin, xMax - xMin, yMax - yMin); 
//xMin and xMax are left to your discretion based on your DateTimeAxis 

plotter.ViewPort.Domain = domainRect; 

두 번째 요구 사항에 대해 더 자세히 설명 할 수 있다면 필자는 필요한 내용으로 내 대답을 업데이트하려고 최선을 다할 것입니다.

+0

귀하의 우려에 감사드립니다, 귀하의 답변은 잘 작동하는 것 같습니다. 두 번째 요구 사항은 더 이상 필요하지 않습니다. 엄청 고마워!! –

+0

문제 없음 :) –