Jump to content
Software FX Community

Axis Title Content Refresh


Recommended Posts

As part of a chart Reset/ReInit/Refresh operation, I have written code to programmatically set the Axis.Title.Content property to a new value.  The dynamic title works fine on the first pass or layout chart, but upon user chosen operation and chart refresh, the axis title does not show.  I inspected the Content and Visibility property variables before refresh at runtime using the debugger, and there are indeed appropriate values.

I perform the  refresh using the Chart.Refresh() method.  Is there another property I must set before refresh?

Thoughts?  Hints?  Tips?



Link to comment
Share on other sites

Is it possible you are creating new Y axes in your reset/refresh operation? I tried the following code in a button

int n;

if (chart1.AxisY.Title.Content == null)   n = 0;else   n = (int) chart1.AxisY.Title.Content;

chart1.AxisY.Title.Content = n + 1;

This works fine everytime you press the button so I think it is possible a new Y axis is being created (either in your code or as a result of how you are refreshing the chart).



Link to comment
Share on other sites

Here is the general template...

Reset(); // calls Chart.Series.Clear()

InitPlot(); // programmatically binds to DataContext since it can hold arbitrary number of series

Refresh(); // calls Chart.Refresh()

In my Reset() method, I perform a Chart.Series.Clear() operation.  I added a button and event handler to perform the increment and title set operations you described and this works as long as I do not previously clear the series data in the Reset().

I understand that the Series represents the underlying chart data, and it appears that there is an dependency event fired when the Series.Count == 0 because I wrote a loop to emulate Series.Clear and the effect was the same.  The legend appears just fine as do the series of points upon reset/reinit/refresh.  But is there a way to pin both the x- and y- axis?

Many Thanks,


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...