Jump to content
Software FX Community

Unable to set X-Axis labels via xaml or procedural. or at all!


ssinclair

Recommended Posts

I can't seem to set the x-ais labels after setting the itemSource for the chart.  I can only set them in procedural code.  can you databind to the x-axis for the x-axis labels.  I checked the help file and tried doing a procedural code approach and nothing works.  I saw the there is a invalidation problem, where sometme if I resize the chart the labels will display, but again in this case it will only display if there is no data.  here is the code:

 This is in a button click event to populate the chart:

List<double> _values = new List<double>();

_values.Add(.07);

_values.Add(.10);

_values.Add(.22);

_values.Add(.17);

_values.Add(.19);

chart1.Series.Clear();

chart1.PointCount = _values.Count;

//chart1.Series.Clear();ChartFX.WPF.SeriesAttributes series = new ChartFX.WPF.SeriesAttributes();

series.ItemsSource = _values;

chart1.Series.Add(series);

 

 

chart1.AxisX.LabelVisibility = ChartFX.WPF.AxisLabelVisibility.Visible;

 

for (int i = 0; i < _values.Count; i++)

{

chart1.Series[0].AxisX.Labels = String.Format("{0:0%}", _values);

//chart1.AxisX.Labels =

}

chart1.InvalidateVisual();

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...