FusionCharts/FusionTime stepline chart leaves off data points and binning aggregation distorts the data - charts

I'm trying to reproduce a Pillow app timeline chart using FusionTime. Pillow tracks sleep quality and the different sleep stages using Apple Watch. The following is an example chart:
example Pillow chart
From the app you can export a json file with the data points. For example:
"sleepStageDataPoints": [
{
"stage": 1,
"timeStamp": 673239278.32947648
},
`Stage legend: 0=Deep, 1=Light, 2=REM, 3=Awake
I import the data into mysql, converting the Unix time in the process. I also increment the stage number so that Deep=1, etc., because the axis would be 0 in FusionTime.
So there is a start time and the level of the stage at that time, which remains the level until the next timestamp data point where the stage would change, etc.
Besides this metric, there will be other health related metrics I plan to capture that will model the data in a similar way. Only the starting time and the level at that time, which should remain the same until the next data point.
So that's the general plan. Now the problems...
I'm having trouble figuring out the best way. I think stepline would be the best chart type for this source data. I'm not expecting to be able to have the different stages have different colors. Just being able to see the height differences is sufficient.
But FusionTime doesn't show all of the data points and the ones it does show don't seem to be accurate. I'm blaming data binning.
FusionTime chart
As you can see the first point charted is on May 3rd, 12:24-12:26. But there are 5 data points from May 2nd that it just leaves off. I don't know why. And as you can see from comparing the two charts, the patterns don't match. For instance at 1am the Fusion chart says the level would be REM (3), but if you look at the Pillow chart, it would have to be either Deep (1) or Light (2). Looking at the data points in the database confirms that.
So it has to be the data binning aggregation that is changing the chart. I've tried every aggregation other than average and none of them makes a difference.
I'd like for the data to be 100% time accurate. I want to see every datapoint and not have the first ones disappear. If I mouse over 1am I should see the correct stage level for that time. As I zoom in or out, I'd like the columns to get more wide/narrow as appropriate, but the height should never be wrong. If I zoom too far out, I'd rather the data disappear than be wrong. I'd be fine to lock the zoom level if necessary, not that I know how to.
Is this possible with FusionCharts/FusionTime? Would there be a better chart type to accomplish what I'm trying to do? Is there a different charting software that would do this? I want to use FusionTime, because I want to have the multivariate charts to compare multiple metrics along the same timeline. And I do want to be able to zoom in and out because other metrics I'm tracking wouldn't be limited to this time frame. So I need to be able to zoom/scroll through the entire day.

Related

How can I filter over a bar graph data while showing the average of the entire data set?

I am making an interactive dashboard in Tableau that looks something like this:
https://public.tableau.com/app/profile/monica.ionescu/viz/ExploringHIVStatisticsinSouthAmerica/Dashboard1?publish=yes
(for your best viewing experience, please view the dashboard in the fullscreen view - button on bottom right corner of the board)
I need some help with the bar chart.
I currently have a reference line in place to mark the two averages so that they don’t move as I filter through data. When using the average line feature, the filters on the left change all the graphs on the dashboard in real-time (and thus the average with it). So, it seems like the average line is built from the data points currently on display rather than all the data points in our data set.
I want to show the averages on the bar graph as they are in the image (a constant for the whole data set) without having to manually set the average each time I add/update the data.
How do I make it so that when I change the filters, the bar graph changes but the average stays constant?
Thank you so much!
You can self-blend the data sources - duplicate the data source, but DON'T join any fields/set up relationships. The lack of join can make the secondary source act as a constant.
Alternatively create a FIXED calculation to calculate the average. This should also act as a constant - just make sure none of your filters are in context.

Tableau add trend line to discrete data?

I have run into this more times then I like, and I think it will continuously haunt me. I am creating reports/dashboards that report monthly or yearly or weekly data. The dates come in with just the last day of the period. For example, now I am working 2019 monthly report that is a bar chart with a trend line. Took me about 15 minutes to make in excel. However, we are trying to move everything into Tableau for dashboards. Trend line is always grayed out when using discrete dates and sometimes when using continuous dates. The dates are in the format DD/MM/YYYY so I can convert them as continuous but that skews the spacing on the X-Axis. I have messed around to get it to work but it takes time. I am shocked that this very basic thing does not work when Excel has been able to do it for a very long time. Does anyone know of a good work around? I have tried calculated the trend line myself, but do not see how I can add in the y=mx+B line that is generated. I am debating creating a data set just for this, but that seems long and hard way for something that I would have expected out of the box. Below is some basic data, in Excel it takes about 1 minutes to create a line chart, click (+) add trend line and your done.
I was not able to deal with the skew of the X-Axis very well but playing with the date it started and setting the major tick marks to monthly got me close. Looking at the picture below you will see the tick marks are not in the center of the bars but close. As for the trend line, I added a Dual axis on the same data that was the sum of all shown fields with no division by the parts (this is a stack mark bar chart). Since this is a basic line chart with continuous dates, a trend line is a simple click. I then removed the Tick Markets and set the opacity to 0% making the line invisible. I did not change the trend line so now that is all you can see. Seems like a long and hard way to do it, but it works. (UPDATE) Better fix, NEVER USE EOM always use First of Month.

Tableau and modified Sankey diagram

I have been trying to recreate a modified Sankey based on Adam's work with the American Whiskey Viz and Beatles Analysis Viz that are found here:
https://public.tableau.com/s/gallery/beatles-analysis
https://public.tableau.com/s/gallery/american-whiskey-wheel
I am trying to create the same effect on my own data set. I am not sure how Adam was able to line up the sankey portion with the bar chart perfectly. I have tried many different ID2 field configurations and varying metric fields in the Curve calculated field options with no success. I haven't been able to get them to line up exactly. I would also like my bases to start in different locations along the sankey and not all originating from the left.
I realize that the examples are working with much smaller data sets but believe that this should still be possible with my data. I have tried Business ID in my curve formula and wondering if I need to have a more generic metric in my model. Andy uses Song ID which is a number between 1 and 45. My IDs range from 3-3000. You can see in the workbook attached how I am setting up these fields to get the curve of the Sankey. Is it possible to get them to line up with the barchart at the top of Dashboard 2?
UPDATE 3/22/16:
I was able to get the lines much closer to their bars by modifying the Curve-LoyaltyID2 field. I loaded it to Public for easier viewing. Some lines are still not aligning directly to their corresponding bars though.
Tableau Public
Thanks for any ideas you have!

How to update data changes in an already drawn SPSS graph

I have drawn several bar chart, scatter, and line graphs in SPSS 21 and spent lots of time on editing their look. But, I realized that I made some mistakes in data and they are already changed. In Microsoft excel, graphs are interactive/dynamic, meaning that they change if you modify the values of each cell. Can we mimic the same feature in SPSS 21? Is there any way I can update graphs without redrawing them from the scratch? I have saved them as output, but when I load them no change is reflected and the graphs are associated with old data.
I have saved syntaxes to produce the graphs, but when I run the syntax, the graphs are produced in standard looking that need lots of changes to look good. When I save chart templates and apply them to new charts, they don't look the same meaning that some of the changes are not applied.
Please help.
It is not possible. I feel you with making all the changes and the inconsistency in applying chart templates though. A few tips to mitigate this in the future are;
Do everything you can with GGRAPH and inline GPL statements to get the look of the chart close to how you want it.
Start with a chart template that is closer to your typical end goals. (See here on how to make some simple edits to the default template).
Some things are still difficult to fully automate like label placement in the chart. These simple tips though get me very close to the end goal, and only rarely do I need to take the time to polish a chart with editing post-hoc.

Need more control over Pentaho PI chart slices

Pentaho gives you the option of easily generating a PI chart using it's report designer. I have a query that can return the following values
Over Inflated
Under Inflated
Within Specification
These values will each represent a slice within the PI chart. I have two problems.
Problem number 1
I have a query returning the following,
Over Inflated
Within Specification
Within Specification
Over Inflated
Over Inflated
Over Inflated
Note that the results do not include a single value that is equal to Under Inflated. This will result in a pie chart as indicated below.
I need the pie chart to indicate to the user that there is also a third slice represented within this chart (Under Inflated). Even though the value for Under Inflated records is 0%.
Problem number 2
Pentaho gives you the option to specify the colors of the slices. I need to link the colors of the slices to a specific value. For instance Over Inflated should be displayed as red, Under Inflated should be displayed as orange and Within Specification should be displayed as green.
Is there any way in Pentaho to do this?
There is no easy way to bind colours in PRD other than by ensuring the data is in a consistent sort, and defining the colours in that order - i.e. it wont always work.
However saying that you can bind the actual data values if you use a beanshell chart processing script.
To get the 0% slice appear you just ensure your data set returns it. So the best way to do this is just to outer join from your dimensions to the actual data, then you'll always get the 3 values - even if one is zero.
If you want more/ultimate control you could move to ccc charts. PRD is moving to ccc charts in the future anyway - but unfortunately the only way to use these currently would be to link via CGG - not a perfect scenario (not least of all because that needs a running server too). But a possibility.