Drawing time series with ImGui
You will find charts with two-dimensional time series in many places. A graphical drawing is easier to understand, compared to a table of numbers. In Figure 12.5, a simple example of a time series chart is shown:
Figure 12.5: An example of a time series chart
For the X axis of the chart, an ascending time will be used. On the Y axis, the value for a specific time is drawn as a point, and all the points are connected by lines thereafter. The result is a single line from left to right, enabling us to detect possible correlations between different time points, which is easier than just having a column of numbers.
Figure 12.6 shows a plot of a sine wave made in ImGui. The basic principle is the same as for the preceding time series – the horizontal X axis of the chart is the time value, and for every point in time, a value on the vertical Y axis can be set:
Figure 12.6: A plot of a sine wave...