How to create a QuickSight histogram visualization using start and end date fields? (GANTT chart) - amazon-quicksight

I plan on displaying the availability of my data by having the start and end date on the x-axis and the type of data on the y-axis which can be drilled into.
How would I be able to do this? I'm only able to add 2 fields to the histogram visual (x and y axis)?

Workaround:
Calculate min(start dates)
Calculate difference between min(start date) and start date in days
Calculate difference between start date and end date in days
Use a horizontal stacked bar chart visual with bar 1 as the gap between the difference between min(start date) and start date. Match the color of this bar with the background color. Have bar 2 as a different color which displays the difference in days between the start and end dates.
Unfortunately, it doesn't seem possible to have the dates appear on the x-axis, so it would be better to hide the axis entirely.
In order to view the start and end dates associated with a bar, add these values in the tooltips.

Related

How to add Custom GlyphSeries to LineSeries in visx XYChart?

I have implemented a Visx XYChart component with LineSeries.
Codesandbox link here
Requirement:
I need to display a Glyph to indicate the start and end of the individual LinePath, and only if the LinePath starts or ends in between the start or end of the x-axis.
The x-axis plots weekly data for a year(52 weeks), if the data has less than 52 weeks of data points, then it means LinePath begins or ends somewhere in between the x-axis.
I need the x-axis to display the January month name as well.
How do I approach to solve this problem?

Kibana stacked bar breakdown by text/tag

I'm trying to create a stacked bar visualisation for runtimes from a series of logs. The logs have start and end times, and a "subtask" text field. I want to breakdown the runtimes such that each segment in a stacked bar shows how long a subtask took, with the whole bar therefore showing the total time of the task.
I have it set up as:
x-axis = start times, interval 1 hour
y-axis = start time-end time (scripted field)
I want to breakdown the y-axis, but kibana doesn't allow me to do this using a text field. What data type should I be using to achieve this?

dc.js - Yearly average values for previous years + monthly for current year

I'm trying to find a way in dc-js to draw a chart that would display monthly values for current year but yearly averages for previous years. Is this possible provided that the date axis is dynamic? I was thinking of grouping records by year before passing them to dc.js but the chart will just leave blank gaps on the x axis.
I would like to achieve the similar result to the attached excel screenshot but on a web-based interactive solution.
You will need to use an ordinal domain for this purpose.
If you use a time-based scale, then the bars will always be positioned based on a linear mapping of dates to X coordinates. This explains the gaps you are seeing.
Instead, you can define the ordinal domain explicitly:
var domain = ["2015 Average", "2016 Average", "2017 Average", "201801", "201802", ...];
chart
.x(d3.scaleOrdinal().domain(domain))
.xUnits(dc.units.ordinal)
You'll also need to change your group key function accordingly:
var group = dimension.group(function(d) {
return d.date.getYear() < 2018 ?
d.date.getYear() + " Average" :
d3.timeFormat('%Y%m')(d.date);
});
I'm not sure how you intend to calculate the averages, so I won't get into that.
Unfortunately (or fortunately, depending on your purposes) this will change the selection behavior so that instead of a continuous X brush that you can drag, you'll have to click on individual bars in order to select them. There are some ways around that, but they are kind of tricky, so lmk if this is a problem for you.

nvd3.js x-axis not rotating all tick labels after chart re-render

I have a nvd3 chart where i group data by day, week or month. When i have have a low number of values in the x-axis i don't rotate the axis label, but if i have a lager amount of ticks i rotate them so they don't overlap.
My problem is that when i have a chart grouped by Week with the tick labels rotated and change it to group by month most of the labels become horizontal as expected, except one. If i play with the dates i see that i get the problem always with the month February 2016 or December 2014.
If i go to group by month from the day grouping, or if i refresh the page the chart is shown as expected.
See the images below:
chart by week,
chart by month
Does anyone have a clue why do i have this kind of issue?
Well i found a solution to the problem.
in the file nv.d3 in the axis chart function of nv.models.axis there is an if statement that is run when labels are set to be rotated (if (rotateLabels % 360){...}). But if the labels are not set to rotate there is no code to explicitly set this, so i added an else statement in that if statement that sorted the issue:
else {
xTicks
.attr('transform', 'rotate(0)')
.style('text-anchor', 'middle');
}

Birt: Formatting chart tooltip and adding aggregation to a chart tooltip?

I have three questions regarding Birt Tooltip
1) How do I format the number in the default tooltip (If I am not adding anything to the tooltip text). I tried to change the format of tooltip of Y Value Series but I realized that only works if I have put an expression in the tooltip of the Y Value series. I have not edited the tooltip of Y Value series, the chart will show the default data label instead and I am not sure how to format the default tooltip
2) I have plotted sum(revenue) on Y axis and months on x axis. I wanted a custom tooltip so I edited the tooltip expression of the Y Value series in chart. What I found was that the default tooltip was showing correct value but If I put the same expression row["revenue"] in the tooltip, the tooltip shows a data value that is much less than sum(revenue) that is plotted in the bar. I believe that this is because the tootltip is not aggregating the revenue? If Yes, then how do I put the sum(revenue) in the expression?
3) I wanted to add another information (count of units sold) so I created an aggregation count(unitssold). I called this cnt_unit_sold and added this to the tooltip of chart. The problem is that if I put my mouse over a month bar, the tooltip shows aggregated count for all months rather than that specific month. How can I add grouping to the aggregation so that it shows the aggregated count for each month rather than for all months
Regards
Arif
OK, so in case if someone has not found an answer to this question, here is the answer. In order to add aggregation to the tooltip, you need to create aggregate outside the chart's contains (for example create aggregation inside a grid). Then you can use that aggregation in the tooltip
Arif
I someone is still trying to achieve this, now you can use "valueData" instead.
row["dim1"]+" for "+row["period"]+" : "+valueData
in my example (the code goes in the tooltip expression) I asm using a stacked barchart, dim1 is the series used to stack values and period is the X series. Valuedata is the Y value (aggregated)

Resources