I've stared with this piece of code:
Code: Select all
private void tChart1_BeforeDrawSeries(object sender, Graphics3D g)
{
var sizeOfAxes = 30;
var visibleAxes = 0;
if (tChart1.Axes.Left.Visible)
visibleAxes++;
foreach (Axes axes in tChart1.Axes.Custom)
if (axes.Visible)
visibleAxes++;
tChart1.Panel.MarginLeft = sizeOfAxes * visibleAxes;
}
The big issue is that the chart only shows the big red cross all over when there exists a custom axes so that the foreach loop activates:
Code: Select all
foreach (Axes axes in tChart1.Axes.Custom)
if (axes.Visible)
visibleAxes++;
When there's some error in the chart so that the red cross appears, is there any way to programatically detect this state of the chart and reset it?
Cause
Code: Select all
tChart1.Series.Clear();
Code: Select all
tChart1.Clear();
Is there some way to calculate the needed horisontal space for each axes including labels and values? Perferably an in parameter to add in the sum
instead of multiplying visible axes with a fix space value (sizeOfAxes).