Jump to content
Software FX Community

How to enable scroll bar and How to set background color


Recommended Posts

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;



Link to comment
Share on other sites

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;



Link to comment
Share on other sites

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?



Link to comment
Share on other sites

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.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...