我有一种方法可以定义 Google可视化API提供的动态图表中的气泡颜色?我不想使用默认颜色方案。
提前谢谢。
答案 0 :(得分:1)
我没有找到一种内置的方法来做到这一点。但是,您可以做的是为每个气泡分配一个“颜色”变量。然后,您可以将气泡的颜色设置为此变量。我发现,对于3个气泡,将1设置为1,将另一个设置为1.5,将第三个设置为3个项目合理得好(在默认配色方案中,黄色项目非常差)。这种方法可以让您对配色方案进行有限的控制。
答案 1 :(得分:0)
这是2017年,我还没有找到一个很好的更新。所以这是我提出的解决方案。 HTH。
#Define the directory containing your .pdf files
$mydir="$env:USERPROFILE\Desktop\New folder"
function print_files($mydir){
#The purpose of this counter is to number your .xps files
Get-ChildItem $mydir -Filter *.pdf -Recurse | Foreach-Object {
#For each .pdf file in that directory, continue
same_time $_.FullName
}
}
#The following function keeps checking for a new window called "Save Print Output As". When the window shows up, it enters the name of the file and press ENTER.
function enter_my_names($fullname){
$wshell = New-Object -ComObject wscript.shell;
while($wshell.AppActivate('Save Print Output As') -ne $true){
$wshell.AppActivate('Save Print Output As')
}
$basename = [io.path]::GetFileNameWithoutExtension($fullname)
#This is where the name is actually entered
$wshell.SendKeys("$basename")
$wshell.SendKeys("{ENTER}")
}
#The following function launches simultaneously a print job on the input file and a function waiting for the print job to show up to name the file.
workflow same_time{
Param(
$fullname
)
parallel{
Start-Process -FilePath $fullname –Verb Print -PassThru
enter_my_names($fullname)
}
}
#MAIN PROGRAM
#Here the script saves your current printer as default
$defprinter = Get-WmiObject -Query "Select * from Win32_Printer Where Default=$true"
#Queries for a XPS printer
$printer = Get-WmiObject -Query "Select * from Win32_Printer Where Name='Microsoft XPS Document Writer'"
#Sets the XPS printer as Default
$printer.SetDefaultPrinter()
#Starts the main job
print_files($mydir)
#Sets the old default printer back as default again
$defprinter.SetDefaultPrinter()
#This is a small delay to be sure everything is completed before closing Adobe Reader. You can probably shorten it a bit
sleep 5
#Finally, close Adobe Reader
Get-Process "acrord32" | Stop-Process
...来源中的r: data.append(r.a,r.b,r.c,r.d,r.e)
#views.py
# Bubble Chart: ID, X, Y Color, Size
data.append(['ID', 'X', 'Y', 'Category', 'Z'])
data.append(['', 0, 0, 'Cat 1', 0]) #<-- the order of
data.append(['', 0, 0, 'Cat 2', 0]) #<-- these fakeout items
data.append(['', 0, 0, 'Cat 3', 0]) #<-- is important
data.append(['', 0, 0, 'Cat 4', 0]) #<-- Blue, Red, Orange, Green - in that order