C# 数字轴配置

C# 数字轴配置,c#,.net,ilnumerics,C#,.net,Ilnumerics,需要你的建议 我使用TickCreationFunc和LabelTransformFunc在XAxis上显示时间线 大概是这样的: var-plotCube=new-ILPlotCube(标记,true); 列表标记=空; plotCube.Axes.XAxis.Ticks.TickCreationFunc=(最小值、最大值、数量)=> { ticks=AxisHelper.CreateUnixDateTicks(最小、最大、数量).ToList(); 返回ticks.Select(x=>(fl

需要你的建议

我使用TickCreationFunc和LabelTransformFunc在XAxis上显示时间线

大概是这样的:

var-plotCube=new-ILPlotCube(标记,true);
列表标记=空;
plotCube.Axes.XAxis.Ticks.TickCreationFunc=(最小值、最大值、数量)=>
{
ticks=AxisHelper.CreateUnixDateTicks(最小、最大、数量).ToList();
返回ticks.Select(x=>(float)x.Item1.ToList();
};
plotCube.Axes.XAxis.Ticks.LabelTransferorMFunc=(ind,val)=>
{
如果(滴答声!=null)
返回刻度[ind].Item2;
其他的
返回null;
};
plotCube.Axes.XAxis.ScaleLabel.Visible=false//无济于事
结果是相当好的,但我找不到一种方法来删除规模标签

两个附带问题:

1) VS显示警告“ILNumerics.Drawing.Plotting.ILTickCollection.TickCreationFunc”已过时:“改用TickCreationFuncEx!”。但是,不会调用TickCreationFuncEx

2) 有没有办法告诉ILNumerics不要缩写记号数字

谢谢你的帮助

  • 这个警告很重要。如果使用新的
    TickCreationFuncEx
    ,则刻度标签应消失。界面非常相似。但函数必须返回
    IEnumerable


  • 注意:代码中使用了XAxis,而不是YAxis。根据您的示例

    谢谢Haymo,我用TickCreationFuncEx尝试了解决方案。问题是它从未被呼叫过。请告知可能出现的问题。您可能必须将不推荐的版本设置为null?Oherwise优先。您使用的是哪个版本?如果我将它们设置为null,则会得到“null引用异常”。我使用的是Nuget版本,我相信是3.3.3。ilPanel1.SceneSyncRoot.First().Axes.XAxis.Ticks.MaxNumberDigitsShowFull=10;有时会出现异常失败“序列不包含元素”似乎是竞争条件):
    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; 
    
    ilPanel1.SceneSyncRoot.First<ILPlotCube>().Axes.XAxis.Ticks.MaxNumberDigitsShowFull = 10; 
    
    ilPanel1.Scene.First<ILPlotCube>().Axes.XAxis.Ticks.MaxNumberDigitsShowFull = 10; 
    // or in your case just 
    plotcube.Axes.XAxis.Ticks.MaxNumberDigitsShowFull = 10;