Map step to linear scale more than 100 with MUI Slider - material-ui

I'm using MUI slider, and I'm at a loss how to create a slider with mapping for values more than 100. Apart from creating all 180 days in the mark array and restricting the values, is there another way to do it? I was hoping to be able to set something like step={1} and stepLength={100/180} which will give the distance travelled on the line per step (signifying one day).
I have this codesandbox with my not-working-correctly example.

Just had this same problem. Add
max={180}
In your
<Slider
...
min={0}
max={180}
...
/>
Then change the values under your labels inside of
const Marks = [...];
To get your desired output!
If you want to add a side button to increment by a certain amount, MUI also has an input field option.

Related

Is there a way to set the amount a sliders value changes when you use it?

I'm am trying to make it so that when you interact with a slider, it goes up or down by 5. I know you can make it go up in whole numbers but can you change the base value that it increases/decreases by?
Not a built-in feature unfortunately. The workaround is to enable Whole Numbers, and set:
Slider min = Actual min / Step
Slider max = Actual max / Step
Then in your code you can do Actual value = Slider value * Step
Or you can write your own slider component with stepping support.
PS: I know, it sucks.

How to put color for the whole cell

I am trying to color code my list in tableau with red color for dates in end date lesser than today() or when concern column is Yes. I created a dual axis of 1 and 0 to get the cells with color in one column and get the text in another and created a dual axis so that they overlap. For that I created a calculated column where I gave the color red if the conditions meet.
This is in my calculated field:
Color:
IF TODAY()>[End Date] OR [Concern (Yes/No)]="Yes" then "RED"
ELSE "None"
END
However even after totally maximizing the size of the square for color for 1. The fields do not fill the whole cell. How do I fill the whole cell?
Here is the pic:
Please help me out here?
You may have 2 options here. I haven't tested so will leave you to see what works best.
Option 1 - use a measure and a Square mark type. Create a calculated field that returns a measure. We can adapt the formula you have built:
INT(TODAY()>[End Date] OR [Concern (Yes/No)]="Yes")
Put that field on Columns - aggregate to either MIN or MAX, doesn't matter - and set the Mark Type as Square. Also put this field on Colour and set your colours accordingly. Put your text on the Label shelf (or Text, I forget what it's called with the Square mark type.
Option 2 - similar to what you have now. You don't need MIN(1) and MIN(0), just one of those should suffice. Make it Gantt, the above calculated field on colours and your text field on Label. This article on the Tableau placeholder technique describes how to do this.

How to use a range instead of a single value for an axis tick in Tableau?

I don't want to mess with the graph itself, but I want to change the axis tick so that it reads a different value. Right now my axis looks like 0, 1, 2, 3....24. I want it to look like: 0-1,1-2,3-4...23-24.
Is it possible to just change the text without changing my graph?
Thanks in advance!
One way to implement this would be by converting your column in to a discrete value and changing the alias for value 0 to 0-1, 1 to 1-2... and so on.
Hope this helps.
Another option is to create a calculated field and return the range based on the values. This gives you more control if you would like customize your range in the future. There will be an issue with sorting which you will need to work out.

Conditional formatting numbers in Tableau

I have some basic spreadsheet info and I need to compare it to previous quarters. I just want a crosstab or heatmap type visualization showing if we are up or down from previous quarter.
Something like this:
So leads and closings have increased quarter over quarter so those should be color coded green. Referrals should be coded green for the first two but code red for Q22018 since the number went down. Is this possible in Tableau? I played around with a calculated field but I'm not sure how to compare the number to a previous quarter info number and not a set number.
I'd like it to look something like this:
Adding screenshot:
This can be done using a Table Calculation in Color shelf.
First create a table calculation as below and drag it to Color. Change the mark type to Square.
Edit the color like below.(If you do not want to play with the color, you can create a custom calculation to return red or green)

Show Separate Mark Labels alongside Measure Value Labels

(source: tableau.com)
I'm using Measure Values for combining two measures:
1)Count of Clients (As a percentage)
2)% Retention (Calculated field which uses another calculated field called Numerator Retention in it's formula over the total to calculate the %)
Measure Value Mark Labels successfully show the respective percentages for the two measures. Now I wanna show the respective count of clients or numbers behind these percentages but I'm unable to do so since I've already used Measure Value Mark Labels to do something similar.
When I try editing the Labels text, it edits it for all labels together and hence I'm getting all labels for all rows and not how I want it to show selectively as I described.
Example Solution: For Private Residence, I only want 125 to show with 60% which is the actual number behind the percentage. And I want only 119 to show with 95%
You can do this, but not using Measure Values. You should mirror what I have done here. I do not know your calculation for the Respective Retention, so use your calculation.
You need to move both of your measures to the Columns shelf and make them a Dual Axis:
After doing that, you will have access to the individual measures - so you can give labels independently:
Just make sure you place the measures that you want for each axis respectively.