Thread ID: |
Created: |
Updated: |
Platform: |
Replies: |
140850 | Nov 11,2018 09:43 AM UTC | Nov 14,2018 09:57 AM UTC | WPF | 3 |
![]() |
Tags: SfChart |
public void GenerateData()
{
Data = new ObservableCollection<Model>();
Random rd = new Random();
for (int i = 0; i < 6; i++)
{
Data.Add(new Model()
{
XValue = 0,
YValue = rd.Next(0, 50)
});
}
} |
public class NumericalAxisExt : NumericalAxis
{
List<double> yValues = new List<double>();
protected override void CalculateVisibleRange(Size avalableSize)
{
base.CalculateVisibleRange(avalableSize);
..
if (actualyValues != null && actualyValues.Count > (int)range.Start && actualyValues.Count > (int)range.End)
{
for (int i = (int)range.Start; i <= range.End; i++)
{
yValues.Add(actualyValues[i]);
}
if (yValues.Count > 0)
{
double min = yValues.Min();
double max = yValues.Max();
VisibleRange = new DoubleRange(min, max);
}
}
var visibleInterval = CalculateNiceInterval(VisibleRange, avalableSize);
typeof(ChartAxis).GetProperty("VisibleInterval", System.Reflection.BindingFlags.NonPublic |
System.Reflection.BindingFlags.Instance).SetValue(this, visibleInterval);
}
} |
This post will be permanently deleted. Are you sure you want to continue?
Sorry, An error occured while processing your request. Please try again later.
This page will automatically be redirected to the sign-in page in 10 seconds.