In Highcharts, How to generate Column Drilldown chart with random numbers? - javascript

In highchart, Drilldown Column chart we have. In this I want to generate data randomly.
For example : Number is 300.
Then for this drilldown no. of data are 4. Hence need to divide this 300 into such a ways that where 4 no.s total should be 300.
Or add 4 numbers(drilldown data) and generate root number which will be 300.
How can we do this?

Related

Plot array at some intervals in javascript for x axis

I am trying to create the UI to show the X and Y axis line graph using Svg Charts in React Native as above attached screenshot. I have an array for the x and y-axis respectively. Example:
var xAxisData = [1.002, 1.045, 1.084, 2.08, 2.021, .... so on] // price list
var yAxisData = [12-11-2021, 13-11-2021, 14-11-2021, 18-11-2021, .... so on] // dates
I have plotted the y-axis graph for that, had filtered & sort the array on the basis of date and some interval so will show only some dates as intervals on the y-axis for example my start date is 20 April and the end date is 20 July. The plotted y-axis will be shown as for only 4 dates as 4 intervals in the period of 4 months.
But now need to plot the x-axis graph, I am getting stuck on what basis will filter or sort the x-axis array within some interval or value.
Note: I Don't want to show or plot all the values of the array for the x and y-axis. My requirement is needed to show the values of the x and y-axis at some intervals
Can anyone help with the same?

dc.js Percentage Histogram - Size of groups

I have 3 groups using group().reduceCount() that produce frequency counts
What I'm trying to do is to turn the counts into percents by dividing each count by the total size of the group
This would give me the size of the group
var valueGroupCounter = value.groupAll().value();
This would divide each count by the total
.valueAccessor(function(d) { return (d.value/valueGroupCounter()); })
When I filter a section where the groups are the same or about the same size, I get the graph in the right, which is that I want, but then I filter a section where the groups have very different sizes I get the graph in the left. I want to have the 3 histogram to be about the same size by having them in percents instead of counts.
The problem is that it is giving the me the same size for the 3 groups, some groups have empty values, the 3 groups have different sizes.
I made a pen a added some data:
I was able to get the desired results by using the Number Display Example
Now, the histograms are in the same range
This gives me the total size the group excluding empty values
valueGroupCounter.value().n
Divide each count by the total
.valueAccessor(function(p) { return p.value/valueGroupCounter.value().n })
Forked pen corrected

How on Highstock (highcharts) data grouping shift grouping to the right

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.

Displaying excess number of columns in heat map in highcharts

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.

Logarithmic HighCharts X-Axis

I currently have a HighCharts graph, with the x-axis range 300 to 1 (1 being the highest rank, and 300 to be the lowest).
The problem is that if the data points range from 200 to 1, the change from 10 to 1 does not look significant.
Is there anyway to modify a HighCharts graph to stretch out the changes that are closer to the highest value (1) so that the jump in values are more significant?

Categories