Skip to content

Commit

Permalink
format horizontal chart
Browse files Browse the repository at this point in the history
  • Loading branch information
edbrett committed Jun 1, 2018
1 parent b40d5ad commit a9b78e8
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react';
import PropTypes from 'prop-types';
import { format } from 'd3-format';
import { formatNumber } from 'utils/format';
import Link from 'redux-first-router-link';

const CustomTick = ({ x, y, index, yAxisDotFill, data, settings }) => {
Expand All @@ -22,13 +22,13 @@ const CustomTick = ({ x, y, index, yAxisDotFill, data, settings }) => {
<text x="8" y="-16" textAnchor="start" fontSize="12px" fill="#555555">
{extLink ? (
<a href={path} target="_blank" rel="noopener nofollower">
{region} - {format('.1f')(total)}%{' '}
{index === 0 ? 'are plantations' : ''}
{region} - {formatNumber({ num: total, unit: '%' })}
{index === 0 ? ' are plantations' : ''}
</a>
) : (
<Link to={path}>
{region} - {format('.1f')(total)}%{' '}
{index === 0 ? 'are plantations' : ''}
{region} - {formatNumber({ num: total, unit: '%' })}
{index === 0 ? ' are plantations' : ''}
</Link>
)}
</text>
Expand Down

0 comments on commit a9b78e8

Please sign in to comment.