I'm using Teechart(.Net 2009) in a project, and I found something weird happening when I draw a box with specific double points.
This is my xaml code to reproduce the problem.
<Window x:Class="WpfApplication1.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="MainWindow" Height="350" Width="525">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition/>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<WindowsFormsHost x:Name="chartHost"/>
<WindowsFormsHost x:Name="chartHost2" Grid.Column="1"/>
</Grid>
</Window>
This is the behind code for the above xaml file.
public partial class MainWindow : Window
{
public MainWindow()
{
InitializeComponent();
SetChart(new[] { 0.5685, 0.7141, 0.7301, 0.748, 0.7847, 1.2127 }, chartHost);
SetChart(new[] { 0.5686, 0.7141, 0.7301, 0.748, 0.7847, 1.2127 }, chartHost2);
}
private void SetChart(double[] values, WindowsFormsHost host)
{
var chart = new TChart();
var box = new Box(chart.Chart);
box.Add(values);
box.ExtrOut.HorizSize = 0;
box.ExtrOut.VertSize = 0;
box.MildOut.HorizSize = 0;
box.MildOut.VertSize = 0;
chart.Axes.Left.Maximum = 1.2;
chart.Axes.Left.Minimum = 0.5;
host.Child = chart;
}
}
The result looks like this. (Please click the link to see the captured image. I currently cannot attach image due to the reputation limit.)
http://www.flickr.com/photos/99238307@N06/9341426974/
Surprisingly, the only difference between two charts is that the first double value of each chart's data. The first double value of the left looks-ok-chart is 0.5685 and another one uses 0.5686 which sounds not that big difference. The 0.0001 made the right chart weird. I didn't try to use UseCustomValues property of the Box series and I don't want to use that.
Anybody knows how to draw the chart correctly with both two data set?