Highcharts compare different dates ranges - highcharts

I'd like to use highstock to compare two different time ranges together.
For example, for two data sets, one that shows the max temp for each day in Jan and the other one for Feb (for example), I'd like them to be shown one above the other, with the x-axis being the "same" one for both.
I can't do it with categories, because the data is being fed automatically, so each data point has its own time, so the x-axis is datetime.
I wanted to know if it was possible to simply have two graphs overlapping, with one graph having the normal x-axis at the bottom, and the other one having on top of the graph, so even when the data is for different times, it's shown overlapping. I can't find this problem anywhere.

Found the answer on this thread. Hope it helps!
Overlay 2 series of data of different length with highcharts

Essential Chart can be used with different date ranges with multiple axes. example source
The community license provides the whole suite of products for free if you qualify.
Note: I work for Syncfusion.

Related

Data on a dual y-axis chart is not graphing properly. How do I fix it?

I'm trying to graph two data sets on the same graph with two different y-axis. They are both over the same overall time scale (~330 hours), but the individual observations are different. When I graph the data I get one set formatted and graphed correctly, but the other is squeezed all the way to the right of the chart.
Is there any way to fix this issue? Thanks
I've tried switiching which elasped hours is the x-axis, but it always results in one correctly graphed set and one messed up set.

Tableau line graph is separated into two panels and I want to combine these

Preface: I ALREADY KNOW ABOUT THE DUAL AXIS FEATURE. Unfortunately, this is not the solution I need.
I have a line graph of sales over the past year. The x-axis of my graph is delineated by months. However, since I want the months to appear in order (August 2020 to August 2021) I am forced to delineate by year in addition to months. This would be find, except there is a giant discontinuity in my graph between the year 2020 and the year 2021 in Dec/Jan. It looks as though my graph is separated into two separate panels based on year. Does anyone know how to combine these panels and eliminate the discontinuity?
Thanks in advance! :)
First only have one Date field on the columns shelf.
Then right click on that pill and select the second Month choice. You should get a green pill and one horizontal axis and a mark per Month/Year. That choice invokes the DateTrunc() function on your Date field (you can see by double clicking on the pill) and is displayed as continuous (green) by default.
People often say this choices causes the date to be treated as continuous - but that is only a side-effect, and can be changed. The more fundamental effect is that it calls DateTrunc() instead of DatePart() on your date field.

Google Sheets: How to make a stacked/aggregate chart

I have made a bar chart which aggregates my data, but is there any way I can split each bar based on the data it is aggregating - similar to how a stacked bar chart would look?
Here is a bad artists impression (thick blue lines mine). The idea is that it's important to know from looking at the graph if I sold 5 at £1, or 1 at £5.
Ideally this would work even if the price for each item is variable, but that is not essential (eg: if there is a 'hack' with hardcoding Apple = 3, I can live with that.)
I'm also fine inputting helper columns etc, within reason, but I would want to be able to easily continue to add things to the list on the left without having to add new helper columns each time (calculated ones are fine, of course.)
Thanks in advance.
UPDATE: With thanks to Kin Siang below, I ended up implementing a slightly modified version of their solution, which I am posting here for completeness.
I added a very large (but finite) number of helper columns to the right, with a formula in each cell which would look for the nth occurrence of the item in the main list (wrapped in an iferror to make the unused cells blank).
=iferror(index(FILTER($A:$B,$A:$A=$D2),E$1,2))
Theoretically it could run out of space one day, but I have made it suitably large that this should not be an issue. It has the advantage over the other solution that I do not need to sort or otherwise manipulate the input range and can continue trickling in data to the main list and have the chart automatically update.
Yes, it is possible to display the chart in your case, however need some data transpose in order to do so, let me show you the example with dataset
Assuming this is your original data:
First sort the data by alphabet, and enter this formula in new column
=if(G39="",1,if(G40=G39,I39+1,if(G40<>G39,1)))
Next add new column for categorical purpose, by using concatenate function
="Price"&I40
In the transform data for chart purpose, enter this formula to split all price into different row, different column for different product
=sumifs($H$40:$H$47,$G$40:$G$47,$A41,$J$40:$J$47,B$40)
After that i select stack bar chart and ensure the price in under series, in case in 23 will have some problem to set price at series correctly, you can use 33 data create stack bar chart and update the data range again, it will work also
Here is the cute chart you expected, accept if help :)
*When certain fruit has less price record, it is advised to fill in 0, as the data table need in same column (see the orange price 3), although I didnot test if blank

How to create two histograms on one plot with shared axis?

I tried to plot arrival delay and departure delay columns separately, it's clear the distributions are different.
I would like to show them on the same plot, but whenever I try to do so, both plots became one identical shaped distribution although I'm plotting two different columns! What am I doing wrong?
Thank you for your help in advance.
You need a Departure Delay (bin) field. You can create one by selecting Departure Delay in the data pane on the left sidebar and selecting Create bin.
Once you have that new field, you can place it on the Columns shelf next to the other bin field and just put SUM([Number of Records]) on the Rows shelf — getting rid of both CNT() fields.
That should let you see both histograms.
To answer your question about why your previous approach yielded the same chart, you were binning data in both cases by the Arrival delay.
The CNT([xxx]) fields are misleading. That just counts the number of records that have a non-null value in the [xxx] field. If [xxx] always has a value, its equivalent to SUM[Number of Records]). The bin field is what matters.

Where to set displayed data vs plotted data in Highcharts?

I am looking for a setting in Highcharts/stock that would allow me to apply a different format to displayed values of data, but not to the actual data as it is loaded into the series data. For example, we would like to plot y-axis data with precision up to 16 significant digits, and likewise, time values that use 6-8 sig figs. But that's not the precision we would like displayed in the tooltips, or other labels. However I am unable to find a way to format it without affecting both what is plotted and what is displayed. Here is an example of why this is a problem: let's say we have data points taken at .0001234s, .0001244s, .0001254s, and .0001264s, but we want to format the display of the time to ".0001" for all 4 data points. If we format it, then the "plotted" data ends up looking like it occurred at the same time-stamp, thus producing a stair-step look to our waveform.
I have looked at the custom functions that I can create to override tooltip display, but it doesn't appear that there is an easy way to make that very generic so that I can apply to all of the various chart instantiations (we use lots of different chart types), and that only covers tooltips; X-axis labels and Y-axis labels would also need separate functions for overriding those display values; there's possibly other places I haven't thought where the display might be affected as well. Is there any single, centralized place where the data points display value or format can be changed?
Example of stair-step appearance:
TIA
If you want to display various numbers (axis labels, tooltip, etc.) with various number of decimal places, you can use Highcharts.numberFormat function.
API Reference:
https://api.highcharts.com/class-reference/Highcharts#numberFormat
Example:
http://jsfiddle.net/eg0vepgq/

Resources