2013-06-20 3 views
0

WPF 용 Visiblox Chart V 2.1 컨트롤을 사용하고 있습니다.Visiblox V 2.1 DateTime 축 형식 문제

밀리 초 값을 기준으로 데이터가 있습니다.

차트 축에 밀리 초 값을 표시하도록 visiblox DateTime 축의 형식을 지정하려면 어떻게해야합니까?

미리 감사드립니다.

답변

0

저는 LinearAxis와 비슷한 것을했습니다. DateTimeAxis에서 상속받은 자신 만의 축을 만들어야합니다. 나는 당신의 경우에 얼마나 다른 알고 있지만, 여기에 내가 LinearAxis에 대한 무슨 짓을했는지하지 않습니다

chart.XAxis = new IRLinearAxis() 
     { 
      ... 
      ShowLabels = true, 
      LabelFormatString = "feet",//This only works because I overrode the format function in the IRLinearAxis class 

     }; 

그리고 클래스 :

class IRLinearAxis : LinearAxis 
{ 
    protected override string GetFormattedDataValueInternal(double dataValue, string formatString) 
    { 
     return String.Format("{0} " + formatString, base.GetFormattedDataValueInternal(dataValue, ""));//ignore the formatString and just use the units that were passed as the formatString 
    } 

} 

내가 더 우아한 방법이있을거야 당신의 유닛을 통과시키고 포맷팅을 유지하기 위해, 그러나 이것은 나를 위해 일했습니다.

+0

여기 새로워서 말할 수 있습니다. 이 방법이 효과가 있다면, 이것을 허용 된 대답으로 선택하고 유용하다면 upvote를 선택하십시오. – NielW