ryanlcs Posted July 21, 2009 Report Share Posted July 21, 2009 Hi How can I set the scroll bar option on and off and how can I set the charts background color? It seems hardly to get documents on charts fx. Thanks Quote Link to comment Share on other sites More sharing options...
ryanlcs Posted July 21, 2009 Author Report Share Posted July 21, 2009 To be precise, i wanted the entire background of the chart with a color and the plotted area with another color. Thanks. Quote Link to comment Share on other sites More sharing options...
JuanC Posted July 21, 2009 Report Share Posted July 21, 2009 To change the entire background of the chart chart1.Background = Brushes.Yellow; To change the plotted area background chart1.PlotArea.Background = Brushes.Red; Note that the defaul style (glass) has some effects drawn on top of the background, you can switch to the Simple or Basic style if you want complete control. chart1.Style = ChartFX.WPF.Motifs.Simple.Style; JuanC Quote Link to comment Share on other sites More sharing options...
JuanC Posted July 21, 2009 Report Share Posted July 21, 2009 To enable scroll bars you have 2 options 1) If you know you will have a lot of points and you want to see 10 at a time you would use chart1.AxisX.SetScrollView(1, 10); 2) Alternatively, you can specify the minimum number of pixels a bar will occupy (note that this actually means the bar + some of its surrounding space which is controlled by Series.Volume) chart1.AxisX.PixelsPerUnit = 20; Regards, JuanC Quote Link to comment Share on other sites More sharing options...
SameerKhan Posted July 24, 2009 Report Share Posted July 24, 2009 We have subscribed to the DataBound event on the Chart and use this event to readjust the scroll view. But we think there is some kind of a race condition which is causing application crashes and we get index out of bound exceptions. We calculate the total points that are in the chart at the time we add a series to the chart using the Chart.Data.Points property, and use this information to set the range of our scroll view. Also we notice that when a series is removed from the Chart the total data points doesn't necessarily go down. What would be the correct way to solve our problem? Thanks, -S 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.