AmStockChart period selection changes to YTD (AmCharts) - javascript

I am using AmStockChart. The requirement here was to update the chart data on period selection. This works fine as we receive a period selection event and when this event occurs we update the chart with latest data. The period selector I have configured is 1M, 3M, 6M, 1Y, YTD and 3Y. The data I have is of 8 months.
The problem I am facing is when I change the period selector to 1Y, after updating the data it falls back to YTD i.e. it selects YTD again. However this is not happening when I select 1M, 3M and 6M, in these cases the selection does not changes to YTD.
Is it happening because I have only 8 months data and when I select 1Y, since there is only 8 months data it selects YTD? Is it the desired behavior?
Thanks in advance.

Related

How to show multiple events per day on month view?

Right now, when I add more than 1 event to the calendar, it shows +2. I want to show up to 4 events per day in the month view and then after the 4th event show the +2, +3, etc. If that makes sense. Sorry very new to coding. I am using FullCalendar.io
Thank you so much!
It looks like you have dayMaxEventRows: true set (v5)
or it is set to a specific integer, i.e. dayMaxEventRows : 1
Either remove it or set it to false
dayMaxEventRows: false
on previous versions the setting was named eventLimit

jQuery date[time] picker - how to save time range (+ modify date format)?

I am using the datetime picker library and it works nicely.
But now, I am I need to save a time range. When I click to the widget, I am able to save a date and time in this format:
2015/03/15 10:15
This works well. But I would need to add a time range and save the date+time in this format:
2015/03/15 10:15 - 12:00
How to do that? I already changed the MySQL column from datetime to string. Now I am facing the problem how to enter the value to the input. When I chose the date+time, then in the input will occur something like this:
2015/03/15 10:15
Then I click to the input and want to manually add this text: - 12:00. But when I type this text to the input and the click out of the input, the - 12:00 text will disappear and in the input stays only following: 2015/03/15 10:15.
How to solve this problem? Any thoughts?
Thank you.
I think there might be a slight problem in your design.
Ideally, if you need a datetime range (somewhat simliar to what you have on airline and hotel booking sites), you ought to have 2 datetime pickers. One for the start of the range and one for the end of the range. Even with the database. There would be one column for start date and another for end date.
In your case, you need the time range, so you could probably add the time using the DateTime.AddMinutes()

amCharts Minimal zoom range (minimal period selector range)

I try to use amCharts. I have a chart that represent dayly data. I can't make so user wouldn't be able to choose period less than 5 days (i dont want send 5 days points to chart)
Also i can attach changed event to period selector, but chart zooming and chart scroll bar have no any events and methods i could use.
I need to do so user will see message "please select range that is more than 5 days" when he tries to scroll, select period and zoom chart. And set chart zoom to 5DD.
Also i mentioned that period selector changed event, fire every time when blur event fired on inputs, i think it's not right behavior. It should fire when date changed, yep?
chart.periodSelector.addListener('changed', function(){
alert('changed');
});
I have date picker that attached to period selector inputs (it don't permit user to select less than 5 days range), but i can only update my datepicker ranges only if user input date, i can't to do anything if he zoomed, scrolled chart. I don't see any events in your API for that.
Thanks for your help! Will wait any advice.
Use zoomed event instead.
chart.addListener('zoomed', function (event) {
// Your code
}
And now, to get the selector's start and end date, use this:
event.startDate
event.endDate

DaterangePicker and second click on same item

I am using Bootstrap Date Range Picker and I am trying to enable a second click on the same date range.
Ex: User clicks on "today" and gets results, then clicks again 5 minutes after and gets the updated results.
Everything works fine on the first click but due to line 298 .on('click', 'li', $.proxy(this.clickRange, this)) the click gets unbound on that item.
I looked everywhere to try and correct it to no avail.
The callback is only fired when a new date range is selected.
If you'd like to change the behavior, this is the line to change.

How do I select a row's cells and get their value through JavaScript?

I am working on the hotel reservation system and I want to select a cell from a table.
Given this table:
Today 2/Jan/2012
Date 2/jan 3/jan 4/jan 5/jan 6/jan
room 200 ||||||||||||||||
room 201
Room no 200 is booked for 3 days, so no one can select this cell. But the other cell can be selected, i.e. anyone can reserve room 200 on 5 jan and 6 jan.
I want to create a solution with JavaScript or any other ASP control. How can I do this?
When you build your table\grid from server add a read-only class for the cells which shows reserved days.
On client side bind\live a focus event for td's and in that event verify if that cell has read-only class if yes just cancel the execution and if not add a class to that cell to show selected behavior then store the selected cells information in appropriate place.

Categories