D3 Axis ticks by Week of Year - d3.js

I am trying to create a D3 chart where I want the ticks to be by Week of Year
I would like to generate ticks like so Week 01 2016, Week 02 2016 etc
My data has only timestamps that are the beginning of the week for example 6 of Jan 2014 that is Week 01.
The problem is:
The D3 auto generation of ticks will generate a tick like 8 of January 2016 that If formatted will be Week 01 2016 but the data point is 6 of January 2016 and so
the point will appear before the tick with the same format and it will create confusion to my users.
Do I have to implement/override the tickValues so I have only ticks that are dates that are always the first day of the week or is there some option I can pass to D3 so the auto generation of ticks that this into account?

Assuming you have a d3 axis timeAxis, with a time scale, then you should be able to call
timeAxis.ticks(d3.time.week, 1)
which means "a tick every 1 week". d3 assumes Sunday is the beginning of the week, which might be just fine.
Alternatively, there's also something called "xdayOfTheYear" which I haven't tried before, but might work even better for you. See the documentation
timeAxis.ticks(d3.time.mondayOfYear)

Related

Show value from last day of the given month - SSRS Report Builder

In a Report Builder table I have to show the value from the last day of the given month, when the month is not expanded.
When the month is expanded, the dates have to show the specific value for that day.
Example is January with values 1 to 31 (same as the day numbers):
When January is expanded, it has to show value 1 on Jan 1.... value 15 on Jan 15... value 31 on Jan 31.
When contracted (and the table only show one row for January), it should show the last day's value of 31
Some months do not have values on all days, so the formula just need to take the last value of that given month
When I use the formula "Last()", then it works half of the time, while for some months, the value extracted is the 3rd or 4th last day of the month - do you know what is wrong here?
Hope above makes sense, and thanks for help.
I think I fixed it my self:
Using Last () formula
Learning how to make a sort order in my Union All dataset, so it came out in the right way
How to give points to my self?

Is there a way to keep Month Data from May 2019 to Jan 2020 in powerbi Bar chart

I have an excel data with Data(from May 2019 to Jan 2020), few columns have been added in power bi mainly Month Number and Month Name.
For Month Name, sorting has been done by Month Number.
However, when i put the Bar graph, and sort it i get the bar graph from Jan 2020, May 2019, June 2019, July 2019 so on until Dec2019.(Image has been attached)
Do we have any way where we can put the graph starting from May 2019 all the way to Jan 2020 in x-axis.
I would suggest creating a date field and using that in the chart instead. The calculation could be something like:
Month New = DATE([Year],[Month Number],1)
Then you can customize the date field to just show the MMM-YY part. This way your sorting issues will be resolved and you won't face any issues in the future as well.

dhtmlx scheduler custom timeline

Currently i'm working on a project where i need to use dhtmlxSchedular whats new to me.
i'm struggling to change the timeline header view. For example this timeline: http://docs.dhtmlx.com/scheduler/samples/06_timeline/08_time_scale.html
Here you can see a timeline with a second time scale for one day
timescale 1: minutes
timescale 2: hours
What i want is a view for a week and one day has 10 hours. For example
Monday 12 dec till Sunday 18 dec
Where every day has 10 cells from 00:00 till 10:00.
So shortly saying, one day consists of 10 hours to be planned.
Is this possible with scheduler timeline.
Yes, it is possible. To hide hours in the scale you need to use scheduler.ignore_timeline property.
More info how to change the default time interval
Demo with Timeline scale you want to implement

How to Create Planned vs Actual Chart in BIRT

I am trying to plot both the cummulated projected and cummulated actual number of hours worked on a project. I am trying to plot these two lines as two different series on a line graph.
I would like the planned line to show the accumulated hours planned, by month, for every month since the project started until the project ends.
I would like the actual line to show the accumulated actual hours spent on the project, by month, for every month from when the projected started to the current month, and then stop (not hold at the current value).
I have data/queries set up this way, but when I try to plot the two series, the lines stop at the current month.
For examlpe, I have a project that goes from January 2013 to December 2013. I have the cummulated planned hours for each month from January to December 2013 as (150, 300, 600, 900, 1200, 1500, 1950, 2350, 2650, 2950, 3250, 3400). So far my actual hours spent for January through July are (100, 250, 400, 750, 1050, 1350, 1750).
My chart right now only shows both series through July 2013. I would like series 1 (planned) to show me values for all 12 months. I would like series 2 (actual) to show me values through July, and then stop. I can add data to the actual column and set it equal to the prior month if it there is no value, but this gives an unsightly and potentially confusing flat line for actuals for the remaining months of the year.
If your lines stop at the current month it is probably due to queries. For example this chart acts as your need.
How do you join actual & budget data, In SQL queries or a joined dataset? There is probably an "inner join" that should be an "outer join".

How to change the starting date of a Calendar Year to something other than Jan 1st?

I'm writing an app that relies on the calendar and calendar events to display data to the user.
I need to be able to let the user select the beginning of his/her 'fiscal' year in settings, which will be the 1st of any of the 12 months. This is an app for military users, and any given unit's fiscal year can begin on whatever month their unit (base) decides.
The data I'm displaying to the user needs to be divided into 'fiscal' quarters according to the user's setting of the beginning of the fiscal year, not calendar year.
I'm not having problems retrieving, editing or deleting the events, I can't figure out how to change the beginning of the year to anything besides Jan 1st.
I found NSDateCategoryForReporting on GitHub, that seems like it's exactly what I need, but how do I tell it that the year begins on the 1st of x month?
iOS doesn't natively support this, so you'll have to find a plugin to do this or write your own. Your best bet is to write a class that performs the date conversions using the standard NSDate, NSCalendar, etc.
For instance, you could store what day the user specifies as their starting fiscal year. Then you can calculate the number of days difference between that and January 1st, and just shift dates based on that.

Resources