Presently I am showing a panel graph with time range of last 2 hours. But requirement is that there should be some Left and Right arrow kind of options, based on that Graphs time range need to change.
Ex: If we click on left arrow, graph should refresh and time range should change from existing 5PM-7PM range to 3PM to-5PM range.
This functionality does not exist out-of-the-box in the basic splunk tool. If you run a search over a larger timerange in the flashtimeline, you can browse around within the results. If you want to rerun the search with a different timerange based on custom user interaction, then linu1988 has already given you a better suggestion.
Not sure about the java script control type. but you can use the checkbox in splunk 6 to get the earliest and latest value to change. Check out the splunk dashboard examples and custom development section.