Need your advice!
I use TickCreationFunc and LabelTransformFunc to show timeline on XAxis
Something like this:
var plotCube = new ILPlotCube(tag, true);
List<Tuple<double, string>> ticks = null;
plotCube.Axes.XAxis.Ticks.TickCreationFunc = (min, max, qty) =>
{
ticks = AxisHelper.CreateUnixDateTicks(min, max, qty).ToList();
return ticks.Select(x => (float)x.Item1).ToList();
};
plotCube.Axes.XAxis.Ticks.LabelTransformFunc = (ind, val) =>
{
if (ticks != null)
return ticks[ind].Item2;
else
return null;
};
plotCube.Axes.XAxis.ScaleLabel.Visible = false; //does not help
The result is quite good however I could not find a way to remove the scale label

Two side questions:
1) VS shows warning 'ILNumerics.Drawing.Plotting.ILTickCollection.TickCreationFunc' is obsolete: '"Use TickCreationFuncEx instead!"'. However TickCreationFuncEx is never called.
2) Is there a way to tell ILNumerics not to abbreviate tick numbers?
Appreciate your help!
This warning is important. The scale label should go away if you use the new TickCreationFuncEx. The interface is very similar. But your function must return IEnumerable<ILTick>:
var plotCube = ilPanel1.Scene.First<ILPlotCube>();
List<Tuple<double, string>> ticks = null;
plotCube.Axes.XAxis.Ticks.TickCreationFuncEx =
(float min, float max, int qty, ILAxis axis, AxisScale scale) => {
ticks = CreateUnixDateTicks(min, max, qty).ToList();
return // return IEnumerable<ILTick> here!
};
// you should not need this
//plotCube.Axes.XAxis.ScaleLabel.Visible = false;
One cannot disable abbreviation completely. But you can specify the number of digits to show. Until 4.7 (due to a bug) you will have to use this:
ilPanel1.SceneSyncRoot.First<ILPlotCube>().Axes.XAxis.Ticks.MaxNumberDigitsShowFull = 10;
From version 4.8 you will not need SceneSyncRoot anymore and can go more straight:
ilPanel1.Scene.First<ILPlotCube>().Axes.XAxis.Ticks.MaxNumberDigitsShowFull = 10;
// or in your case just
plotcube.Axes.XAxis.Ticks.MaxNumberDigitsShowFull = 10;
Note: used XAxis in the code and not YAxis acc. to your example
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With