xlsxwriter format for pattern seems... buggy? - xlsxwriter

So I tried to apply a pattern with a format class in xlsxwriter.
import xlsxwriter
wb = xlsxwriter.Workbook("Temp.xlsx")
sheet = wb.add_worksheet()
blank_pattern_format = wb.add_format({
'align':'center',
'valign' : 'vcenter',
'border' : 1,
'shrink' : True,
'font_size' :10,
'bold' : True,
'pattern' : 4,
})
sheet.write("A1","",blank_pattern_format)
wb.close()
I wanted the forth pattern which is "25% gray" in Excel. But the outcome is just solid black for that cell.
The interesting part is, when I check the property of that black cell, it actually shows that it has None color for bg_color, and also "25% gray" pattern is applied to that cell.
I tried to copy the format to other cell in excel. And it turned to the solid black one as well.
But when I got into the cell property again, and chose the exact same pattern("25% gray")(which was shown as already being chosen), and clicked confirm without adjusting anything else, it now shows as 25% gray pattern and not the solid black one.
I think this means there can be a bug in xlsxwriter module for patterns. Is there I can do to fix this case? Or any walk-around maybe? (Documents about pattern in format class was short and not that helpful to fix this case)
Hope you guys can enlighten me. Thanks in advance!

It may be a bug. There are some odd Excel edge conditions when the foreground and background colors aren't specified. I'll look into it.
In the meantime you can work around the issue by specifying a background color:
import xlsxwriter
wb = xlsxwriter.Workbook('temp.xlsx')
sheet = wb.add_worksheet()
blank_pattern_format = wb.add_format({
'align': 'center',
'valign': 'vcenter',
'border': 1,
'shrink': True,
'font_size': 10,
'bold': True,
'pattern': 4,
'bg_color': 'white',
})
sheet.write('A1', '', blank_pattern_format)
wb.close()
Output:

Related

How to give a padding in between x-axis labels in React-Native-Chart-Kit?

Is there a way to give a custom space/padding in between x-axis Labels in React-Native-Chart-Kit? Example if we have labels from Jan-Dec, x-axis labels in the chart gets very compact. And even if we give a custom space between x-axis Labels then how do we give a Horizontal scroll feature for the full chart since it overflows onto the right side. Tried with following. Didn't work. Please help. Thanks.
propsForLabels: {
fontSize: "14",
fill: "rgba(10, 10, 10, 1)",
fontWeight: 500,
padding: 5
},
You can try horizontalOffset or check this issue looks like you can use patch or fork from this issue https://github.com/indiespirit/react-native-chart-kit/issues/538 to resolve your problem.

How to change color of comment marker for Atom editor?

I was able to change color of comment content with
atom-text-editor::shadow .comment {
color: #E4F4FD;
}
But the color of comment marker stayed unchanged:
How do I change the color of comment marker?
If you place your cursor immediately to the left of the character you want to style and then press Ctrl-Alt-Shift-P all of the scopes for that character will be displayed in an information box:
You can then incorporate this into your stylesheet as you have with the body of the comment:
atom-text-editor::shadow {
.comment {
color: #E4F4FD;
}
.punctuation.definition.comment {
color: #E4F4FD;
}
}
Because it is LESS, it is possible to nest classes which will make your style sheet much cleaner.
Using ATOM version 1.58.0 on Windows 10, I get a depreciation warning. The short version is:
Starting from Atom v1.13.0, the contents of atom-text-editor elements are no longer encapsulated within a shadow DOM boundary. This means you should stop using :host and ::shadow pseudo-selectors, and prepend all your syntax selectors with syntax--.
I had to use:
// Change the color of the comments
atom-text-editor .syntax--comment{ color:#9DA5B3; }
atom-text-editor .syntax--punctuation.syntax--definition.syntax--comment{ color:#9DA5B3; }

How to use CSS to change font color of emptyText

I am using a non-editable objectPicker and setting the empty text:
this.statePicker = Ext.create('Rally.ui.picker.MultiObjectPicker', {
modelType: 'State',
id: 'statePicker',
matchFieldWidth: false,
editable:false,
emptyText: "Select...",
placeholderText: "Select...",
width: 80,
listeners: {
select: this._getFilter,
deselect: this._getFilter,
scope: this
},
});
I want to format the emptyText (emptyText: "Select...",) to be white with a background color. Using the below CSS, the background color displays perfectly, but the text color stays gray.
.x-form-empty-field {
color: #FFFFFF !important;
background-color: #085478;
}
Ihave tried other classes but none change the font. It stays gray! Please help?
The 'emptyText' is applied to the field using the 'placeholder' HTML5 attribute. The answer is going to vary depending on which browser you are using.
Here is a guide that demonstrates how to style the placeholder text in the various browsers that support it: http://css-tricks.com/snippets/css/style-placeholder-text/
Here is some useful information about the placeholder attribute in general (also includes styling examples): http://www.hongkiat.com/blog/html5-placeholder/
Hope this helps!

Questions on formatting and clearing the rallymultiobjectpicker

I am using the rallymultiobjectpicker to filter my grid but need some help on the following:
var cb = Ext.create('Rally.ui.picker.MultiObjectPicker', {
modelType: 'Project',
id: 'projectPicker',
matchFieldWidth: false,
editable:false,
emptyText: "Project",
//emptyCls: 'x-form-empty-field',
placeholderText: "",
loadingText: "",
width: 80
});
1: How do I clear the selected values (the combobox has the clearValue method)?
2: I am using a non editable ObjectPicker and setting the empty text. I want to format the emptyText to be white with a background color using CSS styling. The background color displays perfectly, but the text color stays gray no matter what class I use!
.x-form-empty-field {
color: #FFFFFF !important;
background-color: #085478;
}
4: How do I remove or hide the Search icon?
3: Is it possible to use a WsapiDataStore instead of a modelType as a data source?
I have struggled with this for days, any help would be much appreciated!
To clear the ObjectPicker selected values, ObjectPicker.setValue([]) works perfectly - thanks Kyle.
(I have opened a new question for queries 2and 4)

How can I change the color a label on a bar chart?

Using the example from the docs Ext.chart.series.Bar it should be pretty easy to achieve this.
The series has a label config that contains a color properties. Changing this has no effect. Or am I missing something?
I would like to display a white text on top of the bars.
Working code for the example
http://jsfiddle.net/dfDb8/
On line 48 I try to set the color to white
label: {
display: 'insideStart',
field: 'data',
renderer: Ext.util.Format.numberRenderer('0'),
orientation: 'horizontal',
color: '#fff' //this is what I want to change
'text-anchor': 'middle'
},
Any ideas?
The following attribute:
fill: '#fff'
seems to work. I am not completely sure why though.