I'm looking for a way to display a tooltip/popup in d3 that shows all data for a certain timestamp. I'm displaying up to five data series at once and sometimes, but not always, there are data from two or more data series at the same timestamp, and those I want to show when move the mouse along the x-axis.
Can this be done?
My solution for my problem was to write some own functions that first get the x-position where I click on the chart, convert that to a valid timestamp. Then matching with nearest actual timestamp in the dataseries. Then I show a rect as a window with the data at that timestamp for all series that has data at that timestamp.
Related
I am working with a dataset with which I am creating a dashboard. My dataset is very simple, a first column of [yyyy-mm-dd-hh-mm], and a second column with many values.
I read in many threads and forum about the difficulty to plot dates on x-axis (including hours and minuts).
As reference I am using this dashboard built in PowerBi https://www.terna.it/it/sistema-elettrico/transparency-report/total-load .(Public data of Italian electric energy generation)
This is exactly the outcome I would like to obtain, but by now I cannot display the hours and minuts. I used their data to reproduce the dashboard.
I tried to switch from a "dates" x-axis to a "text" x-axis, but the result is not the same, and furthermore the plot does not occupy the whole page but I have to move to the right.
enter image description here
I really cannot understand how the linked dashboard was built.
Any idea?
I guess your problem is that you have been using Date Hierarchy on the x-Axis you instead of Date only.
I have set of timestamps values from api and it's realtime. For every 5000ms i need to change the data in x-axis. I am using type as 'time' to plot timestamp values. How to change the timestamp values to format (06:00:30) . Also how to push the x-axis data for every 5000 milliseconds.
Any help could be really appreciated
Given the data arrangement in the image below (from google sheet) I tried to draw a chart showing time consumed by each activity, each activity has a start time, the end time of an activity is the start time of the next activity, I couldn't find a way to visualize such arrangement, is it possible ?
Update: Solution
This is what I reached now
Also I don't have to write end time, here is how I did it
End
=INDIRECT(ADDRESS(ROW()+1,COLUMN()-1))
Duration
=C:C-B:B
Minutes
= D:D * 24 * 60
Note: To draw the chart I had to move the "Minutes" column to the right, i.e labels column has to be on the left for the chart to draw properly.
After that you can hide helping columns C and D as they are just created for intermediate steps.
Yes, you may build a Pie chart based on time entries, but you need to convert time format into number format.
select column with time
go to menu Format → Number → Number
Or, for more visual, convert time formatted numbers into number of minutes:
= Time * 24 * 60
And then draw chart:
We have a local webserver which collects data from hardware and another web based app that shows the data on a line chart using JqPlot. Data fetch is done through Ajax.
I wish to show multiple data series on line chart, all having same xaxis values (the time value). The xaxis should be able to show time in minutes.seconds.milliseconds.
I have tried regular lineAxesRenderer, which is good, but shows only upto 1 decimal point, i.e. 25.1 to 25.2. If we have data that changes mutliple times within 100ms, we get different Y values for the same x value. This makes the graph look jagged, when actually we are getting different values for different time stamps.
I have also tried DateAxisRenderer, however in that case...the call to replot() to change the axis before redraw() simply fails. The x-axis data I am sending to the client is "H:M:S.MS" format. My options for x-axis are as follows:
xaxis : {
label : "Time (s)",
show : true,
renderer:$.jqplot.DateAxisRenderer,
rendererOptions : {tickRenderer: $.jqplot.CanvasAxisTickRenderer},
tickOptions: {formatString: "%H:%M:%S.%N"},
tickInterval:'500', // javascript timestamps are in milliseconds
},
What am i doing wrong here?
How do i show 2 or 3 decimal places on the x-axis if I use simple lineAxisRenderer?
Thanks and best regards,
Vishal
I'm trying to create something like a GANTT Chart where I would have start dates and end dates designated by a shape like a diamond and then the period of time in between connecting the start and end date shown as a line connecting the shapes. Does anyone have any tips on how to do that in tableau?
For data I have an identifier column, an event column, a date column, a start date column, and an end date column.
To make a basic Ghantt chart in Tableau, put the start date on the column shelf, convert it to continuous exact date. Put the identifier on the row shelf and change the mark type to Ghantt. This should get a short bar at the start date of each task, with a row per task (assuming the ids are unique per task).
Now you need to specify how long the bars should be by putting a field showing the number of days for each task on the size shelf. You can create a calculated field to compute those durations as datediff('day', contract_start, contract_end). Place that on the size shelf and you should be off to a decent start.
You can add more info to the tool tips and use color to show contract type or something else. add some reference lines by right clicking on the axis. You will need some tweaks in the calculated field to deal with things like null (unknown) end dates, maybe recurring tasks ...
If you want a few milestone markers, you can use reference lines or point annotations to add them by hand easily.
Or if you want to include milestones as shapes with your data, you can use a dual axis chart.
Here is an example showing how to combine shapes and bars into one char. The details vary slightly depending on how your data is organized, but if you examine how the data for this workbook is organized, how the data connection joins the tabs, and how the workbook displays the data, you should be able to adapt the approach to your own data. Just realize sometimes it is easier to revise the way your data is shaped to make the analysis simpler.
Also, you might want to consider if you need both planned and actual dates.
See also
Gantt over time with summed bar