简体   繁体   English

(时间-)图表中的可变时间轴

[英]Variable time axis in (time-)charts

I have built an energy flow simulation for factories in Anylogic.我在 Anylogic 中为工厂建立了能量流模拟。 I would like to do a detailed analysis in the Anylogic model (not in Excel), looking at energy flows that I currently plot in a chart over the whole year at other levels of detail.我想在 Anylogic model(不在 Excel 中)中进行详细分析,查看我目前在其他详细级别的图表中的 plot 中的能量流。 For example, I would like to look at the energy profile of the same graph with a time axis that represents only one month, one week, or as the smallest unit, one day.例如,我想查看同一图表的能量曲线,其时间轴仅表示一个月、一周或作为最小单位一天。 Ideally, I can still change the time period after the simulation has run through.理想情况下,我仍然可以在模拟运行后更改时间段。

My first approach was to simply create different graphs and link a parameter, eg the month, to the visibility of the graph.我的第一种方法是简单地创建不同的图表并将参数(例如月份)链接到图表的可见性。

However, the effort is very large, since I would have to create 365 diagrams just to be able to display each day.但是,工作量非常大,因为我必须创建 365 度图表才能每天显示。 Does anyone of you know a way to automate this chart creation or a way to make the x-axis of charts more flexible.你们中是否有人知道自动创建此图表的方法或使图表的 x 轴更灵活的方法。 Are there already solutions for this problem or does anyone know how this could work?是否已经有解决此问题的方法,或者有人知道这是如何工作的吗?

Best Christoph最佳克里斯托夫

The easiest way is to:最简单的方法是:

  • have 1 time plot only (with no dataset at all initially)只有 1 次 plot (最初根本没有数据集)
  • have a dataset that stores all your data (x values are days, y values your data for the day)有一个存储所有数据的数据集(x 值是天,y 值是当天的数据)
  • use a function to create your own custom dataset mySpecificDS using DataSet mySpecificDS = new DataSet(numberOfDays) (see help to see how to code datasets directly) --> this should cover only the time period of interest from your full dataset that contains all days使用 function 创建您自己的自定义数据集mySpecificDS使用DataSet mySpecificDS = new DataSet(numberOfDays) (请参阅帮助以了解如何直接对数据集进行编码)--> 这应该仅涵盖包含所有天的完整数据集中感兴趣的时间段
  • add your custom mySpecificDS to your chart using plot.AddDataSet(mySpecificDS)使用plot.AddDataSet(mySpecificDS)将您的自定义mySpecificDS添加到图表

You can remove old datasets from your plot as well using plot.remove(mySpecificDS) if you want to plot a new one.您可以使用plot.remove(mySpecificDS)从 plot 中删除旧数据集。

Check the help for those functions for more info查看这些功能的帮助以获取更多信息

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM