I want to create a plot that shows the live metering data I am getting from an electricity meter.
I already figured out how to have a plot in bokeh, that updates every x seconds with new values, but now I want to have the new values always be at a fixed point in the plot, while the range of the axis does not increase.
I fixed the range by adding x_range=[0, 10] to the figure, however that plot is running out of the screen and I have to manually follow it.
How do I change it so it follows it automatically?
Is that even possible in bokeh or should I be using something different for my project?
Use a default DataRange1d range (i.e. do not set the range to a fixed interval) and then set the follow property on the range. You can also set follow_interval to specify how far back the range should trail the latests data.
p.x_range.follow = "end"
p.x_range.follow_interval = 100
For a complete demonstration see the OHLC ticker example.
I have a calc file with two spreadsheets in it. One that is called 'Master' has column A filled with text values. I need to copy those values onto the second spreadsheet along a row by using a formula like =$master(A1), however when you copy the formula along a row it also changes the variables to move along the row as well so instead of thew next cell being $master(A2) it ends up being $master(B1). How can you Keep the column the same but only increment the number? Like $master($A+COLUMN)
If tried OFFSET and INDIRECT but I cant get those to increment correctly either. It seems to me you should be able to do something like $master."A"&1 but that doesn't increment at all.
OFFSET should work fine, but you need to use the current COLUMN -1 as the offset for the row:
=OFFSET(master.$A$1;COLUMN()-1;0)
The -1 is needed since you start at the first column, but want to have an offset of 0. If you start at another column, adjust the subtraction accordingly.
Copy the formula along the row.
When a graph is very wide I want to show the y-axis values also on the right side of the graph so it becomes easier to read the corresponding values of the lines.
I know how to duplicate the left axis to the right. And when the graph is created I use ActYscl to set the range of scale nr 0 (left) to scale nr 1 (right). This works when the graph is created and also the zoom and pan function work on both y-scales. However, when I use the Autoscale function of the Graph Pallet, only the initial axis is scaled (probably because the graph data are only linked to the original axis).
Is there a way to make the autoscale function work for both y-axis at the same time?
Charts and graphs have an Autoscale Range Change event. Use an event structure to catch this event and update the range of the duplicate scale to match the first one:
I've used a chart for this example as it's simpler, but it should work the same for a graph. Of course you need a way of telling the event loop when to exit; I've used the Value Changed event of the stop button. If your application uses an event-driven structure anyway, you should just be able to add the autoscale event to your existing event loop.
I want to plot stacked column graph through Shinobi.
Please referer attached screen shot for desired graph.
Can anyone please suggest how to pass data point for the same.
Disclaimer: I am a developer at Shinobi Controls.
To get columns to stack you need to create a series for each column you wish to stack.
To get the series to stack, you must set each series' "stackIndex" property to the same value.
For example, in your image you will need 5 SChartColumnSeries with their "stackIndex" value set to the same value, lets say 1.
Now you can add one datapoint for each series with the same X value but with different Y values.
The subject of this question might not give the true scenario, please read all below, thanks.
I am developing a Scatter Plot based on following data (JSON - in a file simple.json):
{
"docs":
[
{"timestamp":"01","id":"100","quantity":"5","pay":"50","bp":"25","city":"Multan"},
{"timestamp":"02","id":"200","quantity":"10","pay":"100","bp":"50","city":"Lahore"},
{"timestamp":"03","id":"300","quantity":"3","pay":"30","bp":"15","city":"Multan"},
{"timestamp":"04","id":"400","quantity":"5","pay":"50","bp":"25","city":"Multan"},
{"timestamp":"05","id":"500","quantity":"6","pay":"60","bp":"30","city":"Lahore"},
{"timestamp":"06","id":"600","quantity":"15","pay":"150","bp":"75","city":"Islamabad"},
{"timestamp":"07","id":"700","quantity":"14","pay":"140","bp":"70","city":"Islamabad"},
{"timestamp":"08","id":"800","quantity":"18","pay":"180","bp":"90","city":"Islamabad"},
{"timestamp":"09","id":"900","quantity":"7","pay":"70","bp":"35","city":"Lahore"},
{"timestamp":"10","id":"1000","quantity":"20","pay":"200","bp":"100","city":"Islamabad"}
]
}
I am trying to develop a Re-Usable graph, where I can present user with available data columns (from above data). So user can select a certain column (say "id") for X axis and another column (say "quantity") for Y axis (till here everything is perfect and as per expectations). And later user can select another column and can click a button to plot that column on the graph (along with previously added columns).
Here comes the problem:
When I proceed with another column (say "pay") for Y axis, while keeping previously on the graph, new ones get plotted correctly (I am rescaling the axis based on new data as well). But the old ones DO NOT RE-ARRANGED. This is the actual problem. I am thinking to keep track of each column added (by storing column references in a separate array), so every time there's a new column, I will have to redraw the old ones again (should I?). But this doesn't look feasible in terms of D3's power or performance.
For this I also applied an anonymous class "update" to every circle drawn, so that I can pick all "update" circles, but here comes another issue, that how would I know the new place for these circles? Do I need to traverse the data again for that particular series? and have to do that drawing again? For every new series, keeping track of old-ones and redrawing them, will increase the processing over-head turn by turn. Is there any handy solution or built-in (d3's) mechanism to re-adjust previous drawing according to new scale?
Please suggest something. I am sure I am lacking some key points.