Skip to content
Snippets Groups Projects
Commit 5f442230 authored by esikkala's avatar esikkala
Browse files

ApexCharts: test custom tooltip formatting

parent cedcb22a
No related branches found
No related tags found
No related merge requests found
......@@ -74,11 +74,13 @@ const ChartDialog = props => {
}
},
tooltip: {
// enabled: false,
followCursor: false,
fixed: {
enabled: true,
position: 'topRight'
custom: ({ series, seriesIndex, dataPointIndex, w }) => {
console.log(seriesIndex)
return `
<div class="arrow_box">
<span>${series[seriesIndex]}</span>
</div>
`
}
}
}}
......
......@@ -64,8 +64,10 @@ class ApexChart extends React.Component {
let otherCount = 0
const totalLength = this.props.data.length
const threshold = 0.15
let sum = 0
this.props.data.map(item => {
const portion = parseInt(item.instanceCount) / totalLength
sum += item.instanceCount
if (portion < threshold) {
otherCount += parseInt(item.instanceCount)
} else {
......@@ -91,7 +93,8 @@ class ApexChart extends React.Component {
...this.props.options,
series,
labels,
colors: chartColors
colors: chartColors,
sum
}
// Destroy the previous chart
if (!this.chart == null) {
......
......@@ -17,7 +17,7 @@ export const perspectiveConfig = [
id: 'perspective1',
frontPageImage: manuscriptsImage,
perspectiveDescHeight: 160,
defaultActiveFacets: new Set(['prefLabel']),
defaultActiveFacets: new Set(['prefLabel', 'language']),
tabs: [
{
id: 'table',
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment