Morris.js x Axis not arrange correctly - ajax

Good day
Im having some trouble with my morris js chart.
instead of having 1-4 5-9 10-14 i receiving it at this kind of way. I already tried my query to ordered it asc but nothing happen.

You need to sort your dataset before providing it to your Morris chart.

Related

Proportional Area Chart (Square) with d3.js

I am searching a way to do the following charts with D3.js and as I'm new to this, I have no idea at the moment how to sort the squares.
Tried some research for charts like this:
Square chart
Proportional Aera Chart
but I did not find anything regarding D3.js.
Does anyone have an idea how to start or proceed?
I think I could manage to create an area with all squares in the right dimensions, but I do not know how to sort them dynamically, so they would group together automatically as shown especially in the first image, when their sizes do not match perfectly but differ a lot.
Thanx for any help, hirschferkel
This example from Mike Bostock is, I think, the sort of thing you're after:
https://bl.ocks.org/mbostock/8fe6fa6ed1fa976e5dd76cfa4d816fec
I suddenly came accross maybe a similar chart: It's called demers cartogram. There is a way to create it in d3.js but it does not look as good as Arc Gis creates it, where the alignment of squares looks much cleaner.
Demers Cartogram with d3.js
Demers Cartogram with ArcGis

Wrong Plot of line chart(stock graph) using D3.js

I am trying to plot a line chart using D3.js. The problem is that for some stock symbols the graph is correct and for some it gives a wrong chart.
I have attached two images. One showing a line chart that shows the wrong graph for a particular stock.The other one shows the correct graph for an another stock.
Look the d attribute of the path tag in the svg (in the images that I hace attached).The values of the d attribute are way off the charts for the wrong graph.The two graphs that I have shown are generated from the same program.
Wrong Chart
Correct Chart
Your scale is off. If you look at the axis on your wrong chart the numbers are in a tight range, apparently outside of the highs and lows. Check the code where you define the domain for the y scale.

Create D3 x-axis that excludes weekends and holidays

I am trying to create a simple d3 chart using the library NVD3 (the information that I am using NVD3 is somewhat irrelevant), and I am struggling to create the correct x-Axis and get the correct spacing between points. I do want a scaled display of dates, so, the jump from 2014-03-01 to 2014-04-01 would be less than to 2014-03-07. So essentially what I want is the typical default time scale, except I don't want it to consider weekends and holidays as possible points, because the market is closed on these days.
I apologize in advance that I cannot post code, as the data is from a source I can't put into a fiddle or bin.
Essentially the data that I am returned is not garunteed to have the price of a stock on a valid date, and some points could be missing. Currently a single day tick on the x-axis is twice as large as the regular single day tick should be if there is data on a Monday and a Friday.
If this is confusing please tell me and I will try and reword.
If anyone has done this before or has any insight, all help is appreciated!

DC.js Crossfilter on "nested" dimensions

I'm quite confused and might need help just formulating the question, so please give good comments...
I'm trying to crossfilter some data where each data point has its own sub-dataset that I want to chart and filter on as well. Each point represents a geographic region, and associated with each point is a time series which measures a certain metric over time.
Here's what I've got so far: http://michaeldougherty.info/dcjs/
The top bar chart shows a particular value for 10 regions, and the choropleth is linked with the same data. Now, below that are two composite line charts. Each line corresponds to a region -- there are 10 lines in each graph, and each graph is measuring a different metric over time. I would like the lines to be filtered as well, so if one bar is selected, only one line will show on the line chart.
Moreover, I want to be able to filter by time on the line charts (through brushing) in addition to some other filter, so I can make queries like "filter out all regions whose line value between 9 AM and 5 PM is less than 20,000", which would also update the bar and choropleth charts.
This is where I'm lost. I'm considering scrapping DC.js for this and using crossfilter and d3.js directly because it seems so complicated, but I would love it if I'm missing something and DC.js can actually handle this. I'd also love some ideas on where to start implementing this in straight crossfilter, because I haven't fully wrapped my head around that yet either.
How does one deal with datasets within datasets?
Screenshot of the link above included for convenience:

D3 Area chart that tends to zero where values are missing

I have data like this:
document: [{"key":"01/01/2001","values":2},
{"key":"02/01/2001","values":1},
{"key":"31/01/2001","values":2}]
I am creating an area chart with .interpolate("linear") to create the following:
The idea being to represent number of documents "created" throughout January.
However, this is kind of a misleading output as it would imply there are values throughout January, when there aren't just 2 at the start and one at the end.
My questions are:
Fundamentally is this the wrong graph to represent this data, and should a bar chart be used instead?
Can D3 add evenly spaced "zero" values for each day in January?
Is the best we can do is use .interpolate("cardinal") to produce something like:
Thanks in advance!
I think the answer from this other SO post gives a usable answer, reposting it here so that this is not a dead-end for visitors coming from Google and finding this post first (as I did).
d3 linechart - Show 0 on the y-axis without passing in all points?

Resources