How can I make each Packed Bubble a different color? - tableau-api

I have a Packed Bubble dashboard. My Y axis is a list of names and my X axis is a decimal. I want each differing number to be a different color. Can I do this manually?

If you want to color each bubble with a separate color just use the field that each bubble represent in the color shelf. If I understood your data correctly, each bubble basically represents one campaign, so you should use that as the color.
You can manually assign color using Color>Edit Color and assigning the color of your choice.
See image 1.
If you want to color your bubbles based on your measure AVg(NPV/Marketing $) you can do as Alex Blakemore mentioned and use your measure as a stepped color or gradient.
You can use Color>Edit Color here too , in this case manually assigning color is a bit difficult. But if you play with number of steps, the gradient pre-select, etc, you can usually get very close to what ever your wanted it to look like.

Put your numeric field on the color shelf, and either edit the colors to use a stepped set of colors - or change the field to be discrete and choose individual colors to taste.

Related

Altair Scatter Chart

i am looking for a way to make a point chart based on multiple nominal conditions. i am plotting 2 values on x and y, but i would like to differentiate these points based on year as well as 'type'.
currently, the way i do it is to assign year to color while 'type' is assigned to shape
color=alt.condition(selection, alt.Color('Date:T'), alt.value('lightgray'), scheme='red' )
shape = alt.Shape('type:N')
a few questions:
is it possible to change the color scheme of the points instead of the default colors to say shades of red/blue/black, etc?
is it possible to assign one color scheme/shade (instead of shapes) to 'types'?
is it possible to change the color scheme of the points instead of the default colors to say shades of red/blue/black, etc?
Yes, see https://altair-viz.github.io/user_guide/customization.html#customizing-colors. You can use any of the built-in Vega color schemes, or define your own using the methods discussed there. From your example, it might look something like this:
color=alt.condition(
selection,
alt.Color('Date:T', scale=alt.Scale(scheme='reds')),
alt.value('lightgray')
)
is it possible to assign one color scheme/shade (instead of shapes) to 'types'?
No, there is no built-in way to apply two color scales based on two fields in the data (how would a mark choose between the two colors assigned to it?) One possible approach would be to use an opacity encoding for the second field, which is reflected in the lightness of the marks. For your example, it might look like this:
opacity='type:N'

How to dynamically change the colors of filling in JavaFx 8 area chart depending on whether negative or positive values

I need a area chart that can stylize the chart fill in a different color (red, e.g.) when this be negative.
How to do it in JavaFX?
http://i.stack.imgur.com/SSl5a.png
http://i.stack.imgur.com/nzag3.png
I think the easiest way to achieve this is to create two XYCHartSeries for your Chart.
One for the negative values and one for the positives. Then you can set the color of the ChartSeries with CSS like this:
positiveChart.setId("positiveValues");
positiveChart.setStyle("#positiveValues {-fx-bar-fill: #4CAF50 }");

Is it possible to customize the displayValue color individually in fusioncharts?

I am using the 3D Bar chart in FusionCharts. I have displayValues set to display numeric and textual values above the top of the bars. What I would like to be able to do is set the color of individual displayValues differently, for example, if the year-over-year change is positive, color the displayValue for just that bar to green, if it is negative, color it red, etc. Is this possible?
There is no direct way of coloring data plots or data values based on its value. But FusionCharts has an extensive API used to configure Annotations. You can use this API to create texts (data values). Just a rough thought came into my mind.

How do you heatmap in tavleau a list of numbers based on another column data

I have data from 48 countries. I am trying to visualize it on a map. I want to display half the countries in 1 color and the other half in another color. This segmentation is based on another column which has string value 'yes' or 'no'. I want to do it on tableau
Country data OFF
------------------------
US 100,000 yes
IN 200,000 yes
BR 300,000 no
MX 150,000 no
I want to plot US, IN in Blue and BR, MX in green. The shades of green and blue are dependent on the values of data.
Have you tried to drag the OFF field to Color in the sheet? This should do the trick
You can put either the measure data on the color shelf to color by value, or the dimension OFF on the color shelf to color by OFF -- i.e. to use color to encode a single field's value.
If you want to color by two dimension fields, you can get the shading effect you mention by putting both on the color shelf -- using the shift key to add the second one if it's not in a hierarchy with the first one.
If you want to color by both a dimension and a measure (as in your case), you have to go to a little more effort -- assuming its worth it. You can make a calculated field that uses both fields to map into a category (say returning a string like "off yes, data high" or "off yes, data mid") and then edit the colors to map them as you like.

UISlider to represent the color spectrum

I have a UISlider that is supposed to update the color of a textlabel. Now I want the user to be able to choose between all colors in the spectrum (sort of all anyway). I was thinking of using this UISlider to represent the colors and when dragging the slider the value/color changes.
I know the spectrum is not sequential like: [0,0,0]...[255,0,0]...[255,1,0]...[255,255,0] etc.
So: any tip on how I can implement this?
Color is at least a two or three dimensional selection. And a slider only provides a scalar output. If you want a smoothly changing selection using only a scalar parameter, you might try drawing a path line on some color chart (or a functional representation thereof) and select a point on that path parametrically.
Yes, color is a multidimensional value, but there are different ways to slice those dimensions. I think a hue, saturation, brightness constructor, rather than RGB, will give you exactly the effect you want. For example, often I will generate a random color with [UIColor colorWithHue:<random float in [0,1]> saturation:1.f brightness:1.f alpha:1.f].
Slide hue linearly from 0 to 1, with saturation and brightness fixed at the most legible (or whatever) values.