Using the Interactive Date Slider on SharpCharts

Using the Interactive Date Slider on SharpCharts

The SharpCharts Workbench offers a number of different ways to set the date range for your SharpChart, but none provides more interactive functionality than the Date Slider. This feature allows you to “zoom in” on exactly the dates you want to see on your chart, fine-tuning both the size of the range and the start and end dates.

Accessing the Date Slider

To access the Date Slider, first create a SharpChart. Then find the “Range” dropdown menu located below the chart, and change it to “Select Start/End”.

Once you select this setting, you should see a “Start” box, an “End” box, and the Date Slider.

Parts of the Date Slider

The Date Slider control consists of three elements:

  • The Date Scale - A changeable set of months/years that make up the middle of the control. This shows you a range of dates that can be used for your chart. If you use all of the dates currently shown on the scale, the scale will automatically expand to include additional dates that you can use.
  • The Thumb - The wider box that moves from side to side along the date scale is called the “thumb.” This box represents the current date range for your chart. The left edge of the slider's thumb corresponds to the left edge of your chart and the right edge of the slider's thumb corresponds to the right edge of your chart. You can use the thumb to change the chart's date range, as described below.
  • The Arrows - To the left and right of the date scale are two arrows. Clicking on the left arrow will move the slider backward by one time period; clicking the right arrow will move the slider forward by one time period.

Changing the Date Range

You can use your mouse to adjust the slider in the following ways:

  • Left-click on the middle of the slider's thumb and drag it left or right to change both the starting date and ending date. This allows you to “slide” your chart forward and backward through time.
  • Left-click on the left arrow to move the slider's thumb backward by one time period.
  • Left-click on the right arrow to move the slider's thumb forward by one time period.
  • Right-click on the middle of the slider's thumb to choose from a menu of common chart durations.
  • Left-click on the left edge of the slider's thumb and drag it left or right to change the chart's starting date.
  • Left-click on the right edge of the slider's thumb and drag it left or right to change the chart's ending date.

Notice that as you move the slider with your mouse, the dates in the “Start” and “End” boxes to the left are instantly updated. When you stop moving the slider, the chart then follows suit.

You can also use your keyboard to move the slider's thumb backward and forward by one period. Just click the left or right arrow keys on your keyboard. You may need to click on the Date Slider one time with your mouse before the keyboard arrow keys will work.

Once you have set the Start and End dates that you want for your chart, remember to click the Update button to “finalize” those values - especially if you are going to save the chart into a ChartList.

Note: the date range for an intraday chart can still only be set in daily increments. In other words, you cannot have a chart start or end in the middle of a day.

Changing the Date Scale

By default, the Date Scale shows approximately four years of dates that can be used in your chart. Members can create much longer-term charts than this, so they may need to expand the date scale beyond the four-year default. To do this, simply drag the left edge of the slider's thumb all the way to the left edge of the date scale. As soon as you get close to the left edge, the date scale will expand to include more dates.

In some situations, you may want to work with a much smaller date scale, perhaps a few months instead of a few years. To do this, drag the left edge of the slider's thumb over towards the right side of the scale. When you release your mouse button, you will see that the date range is much smaller, but the date scale is still just as big as it was before. Next, click on either arrow button to the left or right of the scale. Now you can see that the date scale has changed to measuring in months instead of years. You can repeat this process as many times as necessary to get the scale as small as you want.

Use With the Inspector

For technical reasons, the Date Slider currently cannot be used on a chart at the same time as the Inspect feature. If you start to use the Date Slider, the Inspect checkbox will automatically be unchecked and the Inspect feature will be turned off for your chart.

Once you are done setting the date range, simply check the Inspect checkbox again to turn this feature back on.

Moving Through Time

While most people use the Date Slider to set the date range for their charts, one of the most exciting things about the Date Slider is the way you can use the arrow keys/buttons to move through a chart day-by-day and see how the chart patterns and indicator values develop over time.

Simply move your daily chart's date range back a few days or weeks, then click on the right arrow button (or use the right arrow key on your keyboard) to move forward one day. Then click it again to move forward another day. It's like stop-motion animation for your charts.

Conclusions

Remember, the Date Slider is totally optional. You can still type dates inside the “Start” and “End” boxes or use the calendar controls to set “Start” and “End” dates like you always have.

However, we think you'll find the interactive nature of the Date Slider make it a first choice when setting the date range of your chart.