Reputation: 725
I am having problem nvd3 tooltip in multichart(multilinechart)
. Here my XAxis
label are JAN,FEB,MAR... DEC.
But when i mouse over in the graph it is showing 0,1,2,3.. 11
as tooltip title. But i need to show JAN,FEB.. DEC
instead of index. Here is my chart option code,
{
"chart": {
"type": "multiChart",
"height": 400,
"interpolate": "linear",
"showLegend": false,
"margin": {
"top": 50,
"right": 100,
"bottom": 60,
"left": 100
},
"reduceXTicks": false,
"useVoronoi": false,
"useInteractiveGuideline": true,
"duration": 500,
"xAxis": {
"axisLabel": "MONTHLY",
"tickPadding": 10,
"tickSize": 1,
"tickValues": [
0,
1,
2,
3,
4,
5,
6
]
},
"yAxis1": {
"axisLabel": "Left",
"tickPadding": 10
},
"yAxis2": {
"axisLabel": "Right",
"width": 60,
"tickPadding": 10
},
"yDomain1": [
0,
5
],
"yDomain2": [
0,
100
]
}
}
Here is the issue in image (Need to show FEB but it is showing 1),
Here is second(Need to show MAR but it is showing 2)
Please some one help to identify the issue,
Thanks in Advance.
Upvotes: 0
Views: 120
Reputation: 1606
You can try to use a method interactiveLayer.tooltip.headerFormatter
to edit header's label, like:
chart.interactiveLayer.tooltip.headerFormatter(d => {
if (typeof d === 'string') return d
})
Upvotes: 1