mheydt Posted February 24, 2008 Report Share Posted February 24, 2008 Can anyone help me with how you configure the data (either in xmal or code) to get a HighLowClose chart to display? Quote Link to comment Share on other sites More sharing options...
JuanC Posted February 26, 2008 Report Share Posted February 26, 2008 Passing data using XML (hardcoded for simplicity) <XmlDataProvider x:Key="MyData"><x:XData><OHLCData xmlns=""><OHLC Low="20" High="30" Open="22" Close="26"/><OHLC Low="20" High="30" Open="26" Close="22"/></OHLCData></x:XData></XmlDataProvider>HighLowClose chart <cfx:Chart Gallery="HighLowClose" x:Name="chart1"><cfx:Chart.ItemsSource> <Binding Source="{StaticResource MyData}" XPath="OHLCData/OHLC" /></cfx:Chart.ItemsSource><cfx:Chart.Series> <cfx:SeriesAttributes BindingPath="@Low"/> <cfx:SeriesAttributes BindingPath="@Close"/> <cfx:SeriesAttributes BindingPath="@High"/></cfx:Chart.Series></cfx:Chart>OpenHighLowClose chart <cfx:Chart Gallery="OpenHighLowClose" x:Name="chart1"><cfx:Chart.ItemsSource> <Binding Source="{StaticResource MyData}" XPath="OHLCData/OHLC" /></cfx:Chart.ItemsSource><cfx:Chart.Series> <cfx:SeriesAttributes BindingPath="@Low"/> <cfx:SeriesAttributes BindingPath="@Open"/> <cfx:SeriesAttributes BindingPath="@Close"/> <cfx:SeriesAttributes BindingPath="@High"/></cfx:Chart.Series></cfx:Chart>The important part is the order of the series, this should be the same order if you are passing data in code, either manually passing data or creating a collection of CLR objects that represent the data. Regards, JuanC Quote Link to comment Share on other sites More sharing options...
mheydt Posted February 27, 2008 Author Report Share Posted February 27, 2008 Thanks, this worked great. One more question now. How do I specify different labels for the bottom axes? I want to put dates instead of the 0 .. 5 ... 10, .... Quote Link to comment Share on other sites More sharing options...
JuanC Posted February 27, 2008 Report Share Posted February 27, 2008 The axis on the bottom is the X axis (Chart.AxisX), if you have labels (dates or strings) you can use them as follows <XmlDataProvider x:Key="MyData"><x:XData><OHLCData xmlns=""><OHLC Low="20" High="30" Open="22" Close="26" Label="Jan"/><OHLC Low="20" High="30" Open="26" Close="22" Label="Feb"/></OHLCData></x:XData></XmlDataProvider>And inside the Chart tag you would add the following <cfx:Chart.AxisX><cfx:Axis LabelPath="@Label"/></cfx:Chart.AxisX> JuanC Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.