my problem is: I'm doing a chart and have it to put the time of day in any axis, so there is a comparison that the rest of the result of the database(mysql) that I will receive. The problem is that I am not getting put this hour, not by the 'data set' or in any other way. Can you help me? I will be very grateful!
I'll put a picture below, more or less what I want. How is the image 0-24 in hours. Thank you all.
![enter image description here][1]
Create a computed column in the dataset with data-type Integer and an expression such:
var formatter = new java.text.SimpleDateFormat("HH");
row["mydate"]!=null?Number(formatter.format(row["mydate"])):-1;
where "mydate" is of course the name of the dataset field on which hours of days should be based. Then, use this computed column as x-axis of the chart. Notice in this example, possible null values are grouped on a fictive -1 hour number.
If you handle large volumes of data, then you can optimize this by creating the formatter as a global variable in "beforeOpen" method of the dataset.
Related
I read every possible forum and I couldn't find a specific answer. I'm new to Tableau and I need to perform what I thought would be a very simple task but I can't figure it out.
I need to create a chart with multiple lines plotted in the same graph. On one column, I have a timestamps in seconds (decimal). For each timestamp value, I have 4 columns associated (Temperature, Pressure, Humidity, Voltage) and I need to visualize how they trend over time. The data in Excel looks something like this (I simplified it for visualization purpose):
In Excel, it takes me less than seconds to obtain a chart that looks like this:
How can I replicate the same exact chart in Tableau? I would like someone to tell me exactly how each column should be formatted, if the data has to be a dimension or a measure and data type for each (string, number etc) and what steps to take in the chart. I would do this in Excel but the file is almost 1M rows and Excel keeps crashing.
drag & drop measure values & timestamp.
EDIT - first make Timestamp a dimension instead of a measure, and make sure it remains continuous instead of discrete. So you should not see the word SUM in front of Timestamp
remove no. of row & timestamp from the measure values.
uncheck aggregate measure.
EDIT this step is not usually needed or desirable. If you do have multiple recordings per Timestamp, you will want to select the best aggregation function for each measure, perhaps AVG or MEDIAN instead of SUM
select line from mark and drag measurement to color
If your X-axis is a Date Column, (i.e. You have a list of dates on your X-axis)
Drag your 'date column' to Columns and choose Month/Year/Week etc. and make it continuous
Drag 'Measure Names' to Filters and choose your Measures
Drag 'Measure Values' to Rows
Drag 'Measure Names' to the Colors section of the Marks card
I am plotting date-time vs integer in ZingChart. Even if there is difference of one second or the difference of 1 hour, the width is same between the two points. If the starting time is same as the previous one, like in my attached image at 23:24:40, there should not a white gap in between if it is proper date and time axis. Is there any solution to this problem? You can also view it on alnnovative.com/zing6.php
ZingChart will automatically place values at each index, unless you use key, value pairs as your data points. To do this, set your series object values like so:
"values":[
[1420070400000,50],
[1420071000000,50],
[1420070520000,50],
[1420070640000,50],
[1420070700000,50],
[1420070760000,50],
[1420070820000,50],
[1420070940000,50],
[1420071060000,50]
]
Take a look at this demo. I'm a member of the ZingChart team, let me know if you need more help.
Does anyone know how to set up a date time axis to use DateTime Scale in a line graph in Telerik Reports? I have been trying to figure it out for over a week now. I don't understand why this thing has to be so difficult to use. I started by setting up a line graph.
I have three columns DATE, SALES_COUNT, and SALES_TYPE. I want there to be three lines on the graph. One for each value of SALES_TYPE. I used SALES_TYPE for the series, SALES_COUNT for the value, and since I didn't have any other options left, I used DATE for Categories. I clicked finish and previewed my graph. The graph looked right except I wanted to make a few customization to the DATE axis. Specifically I only wanted it to write out a date label for every 5 ticks or so. There was no way to do this.
Eventually I figured out that I have to set the axis to use DateTime Scale since it defaults to Category Scale. I set it to date time scale and previewed the graph again. I got the error: "X value cannot be null or empty when using DateTimeScale, lineSeries1", so I went to lineSeries1 and set the X value to "= Fields.DATE", and clicked preview. Now the graph nolonger displays any of my data points, and there is only one tick on the DateTime axis and its labeled as 1/1/2015 12:00:00 AM, a DateTime that is not even in my dataset. I have been struggling for over a week now to figure out how to do this simple task. Please help me.
The SQL query I was using was handed to me by the DBA. I never really looked at it, I just stuffed it into the report. It turns out the query was returning the DATE column as a varchar. Once I cast the DATE column as a date in the select column list of the query, Setting the axis to use DateTime Scale worked fine. If anyone else runs into a similar problem, check the return types of your columns.
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.
In my tableau visualization I need to show the change in a metric over every minute for a day.
I have a "minutes" table in my db. Each row has columns: "minute_id", type int
"minute", type string: carries the value of the time eg: "05:33, 12.30, etc"
"min_date_time", type datetime: carries the value of the time datetime equivalent of the above string value eg: "2013-11-01 2:30:00 AM, 2013-11-01 2:31:00 AM, etc"
A second table called "demos" has all the metrics that are shown for that specific minute.It has relevant columns as follows:
"minute_id", type int: foreign key for the minutes table
"ind2plus", type float: value to be displayed on the y axis for each "minute_id"
This is what I have so far:
The problem Im trying to solve is:
On the X axis currently the displayed unit is "minute_id".
I would like to keep minute_id as the values on the X axis,
but I would like to change the values "displayed" as labels on the X axis from
the int value in the "minute_id" column to the string value in the "minute" for every "minute_id".
How do I do that? Please advise.
UPDATED GRAPH:
If you have a true datetime field in your data, you get more flexibility by using that field for most situations.
So I suggest putting your min_date_time field on the columns shelf to replace minute_id.
Tableau allows you to use dates and time fields in many different ways for different effects -- so many options that it can be confusing. You have to choose whether to treat the field as a dimension or measure, whether to treat it as discrete or continuous, and what level of granularity to use (hour, minute, month, exact date ...) It will take experimentation and experience to get comfortable with implications of the different choices.
For your graph, I would start by choosing a continuous dimension at the minute level. You can adjust the settings by clicking the little triangle on the right of the pill on the columns shelf. The truncated date settings are the second batch of date menu options and result in a green pill. Once set, you can drill up/down granularity with the + on the left of the pill.
Finally, once you are happy with your chart, you can change the formatting instructions to affect how dates are displayed on the axis. Right click on a number on the axis, choose format, and then in the format pane, under scale you should see a pull down labelled Dates. You can choose one of the existing date formats or enter a custom one. The format strings are pretty much what you expect.