2012-07-26 313 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軸的內容。(270度旋轉)

回答

2

我不知道你的第二個要求(旋轉),但限制你的ÿ軸值,則可以使用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

感謝您的關心,您的答案似乎工作正常。第二個要求不再需要。萬分感謝!! – 2012-11-02 06:51:51

+0

不是問題:) – 2012-11-02 13:31:19