Vertical reference line in Google Data Studio line chart - google-data-studio

I'd like to add a vertical reference line in a line chart at the position of the current month. Any way to do this?
Current chart:
Desired chart:
Thanks!

The Calculated Field below (where Date represents the name of the Date field, and Metric, the name of the current metric) adds a Bar on the current month:
1) Data Tab
Chart: Time Series
Dimension: Date; Type: Year Month
Metric #1: Metric
Metric #2: Today
IF(DATETIME_TRUNC(Date, MONTH) = DATETIME_TRUNC(TODAY(), MONTH), 1, NULL)
2) Style Tab
Metric #1: Line; Axis: Left
Metric #2: Bar; Axis: Right
3) Remove Right Y-Axis
Right Y-Axis (Custom Tick Interval): 1
Shape: Add a shape over the 0 to hide the last visible value of the Right Y-Axis
Editable Google Data Studio Report (Embedded Google Sheets Data Source) and a GIF to elaborate:

You can use this example below (borrowed from here). After you change the date to a number, you can put this new value on the right axis and make it a bar.
CASE
WHEN CAST(FORMAT_DATETIME("%Y%m%d", Date) AS NUMBER ) = [YOUR DESIRED DATE] THEN 1
ELSE 0
END

Related

How to zoom in on a google data studio line chart

so this chart represents my p/l during a day! X axis is created using a timestamp column and Y axis is created using a p/l column in google sheets. Now, how do I remove the blank space from 12am to 6pm. This chart represents my p/l during a day when Im trading stocks.! I only trade from 7pm to 10pm hence I don't want every single hour of the day!
I got the desired output by applying a timestamp filter but it could only be used for a specific date! Is there any way to zoom in on the blue part? or any filter to hide specific hours?
I'd grateful if you guys could help!
if you're using Time Series chart, you can go to Style-> find x-axis part-> under Range you can click the dropdown and select Range by Data.
Hope it helps!

change bars chart granularity to Days/Month/Week by report user

i have few simple charts where each bar represent day according to date rage control I've added.
i want that the report user will be able to change aggregation
so instead of each bar that represent day,i want each bar that represent month or week
is there anyway i can do that in Google Data Studio ?
Thanks
Assuming you have date as Dimension in the Data tab to the right.
You can 'drill down' by selecting the switch just below.
Add the date dimension again then edit this new dimension and change type
to Date/time and select the granularity such as week or month.
Then in view mode there will be up and down arrows in the top right of the plot which allows you to change view to different drill down options (week/month etc) which you selected in the data tab.

Time Series chart showing dates with intervals filled with dots

I have a datastudio time series chart where the x axis represents the dates in a month which is got from a query and the y axis represents the cpu utilization value for a instance, The break down dimension is the instancename. When I create the time series chart, the x-axis does not display all the datas, it displays dates with 2 days interval which is filled by dots. Is there any way i can fill the dates instead of the dots in a continuous pattern.
Update
As per the given answer below I have updated this question. Now the unnecessary dots have been removed and it displays the dots only for which there is data, but is there any ways that the dates can be continuous for which there is data, ex as per the below chart there is data for all the dates between July8 to July 23 for the particular instance gcp-wsus, but it still displays dates with a 2 day gap interval July8,July11,July14 etc.
Can this gap be filled with dates also? Thanks
In a Time Series Chart, It can be achieved by changing the Missing Data value from the default (Line to Zero) to Linear Interpolation:
Google Data Studio Report and a GIF to elaborate:

scorecard chart how use date, datastudio

I would like use latest date value from my table in Scorecard,
Any idea how to import this Date value in DataStudio report ?
There is no option like "Max Date", similiar to Max value used in Digit Values.
There is only Count option:
Or advice how to insert date as Label to another ScoreCard chart.
2)
One more question: Is it possible to insert date function in Text field? Probably not right ? If I wanna join my line of text with some Date
Hi Nim thanks for help and what about if I want show last data from last 3 days in 2 item dimension table ? In one item I can just use row filter, but how in 2 item ?
In my case for example most 5 countries by last 3 days, by now I can only show most 5 countries by last day:
...Actually I can setup in the bottom option : date range (last 7days), but I have still too many rows, solution should be somehow limit number of rows per day...somehow
Question 1: How to display the Max Date LIKE a Scorecard?
1.1) Data Tab
- Chart Type: Table
- Dimension: Date
- Sort: Date in descending order
- Rows per page: 1
1.2) Style Tab
- Show Header: Deselect
- Row Numbers: Deselect
- Show Pagination: Deselect
- Table Labels Font Size: As required (e.g. 24px)
1.3) Text Box
- Add a Text Box stating Max Date if required
- Precision Movement: Use Shift + Movement keys to finely place the components exactly where required.
Google Data Studio Report and GIF to expand on the above:
Question 1 (Original Post - Currently doesn't work as expected): How to display the Max Date on a Scorecard?
At the Metric field of the Scorecard, create a Chart-level Calculated Field that explicitly aggregates the Date field by MAX:
MAX(Date)
Google Data Studio Report and a GIF to demonstrate:
Question 2: How to display the latest Metric?
2.1) Data Tab
- Chart Type: Table
- Dimension: Date
- Metric: As required (e.g. Sessions)
- Sort: Date in descending order
- Rows per page: 1
2.2) Style Tab
- Show Header: Deselect
- Row Numbers: Deselect
- Show Pagination: Deselect
- Table Labels Font Size: As required (e.g. 24px)
2.3) Overlay
- Add a shape or text box over the Date field part of the Table to ensure that it's not visible and set the colour of the shape to a solid colour that blends in with the background (such as White for a White coloured background).
- Order: Ensure that the shape or text box is placed in front of the Table.
- Precision Movement: Use Shift + Movement keys to finely place the components exactly where required.
Google Data Studio Report and GIF to elaborate:

How to display only few intervals in x-axis while having more data using line jfreechart

I created a linechart using jfreechart and my dataset is as follows...
Date d = s.getUpdateDate();
String date = DATE_FORMAT.format(d);
lineDataset.addValue(s.getCount(), s.getAutomationName(), date);
I got a chart with count values and wrt grouping of date and automationName.
I want to display data for 365 days(which means 365 dates) in X-axis and in that case once the chart is generated i dont want all the dates to be displayed in the X-axis. In that case i need only 12 intervals to be displayed one for each month.
I need the interval to get modified so that all dates should not be displayed in x-axis.
Looking forward for your suggestions :)
Thanks in advance
I have domain axis intervals for all 365 days. It is not possible all of them in the chart. So I wanted to display only few intervals like 1 per month resulting in 12 intervals displaying in domain axis.
I came to know about timeseries chart and it automatically does it based upon chart width.
Thanks moeTi.

Resources