have a question regarding highstock option data grouping. If i use this on big data like 5 years of data for each day. data grouping losses last point if range is set to max. how to prevent this by shifting data grouping timestamps to the right. that it always will end up with last data point.
Related
I have a problem with multiples series data. I have three series data (sometimes two), where the x values are dates and the y values are numbers.
I'm not able to sort the column bar based on date.
I reproduced the issue here: https://playground.anychart.com/WuqV384h
As you can see, the series data are showed as are written inside the "series" key. The dates should be sorted from 2019 to 2020.
A similar issue was asked here.
However, even using the DateTime, I'm not able to visualize the dates in the right order. If I use DateTime, the chart doesn't show the real value of the date (es. x: 2020-02-02), and the chart doesn't fit the container.
Thank you in advance.
The Cartesian Column chart uses an Ordinal scale. It doesn't provide any sorting because the Ordinal scale works with categories (names), it doesn't differ dates or names.
So, there are two available solutions:
Use real dateTime xScale that sorts points automatically. But it is a linear scale. Here is the sample.
Use the ordinal scale, but in this case, you need to preprocess your data to get the sorted array of categories and apply it to the xScale. Here is the sample.
I've just encountered a problem with highcharts autoscaling within multiple series. Pictorial explanation:
Range 12h
-> Here, my time range is 12hours, max value is 5 (yellow).
Range 16h
-> Here, when I switch to 16h time period, max value of THE SAME SERIES changes to approx. 2.5 (yellow).
How to retain the same Yaxis max value across all time ranges?
Historical data, form the moment when the chart is initialized back to 16h before, is provided by REST API endpoint, whereas current data is fetched from HTML.
EDIT:
Additionally, when I narrow down the time range, max value apperas to be way bigger, than it is in the normal time range.
Zoomed
In this example, I draw a chart from 4 pairs of date and number of visits. I can change dataGrouping.units to day or month with sum as approximation.
For the dates that don't appear in data, I want to consider their number of visits is 0. However, the current chart looks misleading.
One way to amend that is to prepare the data manually by myself, eg, by completing data by adding all the other dates with 0 as number of visits.
Does anyone know if HighCharts provides some parameters to customize this automatically? I tried pointInterval and pointIntervalUnit, it seems they have other purposes...
It seems that you need to set xAxis.ordinal to true.
Live demo: http://jsfiddle.net/kkulig/hujdkL1L/
API reference: https://api.highcharts.com/highstock/xAxis.ordinal
I am receiving a series of data from my backend - some values paired with a specific date.
The data is sometimes inconsistent - i.e. for some dates in a specific range no data is provided.
When rendering a simple line chart, I have an option for amCharts to connect points with a line and not take into acocunt missing data, or to display gaps between points that 'surround' a missing data point.
Is there any built-in mechanism to fill such gaps with some default values? I need to display '0' on the Y axis for each gap.
I'm using highcharts heat map in my project. I have 12 rows and 7 columns in my heat map. When i pass the data hard coded the chart is displaying as required with 12x7 matrix. Now i need to pass the data in a json object from my database. When i9 do so, it is showing me 12x12 matrix with last five columns being empty and space being wasted. How can i remove these extra five columns. The chart is expecting some data to be passed ,where it is not,and I have not given any labels so it is displaying it as numbers after 7th column as 8 9 10 11 12. Can someone help?
(edit after review).
Put fake data in the 'categories'. This will shrink the matrix back to 12x7, and you can suppress the display of the fake category data.