Vis.js Timeline Cluster more than two items at once - javascript

I currently try to create a timeline with clustering enabled.
There is one item per hour, and every item starts where the last ended. The clustering should occur as soon as the "step" changes.
e.g. if the step within the scale "hours" changes from 1 to 4 when zoomed out.
The clustering occurs, but it only clusters 2 items instead of 4 as i want to have one item or one cluster per vertical column.
Is there a way to change the clustering behaviour?
Also, there is an option called ClusterCriteria, but i am lost trying to figure out how this works, although I think the solution could be there?

Related

Is it possible to use a DOM element in the same was as a check box in D3?

I'm creating a scatterplot, and have appended 4 rectangles at the top to serve as a colour legend — each of the 4 rectangles is of a specific colour, and corresponds one of the 4 categories of data points.
I'd like users to be able to click on each of these rectangles, like a check box, and thereby fade the opacity of the data points in that category.
Forgive the fact that this is somewhat vague (I've never dealt with this sort of thing before, only mouseover event listeners, so am wondering )— is it possible to use DOM elements, like rectangles, as check marks? Are there any examples of this being used with D3?

Interactive BIRT Pie Chart with Drill down using Data Cube

I have 3 levels categories in which many items are divided.
Like in level 1 i have a pie chart.. if i click on any slice of that chart it should go to level 2 of that particular slice category and then again to the third level.
Everything should happen on same pie chart.
eg.. I have a pie chart which shows number of animals in 2 categories.. i.e. mammals and birds. If i click on mammals it should change pie chart to show number of mammals in herbivorous and carnivorous category.
I my real scenario i made a data set which has all the data through a query.
Then i made a data cube having 3 dimensions and a measuring count.
I displayed the 1st level on pie chart but i am unable to move to next level. New to BIRT i am.
And I don't need to jump from one report to other using hyperlinks to other report.. Everything is happening in same report.
I am using:
Actuate BIRT Designer Professional
Version: 4.4.0
This can be achieved by using a drill-through hyperlink. A drill-through does not necessarily jump to another report: it is definitely possible to drill to the same report, and set a report parameter controlling the dimension level.
A straight solution is to design three charts (one per level) based on the same datacube, and make use of a report parameter to keep only the chart of the current level. This allows to optimize chart views for each level: change the title, legends, chart type, font size etc.
There are a couple of ways to disable / enable a chart from a report parameter, the most efficient is to drop it by script in beforeFactory such below. Visit this topic
var design=reportContext.getDesignHandle();
if (params["level"].value!="1"){
design.findElement("chartLevel1").drop();
}
if (params["level"].value!="2"){
design.findElement("chartLevel2").drop();
}
if (params["level"].value!="3"){
design.findElement("chartLevel3").drop();
}

Plot multiple irregular timeseries on same line chart dojo

I am looking to create a line chart which will plot an array of data which has a corresponding x value (date/time) and y value associated with it. The chart can have any number of series (different lines on the same graph). You can think of this as like how yahoo/google graph a particular stock and if you want to compare different companies stock prices on the same chart.
The problem I am facing is that the data I am given might not be given in regular intervals (e.g. series 1 might give an array of plots that occur every 15 mins, series2 might be 10 mins, etc). Also the data might not have the same start / end time (e.g. series 1 starts at 8:40 am, series 2 starts at 8:42 am). There can also be holes in the data where no data was gathered (want to display this as nothing in the chart)
I have thought about some potential ways to solve this problem
Put everything on a 1 minute interval (the smallest possible interval) and place null values for everything we do not have data for. I need to have null values because there are datatips on the graph when you hover over a point to tell you what the value is at that point. The problem with this is that this will cause the graph to become a point graph rather than a line graph and will look ugly. I can tell dojo to interpret the data between null values but I also want to have explicit null values (e.g. when the market is not open leave the space as nothing rather than connecting the lines)
Round the data to the closest interval. The problem with this is the data is no longer accurate for that particular moment which is a problem.
Don't allow them to be plotted together (not an option).
Use a different charting library (last resort)
I am using the dojox charting library and I cannot change the back end code that gives me the data.
What are my options?

d3 y Domain and Range

I need to find out where to draw my y axis dependent of a date
My data looks like the following in .csv format:
startYYYYMM, endYYYYMM, ProjectName
201301, 201303, Proj1
201302, 201412, Proj2
201304, 201311, Proj3
I've done the chart as laying bar chart
Where to start my bars on the x axis is dependent on the start and is no problem. It's the y that is the problem.
I wonder If there is any built in "optimization" in d3 that I can use. I release that I can loop through my data to decide "the grouping" of my data.
And a pic of how I would like it to look like:
https://www.dropbox.com/s/5xs0jfxb33ipn60/temp.jpg
/Thank's
If I understand correctly, the difference between what you want and a standard Gantt chart is that the Gantt chart puts every project on its own line, but you want to compact the display so that long-finished projects don't continue to take up a row of blank space.
To get that "optimized function based on date" that figures out where on the Y-domain you can fit a project to keep the display compact, you're going to need to keep track of which projects are active at a given time, and loop through them to find out where you have room on your display for a new project.
Here's an algorithm you could implement. The results won't always be perfect (sometimes a small rectangle will end up taking up room in a space where a larger rectangle could have been positioned) but it should be much more compact than a standard Gantt chart.
Sort your projects by start date and work through them in that order, assigning y-positions to each.
As you work through your project list, keep a secondary array of "active" projects -- ones that have been started but not finished at the time you are looking. These will always be projects that you have already positioned on the graph, since you're positioning projects in order of start time.
For each project in your main array:
go through the active-project array (if it's not empty) and remove any projects that finished before the project you are plotting started (if you want padding between rectangles, require a certain minimum time to have passed in between);
sort the active-project array by the y-position you have already assigned to each project-rectangle;
scan through the active-project array, checking the y-position and height of each rectangle, to see if you have room to place the rectangle for your current project;
if you can't fit it in-between any of the currently active projects, set it's position to be above the last active project, and check whether the new position+height of this rectangle exceeds your previous maximum height;
either way, store the calculated y position (which will be in the same units as the variable you are using for rectangle height) in the project's data-object.
Now that you've set this project's position, add it to the active-project array and move on to the next project in your main array.
Once you have determined a relative y-position for each rectangle, set your y-scale domain according to the maximum height you used and draw the axis and rectangles.
You can look at this answer for some inspiration, although that example is more complicated than what you need.

KendoUI Dataviz series markers on top of each other

I have been using KendoUI Dataviz for only a short time, and have found I am able to customize it in almost anyway to meet my needs except one. I have two different charts where certain series just happen to have more than one point with the same plots. (dynamic data) I am unable to see all of the tooltips for all of the markers (since they are on top of each other), which means I am also unable to use the seriesClick or seriesHover events on those that are hidden. I have searched Kendo's forums, Stackflow and even Google but can't find anything specifically on the unreachable issue. Kendo's forums mention hiding the tooltip and making a custom one, but I haven't found anything that addressed the fact that some series markers are just unreachable and I need to reach them to use those events. Does anyone have an idea on how I can reach all markers for the series?
I've not been able to figure out a way to show "hidden" data points. I've had to do something similar in the past, and used a custom tooltip template function. In the function I grab the category (x value in my scatter chart sample), and get all matching items from the datasource. Then just put together some sort of list/etc. and return that. You can always go super fancy and make a box with tabs and the whole nine yards to show each dataItem on that particular point.
See sample on jsbin
http://jsbin.com/ONuQUgiY/1/edit

Categories