Setting a fixed width domain for a TimeSeries plot in JFreeChart - charts

I've a dynamic timeseries chart to which some value is added every 20 seconds. I want to set the width of the plot to something like say 30 minutes so that my chart starts showing a "30-min canvas/plot" starting from the left hand side until it fills up the whole plot. After every 30 minutes, I want to clear up the old data and only show the latest 30 minutes data which means at any given point of time, my chart will only show data of latest 30 minutes. I've already created chart and its working great except that the starting domain range gets fixed to the point from where it started even after couple of hours.

Get upperbound after 30 minutes, then set lowerbound to the upperbound and the new upperbound to the old upperbound+30minutes?
http://www.jfree.org/jfreechart/api/javadoc/org/jfree/chart/axis/ValueAxis.html#getUpperBound%28%29

Related

How to initialize iOS Charts to show data points at a specific x-axis range, e.g. last 6 months from today?

I have a question about iOS Charts by Daniel Cohen Gindi here. The figure below shows my full dataset drawn out as a scatter chart. With the x-axis labels going from January to December (let's say 2018), and then again January to December (2019).
The problem is that I don't want to show all data in range, but just in the past six-month range, July-December, as I want the scatter chart view to look like depicted below. (Note: assume the right-most data point is today.)
I want the user to be able to scroll right to see more data points in the past. I've tried this Swift code below but it would "lock" the x-axis to show July-December, and the user can't scroll right to see past data:
#IBOutlet weak var scatterChartView: ScatterChartView!
scatterChartView.xAxis.axisMinimum = 17.5 // + or - 0.5 for padding
scatterChartView.xAxis.axisMaximum = Double(months.count) - 0.5
And then I would try this code below but it would initially show data from the first 6 months, January-June of 2018. However, the user could scroll left to see the later months.
scatterChartView.setVisibleXRangeMaximum(6)
Close but not quite. Is there any way I could show data from the last 6 months upon loading the scatter chart, and have the user scroll right to see past data?
I found the answer!
scatterChartView.moveViewToX(17.5)
Per documentation, moveViewToX(float xValue) – Moves the left side (edge) of the current viewport to the specified x-value. The view port refers to "what is visible on the chart, aim of the view).
Upon chart loading, the viewport is initialized showing the most recent 6 months, and I can scroll right to see past data.

Tableau constant reference line issue when changing date range

I have a few reference lines showing the previous year's averages. The problem I'm running into is when I select a smaller date range (like 10 days vs 90 days) the chart just cuts to that date range instead of resizing the entire chart so that you can look closer at the selected days. Is there a way around this?
This is not how I'd like it to look when I isolate down to a smaller timeframe:
Resolved...changed the date to discrete that fixed the issue.

How do you change the axis for time in charts?

Using google sheets, I am trying to plot times between 9pm and 3am (sleeping time every night), with the x axis being each calendar date/day.
But the scale puts items just after midnight at the bottom of the y-axis (y is the time axis, x axis is the day), because of the timing (0:10) is 10 minutes later than midnight and I want it to reflect that on the graph.
The two graphs are waking and sleeping times.
Waking makes sense, sleeping does not:
The only way seems to be put an if else and change format completely converting time format to integer and then multiplying to get a number close to 24 hrs (and then 1am is 25, 2 am is 26, etc).
Is there not a simpler was to change the axis for time? Does no one else log times either side of midnight?
The two images below show the formula, and the chart data:

How to Draw Pie chart based on time entries in google sheet

Given the data arrangement in the image below (from google sheet) I tried to draw a chart showing time consumed by each activity, each activity has a start time, the end time of an activity is the start time of the next activity, I couldn't find a way to visualize such arrangement, is it possible ?
Update: Solution
This is what I reached now
Also I don't have to write end time, here is how I did it
End
=INDIRECT(ADDRESS(ROW()+1,COLUMN()-1))
Duration
=C:C-B:B
Minutes
= D:D * 24 * 60
Note: To draw the chart I had to move the "Minutes" column to the right, i.e labels column has to be on the left for the chart to draw properly.
After that you can hide helping columns C and D as they are just created for intermediate steps.
Yes, you may build a Pie chart based on time entries, but you need to convert time format into number format.
select column with time
go to menu Format → Number → Number
Or, for more visual, convert time formatted numbers into number of minutes:
= Time * 24 * 60
And then draw chart:

Can I develop Sliding Dashboard Using SSRS 2008

I need to develop a dashboard that will be displayed in a flat screen hanging from the wall. Not on a PC (of course, behind the cabinet or something there is a PC, but I mean, without any user involvement).
But the info to display does not fit a single screen, so I need to have 4-5 screens sliding / rotating with the info.
Is that something that can be done using SSRS 2008?
If yes, how?
If not, do you have good free/low-cost suggestions?
Thanks.
Create the 4/5 'screens' within their own Rectangle in the one report
Set the AutoRefresh property of the report to x number of seconds you want for the rotation to occur.
Based on the AutoRefresh length you have set, set the visibility of the various rectangles based on a formula.
Example
Set AutoRefresh to 15 seconds
We will assume you have 4 rectangles/'slides'
Therefore, each slide will be shown once every minute
We set the visibility of each rectangle independently using an IIf() function and testing the current time with the Now() function
Rectangle 1
=IIf(Second(Now()) < 15, False, True) the rectangle will show if the AutoRefresh occured during the first 15 second block of the current minute, all other times during that minute it will be hidden.
Rectangle 2
=IIf(Second(Now()) >= 15 AND Second(Now()) < 30, False, True) the rectangle will show if the AutoRefresh occurred during the second 15 second block of the current minute, all other times during that minute it will be hidden.
Rectangle 3
=IIf(Second(Now()) >= 30 AND Second(Now()) < 45, False, True) the rectangle will show if the AutoRefresh occurred during the third 15 second block of the current minute, all other times during that minute it will be hidden.
Rectangle 4
=IIf(Second(Now()) >= 45, False, True) the rectangle will show if the AutoRefresh occurred during the fourth 15 second block of the current minute, all other times during that minute it will be hidden.
Other combinations can be done for the IIf() looking at the current Minute() or current Hour(). The Mod() function could also be used to show things every say 5 minutes as well.
I don't think you can do this in SSRS 2008 on it's own. However you could simply render you report pages as images and then use a free slideshow tool (picasa is good but there are lots available) to play a slide show of the images.
Alternatively you could put together a webpage to rotate the images but I'm taking the easiest, least technical route here.
If the data needs to be 'live' then you could create a subscription to run the report(s) every xx number of minutes or whatever you need. Set the output type to TIFF and use a windows file share as the delivery method. You can also get it to overwrite existing files, so you'll end up having 4 or 5 images being overwritten every xx number of minutes.
Of course there are much more elegant ways of doing this but if you want to use SSRS and want it cheap and cheerful then this is at least an option.
Good luck!
Al.