data-visualization

how to Find out users_id with some conditions filter

£可爱£侵袭症+ 提交于 2020-12-15 05:15:27
问题 i have a table like this order_id | user_id | createdAt | transaction_amount order_id as the id of the transaction, user_id as the user, createdAt as the dates, and transaction_amount is the transaction of each id order. so on tableau i want to find out users in time range '2020-01-01' until '2020-01-31' with 2 conditions the users are doing transaction before last date in range ('2020-01-31') and atleast doing more than 1 transaction and the users are at least doing 1 transaction in date

How can I make ggplotly show hover tooltips for a geom_rect series?

左心房为你撑大大i 提交于 2020-12-15 04:27:39
问题 I am trying to create an interactive visualisation of an individual's salary growth across multiple employers. I am using a geom_rect series to show pay periods and salary information. When I apply the ggplotly function, hover tooltips are not showing by default, and I cannot find a way to enable them. What can I do to enable tooltips over the geom_rect? data: df <- data.frame( "From" = seq(as.Date("2016-01-01"), as.Date("2026-01-01"), by = 14), "To" = seq(as.Date("2016-01-01"), as.Date("2026

How do I get ggplotly rangeslider to set a sensible initial range with a date axis?

别来无恙 提交于 2020-12-15 04:24:36
问题 I am trying to create an interactive visualisation of an individual's salary growth across multiple employers. When I add a rangeslider to the ggplotly function, the initial min and max values for the slider are set nowhere near the range of observations. How can I get reasonable initial values for the slider, either by having it set automatically based on the data range or set manually? data: df <- data.frame( "From" = seq(as.Date("2016-01-01"), as.Date("2026-01-01"), by = 14), "To" = seq(as

How can I make ggplotly show hover tooltips for a geom_rect series?

那年仲夏 提交于 2020-12-15 04:24:08
问题 I am trying to create an interactive visualisation of an individual's salary growth across multiple employers. I am using a geom_rect series to show pay periods and salary information. When I apply the ggplotly function, hover tooltips are not showing by default, and I cannot find a way to enable them. What can I do to enable tooltips over the geom_rect? data: df <- data.frame( "From" = seq(as.Date("2016-01-01"), as.Date("2026-01-01"), by = 14), "To" = seq(as.Date("2016-01-01"), as.Date("2026

Google chart API: Set values of node labels in Sankey diagram

﹥>﹥吖頭↗ 提交于 2020-12-12 18:18:34
问题 I am trying to create a simple Sankey diagram showing flows between two sets of nodes, and would like the two sets to have the same names. However, this isn't allowed (it brings up a "Cycle found in rows" error), so I add "2" to the names of the nodes in the second set, like so: function drawChart() { var data = new google.visualization.DataTable(); data.addColumn('string', 'From'); data.addColumn('string', 'To'); data.addColumn('number'); data.addRows([ ['foo', 'foo2', 6], ['bar', 'bar2', 4]

Google chart API: Set values of node labels in Sankey diagram

耗尽温柔 提交于 2020-12-12 18:17:43
问题 I am trying to create a simple Sankey diagram showing flows between two sets of nodes, and would like the two sets to have the same names. However, this isn't allowed (it brings up a "Cycle found in rows" error), so I add "2" to the names of the nodes in the second set, like so: function drawChart() { var data = new google.visualization.DataTable(); data.addColumn('string', 'From'); data.addColumn('string', 'To'); data.addColumn('number'); data.addRows([ ['foo', 'foo2', 6], ['bar', 'bar2', 4]

R: Modifying Graphs

故事扮演 提交于 2020-12-12 09:01:53
问题 I posted a comment/reply to another stackoverflow post over here : R: Understanding Graph relating to graphs in R. If you create some data corresponding to movies and actors (in which movies can not be connected to other movies directly, and actors can not be connected to other actors directly), you write some R code to check if your graph is bipartite: library(igraph) film_data <- data.frame( "movie" = c("movie_1", "movie_1", "movie_1", "movie_2", "movie_2", "movie_2", "movie_3", "movie_3",

R: Modifying Graphs

拜拜、爱过 提交于 2020-12-12 09:00:34
问题 I posted a comment/reply to another stackoverflow post over here : R: Understanding Graph relating to graphs in R. If you create some data corresponding to movies and actors (in which movies can not be connected to other movies directly, and actors can not be connected to other actors directly), you write some R code to check if your graph is bipartite: library(igraph) film_data <- data.frame( "movie" = c("movie_1", "movie_1", "movie_1", "movie_2", "movie_2", "movie_2", "movie_3", "movie_3",

Plotly: How to show more than 2 x-axes titles/ranges on the same subplot?

戏子无情 提交于 2020-12-12 05:40:35
问题 I'm using Plotly and making scatter plot subplots with a shared y-axis and different x-axes. I have attempted to use the figure object (fig['layout'][data index]) syntax to show multiple stacked x-axes and their respective ranges. I have only been successful in showing two xaxes and ranges per subplot by assigning 'top' and 'bottom' to the side attribute of the figure layout. The 2nd column from the right in figure below should show titles/ranges for series T5, T6, and T7 but only the title

how to order the x-axis (in a graph) in chronological order?

▼魔方 西西 提交于 2020-12-12 01:59:07
问题 I create some fake (time series) data in R at daily intervals. I want to "aggregate" the data by "week", and then plot the data. I have posted my code below: #set seed set.seed(123) #load libraries library(xts) library(ggplot2) #create data date_decision_made = seq(as.Date("2014/1/1"), as.Date("2016/1/1"),by="day") date_decision_made <- format(as.Date(date_decision_made), "%Y/%m/%d") property_damages_in_dollars <- rnorm(731,100,10) final_data <- data.frame(date_decision_made, property_damages