Tableau constant reference line issue when changing date range - tableau-api

I have a few reference lines showing the previous year's averages. The problem I'm running into is when I select a smaller date range (like 10 days vs 90 days) the chart just cuts to that date range instead of resizing the entire chart so that you can look closer at the selected days. Is there a way around this?
This is not how I'd like it to look when I isolate down to a smaller timeframe:

Resolved...changed the date to discrete that fixed the issue.

Related

Tableau - creating vertical lines on specific dates when the date axis (x-axis) is set to "week"

I'm graphing weekly total page loads per 1000 students, which is easy enough when the pill for the page load variable is set to 'sum', and the date pill is set to 'week number.'
BUT, I also have a table that lists individual dates on which important policy changes occurred, and I want to draw those as vertical lines.
Using a dual axis, I have been able to plot the specific dates as lines, but because the resolution of the date axis is set to "week", it lumps all dates in the policy change table that occur within a single week into one, or possibly omits dates that don't land on the right date for that week, and therefore I don't get individual lines for every policy change.
weekly resolution, dates omitted
I have been able to approximate what I'm looking for by setting the date pill to 'day,' and then doing a rolling average of the page load values--but this doesn't represent the page loads in the way I need it to.
rolling sum, not the same calculation, but includes dates
I need either a way to layer two charts on top of each other, with different x-axis resolutions, or possibly the correct calculated field that gives me the straight up weekly sum of the daily total page loads for successive weeks, so I can use the 'day' setting on the date-time access but still get the weekly values I want, and then plot all dates in the policy change table.

Qlikview Combo Chart - Series not aligning with Axis

I have a combo chart that I want to track Actual spending versus Budget over a 3 year period. The Budget line items are bar charts, the Actuals are displayed by a symbol. There is only one data point for Actuals, 2020, Budget data is for 2020-2022. My problem is that Actuals are aligning with 2021, not 2020. Viewing the data as a straight table, I know my data calculations are correct. I am not suppressing zeros and the order of expressions (promote, demote) has no effect. Any ideas why this is happening and how to fix it?
Image explaining the issue

Tableau add trend line to discrete data?

I have run into this more times then I like, and I think it will continuously haunt me. I am creating reports/dashboards that report monthly or yearly or weekly data. The dates come in with just the last day of the period. For example, now I am working 2019 monthly report that is a bar chart with a trend line. Took me about 15 minutes to make in excel. However, we are trying to move everything into Tableau for dashboards. Trend line is always grayed out when using discrete dates and sometimes when using continuous dates. The dates are in the format DD/MM/YYYY so I can convert them as continuous but that skews the spacing on the X-Axis. I have messed around to get it to work but it takes time. I am shocked that this very basic thing does not work when Excel has been able to do it for a very long time. Does anyone know of a good work around? I have tried calculated the trend line myself, but do not see how I can add in the y=mx+B line that is generated. I am debating creating a data set just for this, but that seems long and hard way for something that I would have expected out of the box. Below is some basic data, in Excel it takes about 1 minutes to create a line chart, click (+) add trend line and your done.
I was not able to deal with the skew of the X-Axis very well but playing with the date it started and setting the major tick marks to monthly got me close. Looking at the picture below you will see the tick marks are not in the center of the bars but close. As for the trend line, I added a Dual axis on the same data that was the sum of all shown fields with no division by the parts (this is a stack mark bar chart). Since this is a basic line chart with continuous dates, a trend line is a simple click. I then removed the Tick Markets and set the opacity to 0% making the line invisible. I did not change the trend line so now that is all you can see. Seems like a long and hard way to do it, but it works. (UPDATE) Better fix, NEVER USE EOM always use First of Month.

Swift Linechart for timeline

I am planning to do a linechart, which should represent price changes based on a week, a month and so on. Therefore, I use the cocoapod "Charts" (github.com/danielgindi/Charts).
I always have the price changes for a certain point in time. I am wondering now how I could create the chart, that the x-line is showing the values according to the accurate time - and not the same distance for each value, even when two values are on the same day, and the next one 3 days after.
At the moment, it looks like this:
This should then help to insert a marker, where the user can move through the days/months, and see what the price was for each point in time.
Does anybody of you has an idea? I thought about adding values for each half hour to the dataset, with dummy values, to receive the same result, but this doesn't seem like a perfect solution..
Thanks a lot,
Alex

iReport line chart category label

i'm using the Line Chart component to generate a chart based on the consumption of a building.
Imagine a possible chart based on the consumption of a building in a period of a month and a resolution of a day. It will have 30 points of consumption corresponding to 30 days.
The problem is with the category axis labels. With a considerable amount of points, the labels becomes unreadable. How can i just label some points?
My best regards
Don't use a "Line" chart. Instead use a "Time Series" chart.
It automatically handles the issues around charting all points but only labeling a readable number of them. It also handles problems created by data points that are not uniformly spaced.
EDIT: If your incoming data is a String instead of a Date, then you have extra work. Time Series charts expect Times (well, Dates). You'll need to cast your DateString into a real Date. But the work is small, and the benefits are large. Use a variable like this: new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").parse($F{MyDateString}).
Use this code to generate a label on the line chart in JASPER report
else if(jasperChart.getChartType() == JRChart.CHART_TYPE_LINE) {
LineAndShapeRenderer line = (LineAndShapeRenderer) chart.getCategoryPlot().getRenderer();
line.setBaseItemLabelsVisible(Boolean.TRUE);
line.setBaseItemLabelGenerator((CategoryItemLabelGenerator) new StandardCategoryItemLabelGenerator());
}