Commit abb866ec authored by Dida Adams Arizona's avatar Dida Adams Arizona

Merge branch 'GGMAC' into 'master'

update

See merge request !1158
parents c3258179 521aa617
...@@ -316,6 +316,28 @@ export default class DashboardFinancial extends React.Component { ...@@ -316,6 +316,28 @@ export default class DashboardFinancial extends React.Component {
"month_to": this.state.month2.month_id "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) => { api.create().getDashboardFinancial(payload).then((res) => {
console.log(res) console.log(res)
if (res.data) { if (res.data) {
...@@ -327,7 +349,7 @@ export default class DashboardFinancial extends React.Component { ...@@ -327,7 +349,7 @@ export default class DashboardFinancial extends React.Component {
let totalAssets = [] let totalAssets = []
response.revenue.nodes.map((item,index) => { response.revenue.nodes.map((item,index) => {
revenue.push({ revenue.push({
"company": item.company, "company": handleName(item.company),
"MB": item.value_mb, "MB": item.value_mb,
"MBColor": "hsl(212, 64%, 46%)", "MBColor": "hsl(212, 64%, 46%)",
"MR": item.value_mr, "MR": item.value_mr,
...@@ -338,7 +360,7 @@ export default class DashboardFinancial extends React.Component { ...@@ -338,7 +360,7 @@ export default class DashboardFinancial extends React.Component {
response.tpat.nodes.map((item,index) => { response.tpat.nodes.map((item,index) => {
tpat.push({ tpat.push({
"company": item.company, "company": handleName(item.company),
"MB": item.value_mb, "MB": item.value_mb,
"MBColor": "hsl(212, 64%, 46%)", "MBColor": "hsl(212, 64%, 46%)",
"MR": item.value_mr, "MR": item.value_mr,
...@@ -349,7 +371,7 @@ export default class DashboardFinancial extends React.Component { ...@@ -349,7 +371,7 @@ export default class DashboardFinancial extends React.Component {
response.ebitda.nodes.map((item,index) => { response.ebitda.nodes.map((item,index) => {
ebitda.push({ ebitda.push({
"company": item.company, "company": handleName(item.company),
"MB": item.value_mb, "MB": item.value_mb,
"MBColor": "hsl(212, 64%, 46%)", "MBColor": "hsl(212, 64%, 46%)",
"MR": item.value_mr, "MR": item.value_mr,
...@@ -611,14 +633,15 @@ export default class DashboardFinancial extends React.Component { ...@@ -611,14 +633,15 @@ export default class DashboardFinancial extends React.Component {
// legendOrientation: 'vertical', // legendOrientation: 'vertical',
legendOffset: 50, legendOffset: 50,
}} }}
// axisLeft={{ axisLeft={{
// tickSize: 5, tickSize: 5,
// tickPadding: 5, tickPadding: 5,
// tickRotation: 0, tickRotation: 0,
// legend: 'food', legend: '(Rp bn)',
// legendPosition: 'middle', legendPosition: 'middle',
// legendOffset: -40 legendOffset: -60
// }} }}
// axisRight={{ format: v => `${v}%`, legend: '(%)', legendOffset: 52 }}
labelSkipWidth={12} labelSkipWidth={12}
labelSkipHeight={12} labelSkipHeight={12}
labelTextColor={{ from: 'color', modifiers: [['darker', 1.6]] }} 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