We are using chart.js lib Version 3.7.1.We have multichart graph with line and bars. Both using time scale on x axis, but one has one month value, while second has one day value.
example:
const dailyAxis = [27-05-2022, 30-05-2022, 31-05-2022, 01-06-2022, ... 07-06-2022];
const monthlyAxis = [31-03-2022, 30-04-2022, 31-05-2022, 30-06-2022];
The problem is, that daily values could start from the middle of the month or one month could have 20 daily values, other could have 30. Is it possible to align two charts, to have first daily point at start of monthly bar and last point at the end of monthly bar, no matter how many daily values we have?
Related
My problem is: I'm strugling with Power bi trying to correct a default behaviour of the line chart. In this case when I try to filter my data for periods of 2 to 5 days the hours of the day appear in the X axis. Like I show in the image below. In my date hierarchy I have specified my date column with the format (dd/mm/yyyy) and the column is of the type "date", but he hours of the day still appear.
How can I get rid of the hours of the day when I select only 2 to 5 days in the slicer of time??
What I've tried: I've tried to change the date column in my line chart visual so that only the month and the day appear but when a monthly period of days is selected the visual isn't able to show all the data at once and the user needs to scroll in the element, so it is not a solution. I've also tried to change the format of my date column but without sucess.
The desired result must show only the days without the hours of the day like the image bellow:
Links I've followed but sadly didn't help:
Power Bi Axis X and Y
Core plot x-axis labels are not shown
In Power BI X-axis label, how to show only week starting day instead of all date series?
Can Power BI add range selection to a Line Chart?
I'm graphing weekly total page loads per 1000 students, which is easy enough when the pill for the page load variable is set to 'sum', and the date pill is set to 'week number.'
BUT, I also have a table that lists individual dates on which important policy changes occurred, and I want to draw those as vertical lines.
Using a dual axis, I have been able to plot the specific dates as lines, but because the resolution of the date axis is set to "week", it lumps all dates in the policy change table that occur within a single week into one, or possibly omits dates that don't land on the right date for that week, and therefore I don't get individual lines for every policy change.
weekly resolution, dates omitted
I have been able to approximate what I'm looking for by setting the date pill to 'day,' and then doing a rolling average of the page load values--but this doesn't represent the page loads in the way I need it to.
rolling sum, not the same calculation, but includes dates
I need either a way to layer two charts on top of each other, with different x-axis resolutions, or possibly the correct calculated field that gives me the straight up weekly sum of the daily total page loads for successive weeks, so I can use the 'day' setting on the date-time access but still get the weekly values I want, and then plot all dates in the policy change table.
Currently, I'm having trouble to force the highstock chart to display a blank space up to the current date. It focuses the data I give it.
What I have is:
What I want is something like this
As you can see I want the data to stop at the date of the latest data point and then the graph should show a blank space and stop at the current date. Obv there is not data points for those times
You can control how empty points, and missing points are shown by looking at:
xAxis.ordinal
In an ordinal axis, the points are equally spaced in the chart regardless of the actual time or x distance between them. This means that missing data periods (e.g. nights or weekends for a stock chart) will not take up space in the chart. Having ordinal: false will show any gaps created by the gapSize setting proportionate to their duration.
xAxis.max
The maximum value of the axis. If null, the max value is automatically calculated.
plotOptions.series.connectNulls
Whether to connect a graph line across null points, or render a gap between the two points on either side of the null.
Which means that for your graph, you will want to set:
xAxis: {
ordinal: false,
max: (new Date()).getTime() //to set the current date and time as a maximum
}
Using google sheets, I am trying to plot times between 9pm and 3am (sleeping time every night), with the x axis being each calendar date/day.
But the scale puts items just after midnight at the bottom of the y-axis (y is the time axis, x axis is the day), because of the timing (0:10) is 10 minutes later than midnight and I want it to reflect that on the graph.
The two graphs are waking and sleeping times.
Waking makes sense, sleeping does not:
The only way seems to be put an if else and change format completely converting time format to integer and then multiplying to get a number close to 24 hrs (and then 1am is 25, 2 am is 26, etc).
Is there not a simpler was to change the axis for time? Does no one else log times either side of midnight?
The two images below show the formula, and the chart data:
I'm having trouble creating the following chart in Tableau.
I have data that looks like this:
name date count
a 11/10/2012 2
a 12/10/2012 3
a 13/10/2012 2
b 12/10/2012 6
b 13/10/2012 2
b 14/10/2012 3
c 14/10/2012 2
c 15/10/2012 2
And I want to create a bar chart that has the sum of the count on the y axis and time on the x axis. The width of the bar should be the length of the time, like a Gantt chart. Each name has its own bar. Here is an image that shows what I am after.
The bars should overlap if the times overlap.
I have tried various things in Tableau but haven't really got close.
Is this kind of chart possible in Tableau? If not in 7, will it be in 8? I have heard it makes it possible to create some more complex chart types.
A workbook with data can be found at http://community.tableausoftware.com/servlet/JiveServlet/download/188799-12362/Gantt%20over%20time%20with%20summed%20bar.twbx.zip
Thanks for your help,
Andrew
The trick with Gantt charts in Tableau is to put a calculation on the size shelf that calculates the duration of each bar in units of days. See the example screenshot at Tableau example
You also need a continuous date field on the columns shelf to get a horizontal time axis.
In this example, I also did a few more optional things, such as, turned off aggegation under the analysis menu to get a mark per data row, rather than aggegating them, added a discrete date to the rows shelf to make each bar go on a different line (as long as each bar starts on a different date) and hid the column for that start date.