restrict x-axis zoom & pan Flot time based chart - flot

I'm trying to use time based data in flot.
I have the chart plotting the data correctly and I have enabled panning and zooming.
My problem is that I cannot restrict the pan and zoom to a reasonable time period, for example, my data might span March 2011, but I am able to zoom out to a range from january 1900 to january 2100 and beyond. The same with panning.
What I'd like to do is restrict panning and zooming to the year over which the data is available. for the above example, zoom would be restricted to the year 2011 and a max zoom in of 1 day. Panning would be restricted to the year 2011.
How can this be done?

Look at the zoomRange and panRange options to the navigate plugin.

Related

Is is possible to create a scatter chart in excel that has a 2 dimensional X axis

I'm trying to create what I would call a Vertical stacked scatter plot or a scatte plot with a 2 dimensional x-axis. I tried using excel's normal charting tools as well as its pivot charting functionality, but I have not been able to crack this one. As anyone had any luck with this type of a chart or can you recommend a tool that can handle it. I've included an image of what I'm trying to achieve below:
The Y axis has months, and the X axis is a combination of Year and Units.
Thanks in advance for your input.
This can be easily handled in Tableau, if you and your users have access to it. For example, using sample Excel data with this format:
Date Units
1/1/2014 10
2/1/2014 20
3/1/2014 30
4/1/2014 40
...
You can create the scatter plot you've shown in your mock-up by doing the following:
Drag Date to Rows and change it to Month level
Drag Date to Columns and leave it at Year level
Drag Units to Columns
Change the Marks type to Circle
Reduce the size of the circles so they look like points
Sort Month according to your preference
Here's a link to a screenshot of the set-up and resulting plot:
screenshot of scatter plot
There are also many formatting options to change the look of the plot.

Spotfire- Sorting stacked bar chart

I am trying to plot a stacked bar chart for number of accounts we opened in spotfire; since there are a lot of values, I used the bin function for number and I am coloring by Names of Account-Holding agencies. Spotfire is stacking these colors by agencies high to low; I'd like to make is low to high such that the contributors of maximum accounts are the topmost color in the chart. Traditional sorting of bars is not working. Could someone please let me know if there is any alternative way I can sort by colors?
This feature is available in the latest release, 7.5. We have not upgraded to 7.5 yet but stacked bar chart sorting is mentioned on page 5 of the release notes.

Excel Charts, Lining up Primary and Secondary Axis

I have tried to line up my axis', I like the units it is in, but if you look closely 2 hours on primary(duration) does not line up with 22:00 hours(time on clock). The goal is to be able to use the dashed lines on the secondary axis. As you can see when I add secondary axis the lines disappear.
Does anyone have any ideas on how to do this? I have tried several macros online but to no avail.
Here are my axis' before:
And after:
Any help would be greatly appreciated.
EDIT~~~~~
I need help formatting this chart, would like primary axis to go from 20:00 to 8:00 am, when I do this all data stretches.
Edit: To stretch the axis from 8PM to 8AM (overnight)you will need to use days in decimal form. 0.833333333333333 is 8PM of one day. and 1.333333333334 of the next day, because it is greater than 1.
Right click on the secondary axis, select format axis.
Set minimum bounds to 0.833333333333333
Set maximum bounds to 1.333333333334
Set major units to .041666666666667
Primary axis
Set minimum bounds to 0
Set maximum bounds to .499999999999999
Set major units to .083333333333333
,
Change the cell formatting of the cells holding data plotted on the secondary axis to HH:MM AM/PM if you want to change the time format on the secondary axis.

MS Excel 2010 - XY Plot and Bar Chart Together and Dates don't match

I have an XY plot in Excel with some water level data, and I wanted to add a set of precipitation data as bars to help correlate changes in water level. However, there is no option to add dates for the precipitation data, and the bars don't have the same scale as the water level data. I tried using Julian calendar dates to resolve the issue, but that didn't help. How can I fix this?
Water level and precipitation both as Y vs dates as X?
Make a line chart of both sets of data. Right-click on the precip series in the chart, choose Change Series Chart Type, and select a column type. If the scale is way off, you can format the precip to go on the secondary axis, so it will be plotted on the right axis scale.

Changing pivot chart unit

I've got a pivot chart which spans several years on the X axis, with data for each day. The problem is that there's a label on the X axis for each day, so they are too cluttered to be readable. I'd like to show just the months as labels instead of the days, and still see data points per day, but here's what I found so far:
Doing this is trivial in a normal chart, by going to the axis format settings, on the "Scale" tab, and setting the major unit to "Month(s)". This field does not exist in the same tab for a pivot chart.
I can set "Number of categories between tick-mark labels" on the pivot chart, but of course they don't line up with the months.
I can set the pivot table to use the month instead of the day, but then a lot of resolution is lost.
Setting Charts(1).Axes(xlCategory).MajorUnitScale = xlMonths doesn't seem to do anything.
You can group the X axis by more than one value, such as by Days and Months. Unfortunately it doesn't eliminate the clutter of the labels for each day, but it does superimpose the Month on the axis.

Resources