Skip to content

Commit

Permalink
Fix sytle error
Browse files Browse the repository at this point in the history
  • Loading branch information
markdoeswork committed Dec 6, 2024
1 parent 7bc6390 commit 8d7f496
Showing 1 changed file with 35 additions and 33 deletions.
Original file line number Diff line number Diff line change
@@ -1,43 +1,45 @@
import React from 'react'
import BarGraph from 'playbook-ui'

import BarGraph from '../_bar_graph'

const chartData = [{
name: 'Role',
data: [0, 200, 300, 654, 656],
}, {
name: 'Company',
data: [150, 524, 320, 440, 500],
}]
const chartData = [
{
name: 'Role',
data: [0, 200, 300, 654, 656],
},
{
name: 'Company',
data: [150, 524, 320, 440, 500],
},
]

const barGraphOptions = {
subtitle: {
text: "Overwritten subtitle",
text: 'Overwritten subtitle',
style: {
color: "red"
}
color: 'red',
},
},
xAxis: {
labels: {
useHTML: true,
formatter: function() {
switch (this.value) {
case 'Angry':
return `<i style="color: red; font-size: 18px;" class="far fa-face-angry"></i> `
case 'Frown':
return `<i style="color: orange; font-size: 18px;" class="far fa-face-frown"></i>`
case 'Meh':
return `<i style="color: grey; font-size: 18px;" class="far fa-face-meh"></i>`
case 'Smile':
return `<i style="color: #63E6BE; font-size: 18px;" class="far fa-face-smile"></i>`
case 'Laugh':
return `<i style="color: green; font-size: 18px;" class="far fa-laugh-beam sucess"></i>`
default:
return ''
}
}
}
}
labels: {
useHTML: true,
formatter: function () {
switch (this.value) {
case 'Angry':
return '<i style="color: red; font-size: 18px;" class="far fa-face-angry"></i>'
case 'Frown':
return '<i style="color: orange; font-size: 18px;" class="far fa-face-frown"></i>'
case 'Meh':
return '<i style="color: grey; font-size: 18px;" class="far fa-face-meh"></i>'
case 'Smile':
return '<i style="color: #63E6BE; font-size: 18px;" class="far fa-face-smile"></i>'
case 'Laugh':
return '<i style="color: green; font-size: 18px;" class="far fa-laugh-beam sucess"></i>'
default:
return ''
}
},
},
},
}

const BarGraphCustom = (props) => (
Expand All @@ -49,7 +51,7 @@ const BarGraphCustom = (props) => (
legend
subTitle="Subtitle to replace"
title="Bar Graph with Custom Overrides"
xAxisCategories={['Angry', 'Frown', 'Meh', 'Smile', 'Laugh']}
xAxisCategories={['Angry', 'Frown', 'Meh', 'Smile', 'Laugh']}
yAxisMin={0}
{...props}
/>
Expand Down

0 comments on commit 8d7f496

Please sign in to comment.