spikes: plotly customisation
It seems that customising plotly can become difficult once introducing more unique properties to the style of a graph. In this case changing the colour of a graph was easy, but adding a border to the top of the graph only becomes cumberson.
This commit is contained in:
parent
7cabc1b7aa
commit
904328bfca
@ -16,23 +16,29 @@ const PlotlyGraph = React.createClass({
|
|||||||
const datatime = data.map((d, i) => i);
|
const datatime = data.map((d, i) => i);
|
||||||
|
|
||||||
const graphTypes = [{
|
const graphTypes = [{
|
||||||
type: 'scatter',
|
type: 'bar',
|
||||||
mode: 'lines+markers'
|
marker: {
|
||||||
|
color: 'rgba(205, 54, 54, 0.3)'
|
||||||
|
}
|
||||||
}, {
|
}, {
|
||||||
type: 'bar'
|
type: 'bar',
|
||||||
|
marker: {
|
||||||
|
color: 'rgba(54, 74, 205, 0.3)'
|
||||||
|
}
|
||||||
}];
|
}];
|
||||||
|
|
||||||
const graphs = graphTypes.map((graphType, i) => {
|
const graphs = graphTypes.map((graphType, i) => {
|
||||||
const data = {
|
const data = {
|
||||||
type: graphType.type,
|
type: graphType.type,
|
||||||
mode: graphType.mode,
|
mode: graphType.mode,
|
||||||
|
marker: graphType.marker,
|
||||||
x: datatime,
|
x: datatime,
|
||||||
y: cpu
|
y: cpu
|
||||||
};
|
};
|
||||||
|
|
||||||
const layout = {
|
const layout = {
|
||||||
barmode: graphType.mode
|
barmode: graphType.mode
|
||||||
}
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Plotly
|
<Plotly
|
||||||
|
Loading…
Reference in New Issue
Block a user