2014-05-11 2 views
-2

Windows Phone application에서 amchart를 사용하여 차트를 만들고 싶습니다.이 코드는 "이 코드는 암시 적으로 'string'을 'System.Windows.Media.Brush'로 변환 할 수 없습니다. "이Windows 전화 앱에서 차트 작성

InitializeComponent(); 

      XDocument data = XDocument.Load("Data.xml"); 
      var results = from query in data.Descendants("year") 
          select new ResultModel((string)query.Element("month"), 
          (int)query.Element("actual")); 
      var chart = new SerialChart 
      { 
       CategoryValueMemberPath = "month", 
       AxisForeground="White", 
       PlotAreaBackground="Black", 
        GridStroke="DarkGray" 
      }; 
      chart.SetBinding(SerialChart.DataSourceProperty, new Binding("results")); 

      var lineGraph = new LineGraph 
      { 
       Title = "Sales", 
       ValueMemberPath = "actual", 

      }; 

      chart.Graphs.Add(lineGraph); 
      sta.Children.Add(chart); 




     } 

답변

2

를 해결할 수있는 방법, 그 종류 브러시는 AxisForeground, PlotAreaBackground, GridStroke SerialChart 등의 속성이다. 따라서 다음과 같이 설정할 수 있습니다.

AxisForeground = new SolidColorBrush(Colors.White); 
PlotAreaBackground = new SolidColorBrush(Colors.Black); 
GridStroke = new SolidColorBrush(Colors.DarkGray);