We have a product that is at least one of the most well known engineering tools for industrial purpose.
So that we are using your control might be a very good reputation for Steema.
Before switching over to another chart control here is another chance for you to fix your bugs or to provide us applicable workarounds ( not by changing our setup into line.Add(xArray, penetrationValues); ).
Setup:
In our industrial world the most common case is to have constant series/lines in the range of double.MinValue and double.MaxValue. They might change to non constant series/lines, but that is not predictable. For several reasons we use distinct lines/series per custom axis. I guess that is a common setup for people that want to hide ( visible=false ) certain series/lines and have the need to show the axis labels only for one series. We also focus and color the complete axis according to the corresponding series/line.
Hint:
We are currently using an older Version ( 4.1.2010.11302 ), but the same problems also occur with the latest version ( TeeChart for .NET v2012 [28 SEP 2012] RELEASE 4.1.2012.09280 ).
List of known problems where we haven't found a workaround yet:
1.
- Why is the same label value shown several times ( sometimes and sometimes not )? Expected is just one '0' or .. -2 -1 0 1 2 .. and so on:
- (Constant) lines/series are mutually shifted to each other when panning as seen in the video:
http://img402.imageshack.us/flvplayer.s ... joceysudhl
- Utils.cs::SignificantDifference() crashes with constant lines with values bigger than 1.0e+015.
Just uncomment the penetrationValues 1.0e+015, -1.0e+015, 1.0e+016, -1.0e+016, ... :
Code-Snippet:
Code: Select all
#region / Fields /
System.Windows.Forms.Timer timer;
int currentVertAxisIdx = -1;
#endregion / Fields /
#region / C'tor /
/// <summary>
/// Initializes a new instance of the <see cref="Form1"/> class.
/// </summary>
public Form1()
{
InitializeComponent();
InitializeChart();
timer = new System.Windows.Forms.Timer();
timer.Interval = 2000; // every 2 seconds
timer.Tick += new EventHandler(timer_Tick); // switches the current visible custom axis
timer.Enabled = true;
ForceDraw();
}
#endregion / C'tor /
#region / Init /
double[] penetrationValues = {
-1.0, 0.0, 1.0,
1.0e+014, -1.0e+014,
/* this values lead to chart crashes
1.0e+015, -1.0e+015,
1.0e+016, -1.0e+016,
*/
};
private void InitializeChart()
{
tChart1.Aspect.View3D = false;
int samples = 10;
foreach (var val in penetrationValues)
{
var constantLine = new Steema.TeeChart.Styles.Line();
var constantLineAxis = new Steema.TeeChart.Axis();
constantLine.Chart = tChart1.Chart;
SetAxisColor(constantLineAxis, constantLine.Color);
constantLine.CustomVertAxis = constantLineAxis;
constantLineAxis.Labels.Style = AxisLabelStyle.Value;
tChart1.Series.Add(constantLine);
tChart1.Axes.Custom.Add(constantLineAxis);
for (int i = 0; i < samples; i++)
constantLine.Add(i, (double)val); // adds a constant signal
}
AddRefLine(samples);
}
private void AddRefLine(int samples)
{
var referenceLine = new Steema.TeeChart.Styles.Line();
var referenceAxis = new Steema.TeeChart.Axis();
referenceLine.Chart = tChart1.Chart;
SetAxisColor(referenceAxis, referenceLine.Color);
referenceLine.CustomVertAxis = referenceAxis;
referenceAxis.Labels.Style = AxisLabelStyle.Value;
tChart1.Series.Add(referenceLine);
tChart1.Axes.Custom.Add(referenceAxis);
referenceLine.Add(0, -1.0e+014);
referenceLine.Add(samples - 1, 1.0e+014);
}
. . .
#endregion / Init /
. . .
#region / Timer Handling /
void timer_Tick(object sender, EventArgs e)
{ // shuffles through the available axis
foreach (var ax in tChart1.Axes.Custom.Cast<Axis>())
ax.Visible = false;
if (currentVertAxisIdx + 1 < tChart1.Axes.Custom.Count)
currentVertAxisIdx++;
else
currentVertAxisIdx = 0;
Axis currentAxis = tChart1.Axes.Custom[currentVertAxisIdx];
currentAxis.Visible = true;
ActiveVertAxis = currentAxis;
ForceDraw();
}
#endregion / Timer Handling /