Commit 521aa617 authored by d.arizona's avatar d.arizona

update

parent 60580734
......@@ -316,6 +316,28 @@ export default class DashboardFinancial extends React.Component {
"month_to": this.state.month2.month_id
}
}
const handleName = (name) => {
let newName = ''
if(String(name).includes(':')) {
let indexTidu = String(name).indexOf(':')
let indexSpace = String(name).indexOf(' ')
if (indexTidu > indexSpace) {
newName = String(name).substr(0,indexSpace)
} else {
newName = String(name).substr(0,indexTidu)
}
} else {
// if (String(name).includes('Consolidated')) {
// newName = `asd \n baba`
// } else {
let splitName = String(name).split(' ')
console.log(splitName)
newName = name
// }
}
return newName
}
api.create().getDashboardFinancial(payload).then((res) => {
console.log(res)
if (res.data) {
......@@ -327,7 +349,7 @@ export default class DashboardFinancial extends React.Component {
let totalAssets = []
response.revenue.nodes.map((item,index) => {
revenue.push({
"company": item.company,
"company": handleName(item.company),
"MB": item.value_mb,
"MBColor": "hsl(212, 64%, 46%)",
"MR": item.value_mr,
......@@ -338,7 +360,7 @@ export default class DashboardFinancial extends React.Component {
response.tpat.nodes.map((item,index) => {
tpat.push({
"company": item.company,
"company": handleName(item.company),
"MB": item.value_mb,
"MBColor": "hsl(212, 64%, 46%)",
"MR": item.value_mr,
......@@ -349,7 +371,7 @@ export default class DashboardFinancial extends React.Component {
response.ebitda.nodes.map((item,index) => {
ebitda.push({
"company": item.company,
"company": handleName(item.company),
"MB": item.value_mb,
"MBColor": "hsl(212, 64%, 46%)",
"MR": item.value_mr,
......@@ -611,14 +633,15 @@ export default class DashboardFinancial extends React.Component {
// legendOrientation: 'vertical',
legendOffset: 50,
}}
// axisLeft={{
// tickSize: 5,
// tickPadding: 5,
// tickRotation: 0,
// legend: 'food',
// legendPosition: 'middle',
// legendOffset: -40
// }}
axisLeft={{
tickSize: 5,
tickPadding: 5,
tickRotation: 0,
legend: '(Rp bn)',
legendPosition: 'middle',
legendOffset: -60
}}
// axisRight={{ format: v => `${v}%`, legend: '(%)', legendOffset: 52 }}
labelSkipWidth={12}
labelSkipHeight={12}
labelTextColor={{ from: 'color', modifiers: [['darker', 1.6]] }}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment