HighCharts: Color of label according to the color of pie slice - colors

Title of this questions says everything. I only found out how to change the color of connectors. If I delete the color: option, they´re all grey. I tried to put in the field with stored colors in hex, with no result, stayed black.

In dataLabels.formatter you have access to this.point.color. So simple set useHTML: true for dataLabels, and create spans with specified colors.

the formatter function gives you a callback object, which has a color property that can be set with the color of your choice
formatter: (format) ->
format.color = #point.color

Related

Openpyxl: Decode 'auto' color to rgb value

I am trying to determine the color of borders set in an Excel document. I use the 'openpyxl' library (latest Version 3.0.9) and encountered a problem to extract the rgb color code when the user sets the border via the default 'auto' color.
When I extract the cell color property, I see this (in my debugger, see screenshot). None of the cell fields are set with an RGB code, the fields indicate some problem with extracting the color information. I assume this is due to the 'auto' color.
The index color probably refers to this in documentation:
Default Color Index as per 18.8.27 of ECMA Part 4
COLOR_INDEX = (
'00000000', '00FFFFFF', '00FF0000', '0000FF00', '000000FF', #0-4
'00FFFF00', '00FF00FF', '0000FFFF', '00000000', '00FFFFFF', #5-9
'00FF0000', '0000FF00', '000000FF', '00FFFF00', '00FF00FF', #10-14
'0000FFFF', '00800000', '00008000', '00000080', '00808000', #15-19
'00800080', '00008080', '00C0C0C0', '00808080', '009999FF', #20-24
'00993366', '00FFFFCC', '00CCFFFF', '00660066', '00FF8080', #25-29
'000066CC', '00CCCCFF', '00000080', '00FF00FF', '00FFFF00', #30-34
'0000FFFF', '00800080', '00800000', '00008080', '000000FF', #35-39
'0000CCFF', '00CCFFFF', '00CCFFCC', '00FFFF99', '0099CCFF', #40-44
'00FF99CC', '00CC99FF', '00FFCC99', '003366FF', '0033CCCC', #45-49
'0099CC00', '00FFCC00', '00FF9900', '00FF6600', '00666699', #50-54
'00969696', '00003366', '00339966', '00003300', '00333300', #55-59
'00993300', '00993366', '00333399', '00333333', #60-63
)
# indices 64 and 65 are reserved for the system foreground and background colours respectively
The documentation says that Index 64 is reserved so there is no point in trying to access the color array (max index is 63).
Source: https://openpyxl.readthedocs.io/en/stable/_modules/openpyxl/styles/colors.html
I can be brave and deal with index 64 as black, which seems to be the eternal auto-color anyway but I am wondering if there is a proper way to decode the 'auto' color from Excel?
System colours are set by the application. Windows defaults will be white background and black foreground. You can check the colors part of the styles.xml to see if these have been overriden, but really the client application gets to decide.

Is there any way to give gradient color to normal color property in flutter?

I am using Bar Chart of fl_chart plugin. I want to give gradient color to bar graph. Below is the line where I want give color.
BarChartRodData(y: 12, color: Color(0xFF639ed1),width: 12)
But it is not possible to set gradient color to the ##color## property unless it is colors.
Is there any way to set gradient color to color property?? Please help me..
If you pass just one color, the solid color will be used, or if you pass more than one color, we use gradient mode to draw. then the gradientFrom, gradientTo and gradientColorStops
For an example ,
final List<Color> color = <Color>[];
color.add(Colors.blue[50]);
color.add(Colors.blue[100]);
color.add(Colors.blue);
final List<double> stops = <double>[];
stops.add(0.0);
stops.add(0.5);
stops.add(1.0);
Please refer https://pub.dev/documentation/fl_chart/latest/fl_chart/BarChartRodData-class.html for BarChartRodData class variables

How to adjust style of table cell border?

When I add a cell to a table, I can manipulate its thickness (borderBottomSize), its color (borderBottomColor) but not its style (dashed, dotted, longdashed, ...).
When I read the code, the PhpOffice\PhpWord\Style\Cell extends the PhpOffice\PhpWord\Style\Border.
And the border class has the attribute borderBottomStyle.
But how to configure that?
I also looked into the PhpOffice\PhpWord\Style\Line, there I can find some "dashStyles", but none of them are working...
My question: How to change style of border (from strong line to for example dotted)?
You can define the style of the border by using the cell style property borderStyle. By default, it's set to solid, but you can use other values like dashed, dotted, double, etc. Sadly, this feature is not documented so I don't know all the available styles.
Don't forget to add a border size as well, otherwise no border will be rendered.
Example for a dotted cell:
$dottedCell = $tableRow->addCell($cellWidth, ['borderStyle' => 'dotted', 'borderSize' => 6]);

Change Highmaps map colour

I want to be able to change the colour of this exact entire map. I am using map bubble I want a darker color for the countries and continents. how can i achieve this as colorAxis will change the data representation(bubble) colour not the map colour.
http://jsfiddle.net/gh/get/jquery/1.9.1/highslide-software/highcharts.com/tree/master/samples/maps/demo/map-bubble/
apparently this does not work :(
colorAxis : {
color: 'red'
},
You can try replacing color property with nullColor. What it does is changing the color of all shapes to red.
Please check my fiddle: JSFIDDLE
{
name: 'Countries',
mapData: mapData,
//color: '#E0E0E0',
nullColor: 'red',
enableMouseTracking: false
}
Thanks

d3.js color range and lighter color range

I would like to have two color ranges, the second one must consist off the same colors, but lighter.
rangeLength=10
color = d3.scale.linear().domain([1,rangeLength]).range(['red', 'blue']);
colorLigher= d3.scale.linear().domain([1,rangeLength]).range(['red'.lighter(10), 'blue'.lighter(10)]);
Obviously doesn't work, as 'red' is a string.
Thanks in advance
You can use the brighter() function (see the documentation):
length=10
color = d3.scale.linear().domain([1,length]).range(['red', 'blue']);
colorLighter= d3.scale.linear().domain([1,length])
.range([d3.rgb('red').brighter(), d3.rgb('blue').brighter()]);

Resources