I am wondering if it is possible to set the background color of an edge label with cytoscape? I am setting the rest of the edge styles like this.
style: cytoscape.stylesheet()
.selector("edge")
.css({
"line-color": "#444444",
"width": 4,
"content": "data(length)"
})
You can set an outline on edge labels: http://js.cytoscape.org/#style/labels
Related
I am working on a time series chart and wondering if it's possible for a chart to have like a gradient background. This is the pen of what I currently have:
https://codepen.io/boinx-fm/pen/RqogXV
var data = [{
x: [time],
y: [rand()],
mode:'lines',
fill:'tozeroy',
fillcolor :'rgba(249, 180, 14, 0.5)
}];
Attached is the sample background I'm trying to achieve:
gradient background
Thanks!
Plotly.js does not support gradient color at this moment.
You can subscribe to https://github.com/plotly/plotly.js/issues/581 for development info.
To change background color of the layout:
var layout = {
xaxis:{
range:[newTime,nextTime]
},
yaxis:{
range:[0,1],
zeroline: false,
showline: false,
autotick: true,
ticks: '',
showticklabels: false
},
// Change background color here ...
paper_bgcolor: 'green',
plot_bgcolor: 'blue'
}
I was wondering if there is a way to have css styling inside of this chart title.
chart.allLabels = [{
'text': "<strong style='color:#666;font-size:18px'>80</strong>",
'align': 'center',
'y': '100'
}];
This just shows as the literal string instead of styling the <strong> tag.
Is this possible?
Since labels on the chart are SVG nodes, they do not support HTML and related CSS.
Looking at your example, it seems that you need to apply the following to the whole label:
Make it bold
Set color to #666
Set font size to 18
All this is doable with label's properties:
chart.allLabels = [ {
"text": "80",
"align": "center",
"y": "100",
"bold": true,
"size": 18,
"color": "#666"
} ];
Another option is to use CSS, as #gerric suggested in a comment.
I am using the kendo color pallete control like so:
$(".palette").kendoColorPalette({
columns: 5,
tileSize: {
width: 34,
height: 19
},
palette: [
"#735096", "#a7447d", "#9d2b12", "#c7560a", "df7700",
"#3f5caf", "#0293a0", "#4d9954", "#7e9c22", "#b18d00",
"#00517f", "#000000", "#575757", "#818181", "#74661b"
],
change: this.preview
});
Annoyingly when I select a color, the kendo grid applies the .k-state-selected class which sets a background colour thus overriding the tiles colour. Is there a way to disable this class being applied?
I’m trying to change the background colors of a highcharts scatter plot. I can easily change the color of the section with this code below. However, I need change the background to more than one color. Essentially I’m trying shade the area from 60-100 with dark gray and also color the area 100-120 with light gray and than 40-60 with light gray. This is going to be a confidence plot, so I feel as if this is a feature that should be fairly common but I cannot find a solution.
this code adds a light gray background to the plot..
plotBands: [{
from: 60,
to: 100,
color: '#d9d9d9'
}]
Fiddle: Fiddle Here...
Just pass another object to plotBands array:
Updatated fiddle: http://jsfiddle.net/osevj9m3/1/
plotBands: [{
from: 60,
to: 100,
color: '#d9d9d9'
},
{
from: 100,
to: 120,
color: '#333'
}]
Simply modify your plotBands to be
plotBands: [{
from: 60,
to: 100,
color: '#d9d9d9'
},{
from: 40,
to: 10,
color: '#d0d9d9'
}],
Thanks,
-K
I've tried to look after a function that can change the vertical yAxis line color, but without luck.
Which function can I use for changing the color?
This is the color I want to change, so 77, 78, 79 etc is another color.
Hope someone can help :-)
You can use style in yAxis.labels for the label colors, and gridLineColor for the line colors:
yAxis: {
labels: {
style: {
color: 'red'
}
},
gridLineColor: 'red'
}
http://jsfiddle.net/fehjnp5a/1/