moving series from one chart to another - lightningchart

I have Single dashboard with multiple charts.And each chart have multiple series.
Let us say chart1 and chart2
Now is there anyway to move all series and data from one chart to another ? I want to move all the series (lines and scatters) from chart1 to chart2 , And I want to clear the series in chart1 , which I can do with .dispose method.
lightningChart().Dashboard({
container: container,
numberOfRows: 2,
numberOfColumns: 1,
theme: theme,
});

there is no utility for this kind of application, so you'll have to go with the simple solution of removing the moved series and recreating them from scratch in the other chart.
The dispose approach for removing the moved series is correct.
For implementation, I'd advise to maintain some data structure for every series and the data it contains. Then you can recreate it and show the same data relatively simply.

Related

How to check if a plot is visible under a tab panel?

I am working on data visualization with R and shiny.
It takes some time to load my visualization and be able to provide plots under tab panels.
Ex. I made 3 tabs for box plot, bar plot, and bean plot
Taking time to visualize the result is understandable, but I am not sure how to check if the plot is visible so that users do not need to wait even though incProcess function reports the program is done.
First, I recorded the time to visualize and tried to delay some time, but it is very subjective to the data input, so I do not think that is a good solution.
Would you be able to provide me solution?
Thank you
I think I need a solution NOT to check if a code is done but the visualization is done.

R Highcharter - Navigator as input

I am using the Highcharter library in my R Shiny apps to build some dashboards and I was wondering if it would be possible to use the navigator (hc_navigator) as an input.
For example: by adjusting the time window of the chart in my graph, I'd like to calculate the avg or the sum of the displayed data point in the chart. Of course, I'd like this to be dynamic (i.e. any time that I adjust the time window with the navigator, I want the calculated value to update)
Example - This is my baseline chart: Baseline chart. I want to add a box which calculates the avg of the data points displayed in it. But, whenever I adjust the navigator (pls see here: nav-adjusted chart), I want the avg to change according to the data points which remain in the chart.
Does anybody have any idea on how to achieve something like this? Hope I was clear enough :)
Thanks,
Lorenzo

How to draw scrolling graphics in R, like financial time series

I would like to draw financial time series in R, that are continuously updated all along the day. Sometimes I can have several updates per second and I want to draw the time series as it evolves.
Moreover, I want to improve my graphics with extra information that I will plot too on the same graph (not necessarily a time series).
So I wonder if there is either:
a package in R to draw such series and have them scroll automatically as soon as I push new data
or a way to do bit blit in R and simply update my graph,
or a way to use packages like grid or anything else that would draw what is necessary (at least lines and points) and help scroll the data quickly to have a smooth rendering.
I would like something a bit more modern than a TCL/TK solution like explained here
We are doing this with shiny and a timer variable which refreshes the plot every n seconds.
R itself isn't really made for continuous updates. The (default) graphics device is static (so you can't easily 'append one point'), and there is only one event loop.
You can do it with external programs -- I have used both custom Qt applications I wrote for this as well as custom data handler in the (awesome, under-appreciated) kst real-time visualization program.
I'm not on financial data, but if the data file is itself updated along the day, the simplest solution would be something like:
k <- 0
while ( k<=3600 ) {
foo <- read.table("data.txt")
plot(foo[,1], foo[,2])
Sys.sleep(60) # seconds
k <- k+1
}
This would redraw the plot each 60 seconds. You can put a web adress for the data instead of "data.txt" also. To "scroll", you can play with the xlim argument to plot().

D3.js - Multiple Series (columns) of Data on ScatterPlot at Y Axis

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.

Show all series' values in stacked bars mouseover (ASP.NET CHART)

I'm using the asp.net Chart control to present a stacked bars chart.
I can create a mouseover custom tooltip using this code:
series.MapAreaAttributes = "onmouseover=\"showTooltip('#VALY');\"";
... which works fine. But I can't seem to find a way to show the rest of the values for the other series in that column.
Example:
I have 2 series (Paid and Unpaid) making up a single column in the chart. When I mouseover any of the series, I want to show both the value of the moused-over series, but also the other series contained in that particular stacked column.
Can anyone point me in the right direction?
We're also using stacked bar charts - we have click through functionality, for users to drill into the data making up each point in each series : we use something like this on each data point.
series.Points[index].MapAreaAttributes = "onclick=\"window.opener.location=this.href;window.opener.focus();return false;\"";

Resources