Chris Kinsman Posted August 13, 2007 Report Share Posted August 13, 2007 I have a chart that shows sensor readings every 15 minutes in the SideBar. After a while it became a mish-mash of lines. Is there a way to essentially tell the chart to only chart the last 10 values? Thanks, Quote Link to comment Share on other sites More sharing options...
JuanC Posted August 13, 2007 Report Share Posted August 13, 2007 Our default behavior is as follows If the data being fed into the chart has more than 1 elements (in SQL your statement returns more than 1 rows, in powershell your statement/script returns more than 1 object) we will reload the new data and destroy the old data. If you do not get this on the sidebar please try running the same gadget on the desktop, this would tell us if you are experiencing a refresh issue on the sidebar. If the data being fed into the chart has only 1 element our default behavior is to only keep the last 20 points. If you have powershell installed you should be able to see this behavior by typing the following get-date -uformat "%S" | out-chart -refresh 0:0:1 -axisy_max 60 This command will show you the current number of seconds and after 20 seconds you should not see new bars added but instead the tail behavior you expected. You can control the number of points by using the -realtime_buffersize parameter, e.g. get-date -uformat "%S" | out-chart -refresh 0:0:1 -axisy_max 60 -realtime_buffersize 5 Regards, JuanC Quote Link to comment Share on other sites More sharing options...
Chris Kinsman Posted August 15, 2007 Author Report Share Posted August 15, 2007 I am using this command for the source of my chart: import-csv 'C:\Program Files\Vergent Software\TemperatureLoggingServiceSetup\TemperatureLog.csv' | select Date,{$_.Temperature} The CSV looks like this: Date Temperature 7/11/2007 16:22 82.4 7/11/2007 16:26 82.4 7/11/2007 18:11 84.2 7/11/2007 18:11 87.8 7/11/2007 18:13 84.2 7/11/2007 20:47 78.8 7/12/2007 5:30 75.2 7/12/2007 17:03 75.2 7/13/2007 6:30 71.6 I can't figure out where I would put the realtime_buffersize option. It doesn't show up in the chart designer when I click on "customize and add new items to gadget". Thanks, Quote Link to comment Share on other sites More sharing options...
marco.shaw Posted August 15, 2007 Report Share Posted August 15, 2007 OK, so you aren't passing the values one at a time to the gadget? What you have is a datafile and you import the whole thing on each run. You possibly want to keep your datafile for recording purposes. I think this will give you what you're looking for: import-csv 'C:\Program Files\Vergent Software\TemperatureLoggingServiceSetup\TemperatureLog.csv' | select -last 10 Date,{$_.Temperature} Use that as the data handed over to the gadget. Quote Link to comment Share on other sites More sharing options...
JuanC Posted August 15, 2007 Report Share Posted August 15, 2007 If your CSV will ALWAYS have more than 1 value then Marco's reply is what you need. Use Powershell to use only the last X number of items in the CSV. Please note that as the file grows larger, Powershell will take more time to process it all and return the last 10 elements. If you CSV only has the last point, then I am afraid we do not expose the realtime settings when using the creator. JuanC Quote Link to comment Share on other sites More sharing options...
Chris Kinsman Posted August 16, 2007 Author Report Share Posted August 16, 2007 Thanks! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.